#407·pentagi

> ## 摘要

作者: khunwav创建于 2026年9月12日更新于 2026年9月12日

摘要

  • 添加了Deaf Guard,这是一个可选的执行前分类器,用于 terminal 工具调用。在沙箱中运行命令之前,它们会与 9 级别的正则表达式表 (log / warn / block) 进行匹配。
  • 运营商可以在 env 中设置 DEAF_GUARD_ENABLED / DEAF_GUARD_MODE,在运行时在 Settings → Security 中切换它们,并在流程视图中的 Deaf Guard 选项卡上查看实时分类。
  • 默认姿态为 log(仅分类和记录)。warn 阻止 BLOCK 级别的命令;enforce 阻止 BLOCK 和 WARN。运行时的 UI/API 更改适用于下一个流程,而不是正在运行的流程。 这作为自动化 pentest 运行的一个可选安全层。配置默认保持观察模式(enabled=truemode=log),因此现有工作流程不会被阻止,除非运营商加强模式。

测试计划

  • cd backend && go test ./pkg/tools/deafguard/ ./pkg/config/
  • cd frontend && pnpm exec tsc -bpnpm exec vitest run src/features/flows/deaf-guard/lib.test.ts src/lib/routes.test.ts src/components/layouts/settings/settings-sidebar.test.tsx
  • 确认 Settings 侧边栏显示了 Security,并且运行中的流程在 Agents 和 Searches 之间显示了 Deaf Guard 选项卡
  • GET/PUT /api/v1/deafguard/config 更新了 {enabled, mode};新的流程会采用此更改,已经运行的流程不会
  • log 模式下,BLOCK 级别的命令仍然会执行并出现在选项卡中;在 warn/enforce 模式下,它会返回 BLOCKED by Deaf Guard ... 而不执行

内容来源: vxcontrol/pentagi