Add Human Approval Step
Scaffold a human-in-the-loop approval gate into an agent so it pauses before a consequential action and resumes after approval.
/add-human-approval<the action/tool to gate, or the agent file>Install to ~/.claude/commands/add-human-approval.md
Wraps a consequential agent action in an approval gate: the agent pauses with the proposed action and context, a human approves/edits/rejects, and it resumes from a durable checkpoint. Scaffolds the interrupt, the three outcome paths, fail-safe defaults, and an audit log.
Scope
Treat $ARGUMENTS as the action to gate (e.g. "the refund tool", "the deploy step") or the agent file to modify. Restate what you're gating in one sentence, and confirm it is genuinely consequential — gating cheap, reversible actions adds friction without value.
Goal: insert a human approval checkpoint so the agent cannot perform the action until a human approves, enforced at the execution layer (not merely requested in the prompt).
NOTE
Enforce the gate where the tool runs, not in the system prompt. A prompt instruction to "ask first" is a suggestion the model can skip; a code-level interrupt is a guarantee.
Step 1 — Locate the action and the runtime
Find where the consequential action executes (the tool/function call) and identify the agent framework. If it provides interrupt/resume primitives (e.g. LangGraph), use them; otherwise scaffold an explicit pause-persist-resume around the call.
Step 2 — Interrupt before the action
Before the action runs, surface the proposed action + arguments + context (what, with what inputs, and why) and pause. Persist agent state at this point so approval can arrive later and survive a restart.
Step 3 — Handle approve / edit / reject
- Approve → resume from the checkpoint and execute.
- Edit → resume with the human-modified arguments.
- Reject → abort with no partial side effects; record the reason.
Step 4 — Fail safe and audit
Default to not acting on timeout or ambiguity. Log every gated decision (action, context, approver, outcome) for accountability.
Step 5 — Verify
Show the diff and walk through the three paths. Confirm the action is unreachable without passing the gate, and that a rejected/aborted run leaves no partial effects.
WARNING
Don't gate everything — blanket approval prompts train humans to rubber-stamp. Gate by real blast radius (money, data loss, outbound comms, deploys). Pairs with the human-in-the-loop-gate skill for the design rationale.
Related
- Human In The Loop GateAdd a human approval checkpoint to an agent so it pauses before a risky or irreversible action (spending money, deleting data, sending messages, merging code) and resumes only after a human approves. Use when an agent acts autonomously on consequential operations.
- Agent Reliability ReviewerUse this agent to make an AI agent production-ready — reviewing its loops, cost controls, error handling, tool use, human-in-the-loop gates, checkpointing, and observability, then reporting concrete failure modes and fixes. Examples — "is our agent safe to ship?", "our agent loops forever / burns tokens, harden it", "add guardrails and recovery before we put this agent in front of users".
- Production Tool & Function Calling: Feed Errors Back as ObservationsHow agents use tools — the call/observe/retry loop, why errors must return to the model, and the schemas, idempotency, and limits that keep it reliable.