← Back to blog
A curved conveyor belt of small glass cubes glowing violet passes a tall clear glass pane, while one larger glass cube waits beside it inside a glowing violet ring on a dark floor.
AI Agents·November 29, 2026·11 min read

Human-in-the-Loop Approval Gates for AI Agents: Gate the Effect, Not the Tool

Approval prompts that fire on every tool call train people to click yes. Classify agent actions by reversibility and blast radius, show the literal effect, and pause durably so approvals can arrive late.

Most human-in-the-loop setups for AI agents fail the same way: they ask for approval so often that the human stops reading, and then the one prompt that mattered gets the same reflexive "yes" as the forty before it. The fix is not more prompts or fewer prompts, it is gating on the effect of an action (how reversible it is, how far it reaches, who else it touches) rather than on the name of the tool that performs it.

This post walks through how to design approval gates that a person will actually read: how to classify actions, what an approval prompt has to show, how to pause an agent durably while it waits, and the failure modes that quietly turn a safety control into a rubber stamp.

Why "approve every tool call" collapses

The naive design is a per-tool allowlist: read_file runs freely, write_file and run_shell ask first. It feels safe and it is easy to build. In practice it produces three problems.

Approval fatigue. A coding agent fixing one bug might run a shell command thirty times: ls, grep, the test suite, git diff. If every shell call asks, the human learns within minutes that the answer is always yes, and starts approving without reading. The security literature has a name for this from MFA push notifications ("MFA fatigue"), and the mechanism is identical: a control that fires constantly trains the person to ignore it.

Wrong granularity. A tool name says almost nothing about risk. run_shell("cat README.md") and run_shell("rm -rf ~/projects") are the same tool. So are http_request(GET, docs page) and http_request(POST, payments API). Gating by tool either over-asks (every shell call) or under-asks (shell is allowlisted, so the rm sails through).

Approving intent instead of effect. Many agent UIs show the model's own summary ("I'll clean up the build directory") rather than the literal action. The summary is generated by the same system you are trying to check. If the model is confused, or has been steered by injected content, its description of the action will be confused or steered too. The human ends up approving a story.

Classify by reversibility and blast radius

A better mental model sorts every concrete action, with its arguments, along two axes:

Crossing those gives a small set of tiers that map cleanly to policy.

TierExample actionsReversible?ReachesDefault policy
0: ObserveRead files, list directories, search, GET a docs pageNothing to undoAgent onlyAuto-run, log it
1: Local, reversibleEdit files under version control, run tests, write to a scratch dirYes, cheaplyUser's workspaceAuto-run in a sandbox, show a diff afterward
2: Local, hard to reverseDelete untracked files, rewrite git history, install packages globallyPartlyUser's machineAsk, show exact command and paths
3: External, reversibleOpen a draft PR, create a calendar hold, stage a config changeYes, with effortShared systemsAsk once per task scope
4: External, irreversibleSend a message, merge to main, deploy, pay, delete remote dataNoOther peopleAlways ask, every time, never batch

Two things make this work. First, the tier is computed from the call, not the tool: a shell command gets parsed (or at least pattern-matched) to decide whether it is tier 0 or tier 2, and an HTTP tool checks method and host. Second, tier 0 and 1 run without interruption, which is what buys the human enough attention to read the tier 4 prompts carefully. Fewer prompts is a safety feature, not a convenience.

Where the classification comes from

There are three sources, and you want all of them layered:

  1. Static declarations from the tool author. MCP formalizes this with tool annotations: readOnlyHint, destructiveHint, idempotentHint and openWorldHint in the MCP schema. A tool that declares readOnlyHint: true is a candidate for tier 0. The spec is explicit that these are hints and that clients should treat them as untrusted unless the server itself is trusted, which matters because a malicious server can label a destructive tool as read-only. The tool poisoning and rug-pull attacks against MCP servers exploit exactly that kind of misplaced trust.
  2. Argument-level rules owned by the host. Host-side rules that look at the actual arguments: paths outside the workspace, shell commands matching rm, curl ... | sh, git push --force, HTTP methods other than GET, recipient domains. Claude Code's permission rules are a public example of this shape: allow and deny patterns scoped to a tool plus an argument pattern, such as a specific shell command prefix.
  3. Environment. The same command is tier 1 inside a disposable container and tier 2 on a laptop. If the agent runs in a sandbox with no credentials and no network, most actions drop a tier, because the blast radius is the sandbox. Sandboxing and approval gates are complements: the sandbox shrinks what needs asking about.

When the sources disagree, take the most restrictive answer. A tool that says it is read-only but receives a DELETE method is not read-only.

What an approval prompt has to show

If tiers decide when to ask, the prompt design decides whether the human can answer meaningfully. A good approval prompt shows:

One concrete rule falls out of this: never approve a batch of tier 4 actions with one click. "Send these 40 personalized emails" deserves either one representative sample plus a hard cap, or 40 confirmations. A single yes on an opaque batch is the same as no gate at all.

Pausing durably: the approval is a checkpoint, not a modal

The engineering mistake that bites teams once agents leave the chat window is treating approval as a blocking UI dialog inside a running process. Real approvals arrive minutes or hours later, from a phone, after a deploy restarted the worker. If the agent's state lives only in process memory, the approval has nothing to resume.

The pattern that holds up is: persist the agent's state at the gate, release the worker, and resume from the checkpoint when a decision arrives.

Agent proposes tool + exact args Policy engine hints + arg rules + env Tier 0-1: run log + show diff after Tier 2-4: gate checkpoint state Human decision approve / edit / reject worker released Resume run from checkpoint Reject + reason fed back as tool result Approval records (who, when, exact args, scope) go to the audit log alongside the tool result.

LangGraph implements this directly: calling interrupt() inside a node saves the graph state through its checkpointer and stops the run, and you resume later by invoking the graph again with Command(resume=...) and the same thread ID, as described in its interrupts documentation. Durable-execution engines like Temporal get the same property from signals and persisted workflow history; the durable execution comparison covers how each one stores that state. Whichever you use, three details matter:

A minimal policy function

Here is the shape of the classifier, stripped down. The real value is that it is ordinary, testable code that the host owns, rather than a sentence in the system prompt asking the model to be careful.

type Tier = 0 | 1 | 2 | 3 | 4;

interface ProposedCall {
  tool: string;
  args: Record<string, unknown>;
  annotations?: { readOnlyHint?: boolean; destructiveHint?: boolean; openWorldHint?: boolean };
  serverTrusted: boolean;
  argsFromUntrustedContent: boolean;
  sandboxed: boolean;
}

const DANGEROUS_SHELL = [/\brm\s+-rf?\b/, /git\s+push\s+.*--force/, /curl[^|]*\|\s*(ba)?sh/, /\bsudo\b/];

export function classify(call: ProposedCall): Tier {
  let tier: Tier = 2; // unknown tools start in "ask"

  if (call.serverTrusted && call.annotations?.readOnlyHint) tier = 0;
  if (call.annotations?.destructiveHint) tier = Math.max(tier, 2) as Tier;
  if (call.annotations?.openWorldHint && !call.annotations?.readOnlyHint) tier = 4;

  if (call.tool === "run_shell") {
    const cmd = String(call.args.command ?? "");
    tier = DANGEROUS_SHELL.some((re) => re.test(cmd)) ? 2 : 1;
  }
  if (call.tool === "http_request") {
    tier = String(call.args.method ?? "GET").toUpperCase() === "GET" ? 0 : 4;
  }

  if (call.sandboxed && tier <= 2) tier = Math.max(0, tier - 1) as Tier;
  if (call.argsFromUntrustedContent && tier >= 2) tier = 4; // tainted args never auto-run

  return tier;
}

Note what is absent: the model's explanation of why it wants to run the call plays no part in the tier. It can be shown to the human, but it never lowers the gate.

Failure modes to design against

Gate laundering. An agent that cannot run rm directly writes a script that runs rm, then executes the script. Or it puts the destructive call inside a tool you allowlisted. Argument inspection has limits, which is why the environment layer (sandbox, scoped credentials) carries real weight. If the agent's token cannot delete the production bucket, no clever composition of tools can either.

Self-approval. Any path where the model can answer its own approval prompt, for example an approval delivered through a channel the agent can write to, or a "confirm" tool the agent can call, is not a gate. Approval must come from a channel the agent cannot reach. The MCP spec's elicitation feature is a useful pattern here because the request goes to the client UI and the answer comes from the user, not from the model.

Permission creep. "Always allow" choices accumulate. Six months in, the allowlist covers half the dangerous surface because each grant looked reasonable in the moment. Store standing permissions with their creation date and the task that created them, and review or expire them.

Unread logs. An audit trail nobody reads is a compliance artifact, not a control. At minimum, alert on tier 4 actions that ran without a recorded human approval; if that alert ever fires, something in your policy layer is broken.

Prompt volume drift. Track approvals requested per task and the approve rate. An approve rate near 100% with a median decision time of under two seconds is a strong signal that people are not reading. That is the cue to move routine actions down a tier (often by sandboxing them), not to add a warning banner.

Where this leaves autonomy

None of this argues against autonomous agents. It argues that autonomy should be earned per action class: read-only and sandboxed work runs freely from day one, reversible local work runs freely with diffs shown afterward, and irreversible, outward-facing actions keep a human in the loop until there is a track record and a rollback story. Background coding agents that deliver their work as a pull request are the cleanest version of this: everything happens freely in a sandbox, and the one irreversible step (merging) is a human decision with a full diff in front of it.

Takeaway

Count your prompts before you count your protections. If a human approves more than a handful of actions per task, you are training them to click yes. Classify each call by reversibility and blast radius using host-owned rules, not the model's say-so; let tiers 0 and 1 run freely inside a sandbox; show the literal effect and its provenance for everything else; persist state at the gate so approvals can arrive late; and never let a single click authorize a batch of irreversible actions.

#human-in-the-loop#ai-agents#agent-security#tool-calling#approval-workflows#mcp
ShareXLinkedInHacker News

Try it

Free, in your browser, no sign-up.

Using an agent? Add the Utilix tools to Claude Code over MCP (other editors):

claude mcp add utilix -- npx -y @utilix-tech/mcp

New posts by email

One email when a new post goes up. No other mail; unsubscribe in one click.

We store your email only to send new posts. See the privacy policy.

Related reading

MCP
MCP Elicitation: Form Mode, URL Mode, and the Phishing Attack Built Into Its Design
Security
The Trust Boundary Problem: Why Tool-Calling Agents Need to Treat Tool Output as Untrusted Input
AI Agents
Most Tool-Calling Failures Are Schema Failures, Not Model Failures