#407·pentagi

> ## Summary

Author: khunwavCreated Sep 12, 2026Updated Sep 12, 2026

Summary

  • Adds Deaf Guard, an optional pre-execution classifier on terminal tool calls. Commands are matched against a 9-tier regex table (log / warn / block) before they run in the sandbox.
  • Operators can set DEAF_GUARD_ENABLED / DEAF_GUARD_MODE in env, toggle them at runtime in Settings → Security, and watch live classifications on a Deaf Guard tab in the flow view.
  • Default posture is log (classify and record only). warn blocks BLOCK-tier commands; enforce blocks BLOCK and WARN. Runtime UI/API changes apply to the next flow, not already-running ones.

This is offered as an opt-in safety layer for autonomous pentest runs. Config defaults stay on observation (enabled=true, mode=log) so existing workflows are not blocked unless an operator tightens the mode.

Test plan

  • cd backend && go test ./pkg/tools/deafguard/ ./pkg/config/
  • cd frontend && pnpm exec tsc -b and pnpm exec vitest run src/features/flows/deaf-guard/lib.test.ts src/lib/routes.test.ts src/components/layouts/settings/settings-sidebar.test.tsx
  • Confirm Settings sidebar shows Security, and a running flow shows the Deaf Guard tab between Agents and Searches
  • GET/PUT /api/v1/deafguard/config updates {enabled, mode}; a new flow picks up the change, an already-running flow does not
  • In log mode a BLOCK-tier command still executes and appears in the tab; in warn/enforce it returns BLOCKED by Deaf Guard ... without running

Originally posted by @khunwav in https://github.com/vxcontrol/pentagi/pull/394#issuecomment-5647937417