Skip to main content
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 returns ESCALATE, which becomes ApprovalDecision(approved=False, escalate=True) — a deferral to a human, not an approval.
Consume the flag in a custom gate:

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 ESCALATE as 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 approved keeps failing closed.

Backward Compatibility

The default behaviour is still deny-by-default. Nothing about the safe path changes.
ApprovalDecision.escalate defaults to False. Existing consumers that inspect only approved behave identically.
Callers supplying their own approver_agent are unaffected unless they opt into the new instructions and tri-state verdict.
escalate=True always forces approved=False, so even ApprovalDecision(approved=True, escalate=True) can never execute an escalated request.

Approval Protocol

ApprovalRequest / ApprovalDecision fields and built-in backends

Approval Backends

CLI --approval backend selection and reviewer-agent mode

Gateway Tool Policy

Explicit policy layer to pair with the LLM reviewer