AgentApproval cannot be steered by the very tool arguments it is meant to police.
Quick Start
1
Use the hardened default
The default reviewer is auto-created with hardened instructions — no changes needed.
2
Opt into the hardened contract with a custom reviewer
A custom
approver_agent is unaffected unless you adopt the untrusted framing and tri-state verdict yourself.The Four Defences
The sanitiser only cleans the copy shown to the reviewer. The arguments the tool actually receives are unchanged — hardening never silently rewrites the executed command.
Shell-comment stripping preserves a
# inside quotes and a # attached to a word (foo#bar). A # counts as a comment only at the start of the string, after whitespace, or after a shell operator (;, |, &, (, ), {, }, <, >, `).Escalate Flow
When the reviewer is uncertain it returnsESCALATE, which becomes ApprovalDecision(approved=False, escalate=True) — a deferral to a human, not an approval.
When to Use ESCALATE
The reviewer should escalate rather than guess.- Escalate when the call is plausible but you cannot confirm it is safe.
- Do not treat
ESCALATEas a soft-approve — it never runs the tool on its own. - A human-in-the-loop backend routes escalated requests to a person; a plain consumer that only checks
approvedkeeps failing closed.
Backward Compatibility
Defaults are unchanged and fail-closed
Defaults are unchanged and fail-closed
The default behaviour is still deny-by-default. Nothing about the safe path changes.
escalate defaults to False
escalate defaults to False
ApprovalDecision.escalate defaults to False. Existing consumers that inspect only approved behave identically.Custom approver_agent is unaffected
Custom approver_agent is unaffected
Callers supplying their own
approver_agent are unaffected unless they opt into the new instructions and tri-state verdict.The invariant protects careless consumers
The invariant protects careless consumers
escalate=True always forces approved=False, so even ApprovalDecision(approved=True, escalate=True) can never execute an escalated request.Related
Approval Protocol
ApprovalRequest / ApprovalDecision fields and built-in backendsApproval Backends
CLI
--approval backend selection and reviewer-agent modeGateway Tool Policy
Explicit policy layer to pair with the LLM reviewer

