Mastra Agent Guardrail Middleware
这是 CodeAlive 公开的项目资料。本站按原始来源展示项目信息,用中文说明适用场景和阅读边界;项目名、源帖与代码保持原样,便于逐项核对。
这条案例记录了什么
场景
安全与权限门禁、Agent 与模型路由
提供风险或支持程度的判断信号;执行权限仍归应用规则。
证据
社区公开项目或作者演示
原始来源:GitHub repository。作者自述,本站未独立复现。
时间与作者
CodeAlive
记录日期:2026-09-18。日期与身份应以原始资料为准。
怎样核对这个项目
- 先打开原始来源,确认作者、日期与 Jev 在项目中的具体用途。
- 如果提供仓库,再检查代码、运行要求和许可证;仓库存在不代表本站已经运行成功。
- 对速度、成本、准确率和规模数字,查看原文的任务、环境和计算口径。
- 高风险动作是否单独授权。
- 误判后的阻断和恢复。
- 规则是否由程序执行。
- 路由候选是否完整。
原始文字与技术细节
以下内容保留原语言,供核对事实。中文页的场景说明是阅读提示,不是逐句翻译或实测结论。
展开英文项目摘要与原帖
项目摘要
This Mastra input processor asks Jev one typed blocking question and one category question about the latest message. The author reports a 0.39–0.44 s median on 58 messages from one production assistant; this is not a general safety benchmark.
来源原文
Input moderation for [Mastra](https://mastra.ai) agents on [TypeSafe Jev](https://typesafe.ai): one file, one request per turn, no text to parse.
原记录的限制
- Only the latest message is checked; output moderation is not supported.
- The processor fails open on timeout, HTTP or parse errors, so it cannot be the sole safety control.
- The 58-message result is author-reported and domain-specific, not independently reproduced.