Harness: LLM-reviewed tool approvals (auto-approve low-risk calls, defer the rest to a human)

Author: mpfaffenbergerCreated Sep 29, 2026Updated Oct 1, 2026
Labelspydanty:featurep:3-midharness

Summary

A harness capability that sends each tool call needing approval to a reviewer model first. The reviewer grades the call's risk with a structured output. Calls below a configurable threshold are approved automatically. The rest go through the normal DeferredToolRequests / ApprovalRequired flow to a human. This is the "auto-review" approval mode that Codex and Claude Code ship for shell commands.

Prior art

converge-ai-labs/agent-foundation a13n_harness/capabilities/tool_review.py:

  • It uses a ToolRiskLevel ladder and a ToolReviewPolicy with a global risk_threshold and per-tool rules (selectors).
  • A replaceable ToolReviewer protocol has a default AgentToolReviewer that runs a small Pydantic AI agent with ToolOutput. It bounds usage and records the reviewer's usage separately.
  • The review input includes run evidence (recent context, cwd), and the reviewer never gets execution authority.

What we have today

  • Core: ApprovalRequired, DeferredToolRequests, HandleDeferredToolCalls (human or programmatic approval).
  • Harness: Shell policies (allowlists/patterns), ToolGuardrail (arbitrary callback), PromptInjectionDefender, TrajectoryJudge.

Nothing packages "a model grades this call and decides approve/escalate" with a policy surface. ToolGuardrail with a hand-written agent can approximate it.

Sketch

ToolReview(model=..., threshold='high', tools=[...], rules={...}), sitting in front of HandleDeferredToolCalls. It would emit a span per review (risk, decision, reviewer usage), keep content behind include_content, and integrate with CLAI2's approval UI as an "auto" mode.