# When should an agent stop and ask a human? Placing approval gates

URL: https://infro.io/blog/when-should-an-agent-stop-and-ask-a-human-placing-approval-gates
Author: INFRO Editorial (https://infro.io/blog/editorial)
Publisher: INFRO
Published: 2026-11-22
Last modified: 2026-11-22
Last reviewed: 2026-11-22 (next review due 2027-05-21)
Topic: Agents and multimodal systems
Format: Guide

> Gate at the execution boundary, not in the prompt: stop for a person when a call is irreversible, external, costly or beyond the requester's authority, or when a policy is unsure. Persist the pending call, release the connection, and on approval re-check the exact arguments before running it once.

Key takeaways:
- Put the gate where the tool call is executed, so no model output, prompt or injected instruction can skip it.
- Decide per tool and per argument, not per agent: reads run, reversible writes run within limits, irreversible, external or money-moving calls ask, and unknown tools are denied.
- A classifier or confidence band may only escalate a static rule toward asking, never relax it.
- Suspend by persisting a pending-call record and returning control; on approval, check the arguments hash, expiry, approver and current policy before executing once with an idempotency key.
- A timeout or an unreachable approver must resolve to deny, and approval volume needs measuring so gates do not become rubber stamps.

## Stop when the action is hard to take back

An agent should stop and ask a person when the next tool call has one of four properties: it is hard to undo, it leaves your systems, it moves money, or it needs more authority than the person the agent acts for holds. Everything else should run without a prompt. If every call asks, people approve without reading, and the gate protects nothing.

This is the "excessive autonomy" root cause in OWASP's LLM06: an application that fails to independently verify and approve high-impact actions, such as an extension that deletes a user's documents without confirmation.[1] OWASP's mitigation is to require a human to approve high-impact actions before they are taken, in the downstream system or inside the extension that implements the operation.[1] The MCP specification says the same from the protocol side: hosts must obtain explicit user consent before invoking any tool, and there should always be a human in the loop with the ability to deny tool invocations.[2][3]

This article covers where the gate goes, how to suspend and resume a run, and how to decide which calls need a person. Limits on steps, time and spend are in [bounding agent loops](https://infro.io/blog/bound-ai-agent-loops), and token handling is in [MCP authorization](https://infro.io/blog/mcp-authorization-what-a-gateway-must-do-with-oauth-tokens).

## Classify tools by what a wrong call costs

Gate per tool and per argument, not per agent. A single agent usually holds tools from every class below, so an agent-wide "supervised" flag is too blunt.

| Class | Example | Default |
| --- | --- | --- |
| Read, scoped to the requester | Search tickets, read a document | Run |
| Reversible write, bounded | Add a label, create a draft | Run, rate-limited |
| Irreversible write | Delete rows, close an account | Ask |
| External message | Send email, post to a channel | Ask |
| Money movement | Refund, purchase, change a plan | Ask above a limit, deny above a ceiling |
| Privilege change | Grant access, rotate a credential | Ask, with a second approver |
| Unknown or unregistered tool | Anything not in the list | Deny |

Three notes on the table.

- **Arguments matter as much as the name.** `refund` for a small amount may run; the same tool for a large one asks. `send_email` to a verified internal address differs from the same call to an external domain.
- **Drafts are a cheap gate.** OWASP's mail example removes the problem by having the user review and press send on each drafted mail.[1] Give the agent `create_draft` and keep `send` behind approval.
- **Reduce the surface first.** OWASP lists minimizing extensions, functionality and permissions ahead of approval.[1] A read-only database identity cannot be talked into a write, so no gate is needed for it.

> **Note: Tool descriptions are not a policy source**
> MCP tells clients to treat tool annotations as untrusted unless they come from a trusted server.[3] A tool that labels itself read-only is a hint. Put the class in your own registry, keyed by tool name, and review it when the tool's definition changes.

## Put the gate at the execution boundary

The gate belongs between "the model emitted a tool call" and "the tool ran." It must not be a sentence in the system prompt, and it must not be a step the model can choose to skip. OWASP calls this complete mediation: validate every request to downstream systems against policy, instead of relying on the model to judge whether an action is allowed.[1]

```python
def run_step(run, call):
    verdict = gate(run, call)            # "allow" | "ask" | "deny"

    if verdict == "deny":
        return tool_error(call, "blocked by policy")

    if verdict == "ask":
        pending = store.create_pending(
            run_id=run.id,
            tool=call.name,
            arguments=call.arguments,
            args_hash=sha256(canonical_json(call.arguments)),
            requested_by=run.principal,
            expires_at=now() + timedelta(hours=4),
        )
        run.status = "awaiting_approval"
        store.checkpoint(run)            # transcript, tool results so far, step count
        notify_approvers(pending)
        raise Suspend(pending.id)        # return control; hold no connection open

    return execute(call, idempotency_key=f"{run.id}:{call.id}")
```

Two placement rules follow.

1. **Gate every path to the tool.** If the same `send_email` is reachable from the agent loop, a scheduled job and an MCP server, the check has to live in the shared executor or in the tool itself. A gate in only one caller leaves the others open.
2. **Gate after the model, before the effect.** Run the gate on the final, validated arguments, not on the model's stated intent. What the model says it will do and what the arguments do can differ.

### Order the checks so a classifier can only escalate

Evaluate in a fixed order and let each later stage tighten the result, never loosen it.

1. **Static rules, no model.** The tool class table, allowlists of recipients or accounts, amount ceilings. These are deterministic and cheap.
2. **Argument rules in code.** Amount over a limit, recipient outside your domain, bulk size over N.
3. **A judgment call for the gray zone.** A classifier or decision model reads the request and the call and returns allow, ask or deny with a confidence.
4. **Default.** Anything unclassified asks, or is denied if it is a write.

The rule that keeps this safe: a stage may move `allow` to `ask`, never `ask` to `allow`. A model that is wrong 2% of the time should not be able to wave through a call your static rules flagged.

## Set the thresholds in policy, not in code

INFRO's Decisions feature lists tool-call gating as a use case: ask before an agent runs a tool, with the outcomes allow, ask a person or deny, and pins for tools that never need a model.[4] The same page describes a confidence gate: act above 0.9, confirm from 0.5, hand to a person below, with thresholds kept in policy rather than in code.[4]

The call is `POST /v1/decisions/{slug}` with the tool name and arguments as `state`. The response carries an `outcome`, a `band` of `act`, `confirm` or `human`, a `confidence`, and a `source` of `model`, `pin` or `fallback`.[5] A pin is decided by rule before any model call; a fallback answers when the deadline passes or the provider fails.[5] Mapping that to the gate:

```python
def gate(run, call):
    cls = REGISTRY.get(call.name)
    if cls is None:
        return "deny"                                  # unknown tool
    if cls.hard_rule(call.arguments) == "ask":
        return "ask"                                   # static rule wins
    if cls.kind == "read":
        return "allow"

    d = requests.post(
        "https://api.infro.io/v1/decisions/tool-gate",
        headers={"Authorization": f"Bearer {KEY}"},
        json={"state": {"request": run.user_request,
                        "tool": {"name": call.name, "arguments": call.arguments}}},
        timeout=5,
    ).json()

    if d["source"] == "fallback":
        return "ask"                                   # fail toward a person
    if d["outcome"] == "deny" and d["band"] == "act":
        return "deny"
    if d["outcome"] == "allow" and d["band"] == "act":
        return "allow"
    return "ask"                                       # confirm or human band
```

> **Example: Illustrative thresholds**
> These numbers are made up to show the shape, not recommendations. A support agent may run `refund` alone up to 25 units of currency, ask from 25 to 500, and deny above 500. `send_email` asks whenever the recipient is outside your domain. `delete_*` always asks, with no model consulted. Tune the figures from your own approval data.

If the decision call is slow or down, the gate must not hang the run and must not default to allow. The `fallback` branch above turns an outage into a request for a person, which is slower but safe.

## Pause and resume without losing state

A suspended run must survive a process restart, a deploy, and a human who answers tomorrow. That rules out holding a request open or keeping the transcript in memory.

The MCP Tasks extension is a useful model. A server returns a durable task handle instead of blocking, because many clients and intermediaries impose timeouts that make waiting impractical beyond a few seconds; the task ID survives a disconnect.[6] When a task needs input, such as a user confirmation, its status moves to `input_required` and the client answers through `tasks/update`.[6] The overview names approval gates as a fit, and tells clients to persist task IDs durably so polling can resume after a crash.[6] Even if you do not use MCP Tasks, copy the shape: a durable ID, a status, and an explicit input step.

### What to persist

Write one record per pending call, in the same transaction as the run checkpoint.

| Field | Why |
| --- | --- |
| `pending_id`, `run_id`, `call_id` | Idempotency key and audit join |
| `tool`, `arguments`, `args_hash` | The exact thing approved |
| `requested_by` | The principal; the approver must differ for risky classes |
| `policy_version`, `reason` | Why it asked; what the approver is told |
| `expires_at` | A stale approval is not an approval |
| `status` | `open`, `approved`, `rejected`, `expired`, `executed` |
| Checkpoint pointer | Transcript, earlier tool results, step and spend counters |

The checkpoint holds the messages so far, including the tool call awaiting approval and results already returned. On resume you rebuild the next model request from it. Because you own the history, the next model call can go to any route target your policy allows; see [failover mid-agent-run](https://infro.io/blog/failover-mid-agent-run-what-happens-to-tool-calls-and-state) for what to check when it does.

### Protect the state that travels through a client

If part of the state passes through a client, treat it as attacker-controlled. MCP's multi round-trip pattern has a server return an opaque `requestState` that the client echoes on retry, and says servers must treat it as attacker-controlled input and protect its integrity, for example with an HMAC or AEAD, rejecting state that fails verification.[7] It recommends including the authenticated principal, a short expiry and an identifier of the originating request, with a digest of its parameters, inside the protected payload.[7] It also notes these measures bound replay but do not guarantee single use; a server that needs at-most-once must enforce it itself.[7] An approval is exactly that case.

### The resume path

```python
def resume(pending_id, decision, approver):
    p = store.lock(pending_id)                       # row lock, one resolver at a time

    if p.status != "open":              return refuse("already resolved")
    if p.expires_at < now():            return expire(p)
    if approver.id == p.requested_by and REGISTRY[p.tool].needs_second_person:
        return refuse("approver must differ from requester")

    if decision == "reject":
        store.mark(p, "rejected", approver)
        return continue_run(p.run_id, tool_error(p, "rejected by a person"))

    if sha256(canonical_json(p.arguments)) != p.args_hash:
        return refuse("arguments changed")
    if gate_static(p.tool, p.arguments) == "deny":   # policy may have tightened
        return refuse("no longer permitted")

    result = execute(p, idempotency_key=p.id)        # at most once
    store.mark(p, "executed", approver)
    return continue_run(p.run_id, result)
```

Each check closes a specific failure.

- **Double approval.** Two people click approve; the row lock and the status check make the second a no-op.
- **Edited arguments.** The approver sees one thing and the executor runs another. The hash ties approval to the exact payload. If the approver may edit, store the edit as a new pending record and re-run the gate on it.
- **Stale approval.** A call approved at 09:00 that resumes at 17:00 may no longer be true. Expire it, and re-run static checks, budgets and tool-definition checks at execution time.
- **Crash between execute and mark.** The idempotency key lets a retry detect that the effect already happened. Without it, a retry sends the email twice.
- **Rejection.** Return a tool error to the model so it can replan or stop. Do not silently drop the call, or the model will keep issuing it.

On timeout the default is deny. An unanswered request must not become permission.

## Show the approver what they need

An approval is only as good as what the person sees. Show:

- the tool and the exact arguments, rendered readably, with the diff for updates;
- the effect: rows touched, recipients, amount, and the estimated cost if the call spends on a metered service;
- who or what triggered the run and the user request that led to it;
- the reason it asked: which rule or which confidence band;
- approve, reject and, where sensible, edit.

If the approval runs through MCP elicitation, the spec has constraints you can reuse in your own UI: clients must make clear which server is requesting information and offer clear decline and cancel options, and servers must not use form mode to collect passwords, API keys, access tokens or payment credentials; URL mode is for those.[8] A confirmation is a yes or no, not a place to type a card number.

Prompt injection raises the stakes of this screen. OWASP names indirect prompt injection from content the agent read, such as a crafted incoming email, as a trigger of excessive agency.[1] If the request text on the approval screen came from untrusted content, label it as such, so the approver judges the action instead of the story around it.

## Keep gates from turning into rubber stamps

Gates fail through volume. Track these per tool, from your own data:

- **Approval rate.** Near 100% over many requests means the gate is noise, or the call should be pre-approved within limits.
- **Time to decision.** Long waits stall runs; set escalation and expiry.
- **Edit and reject rate.** The signal that the gate catches real problems.
- **Asks per run.** If one run produces ten prompts, batch them.

Two techniques reduce load without removing control. Scope an approval to a run and a boundary: "this run may send up to 20 emails to this list," which the executor enforces as a limit, not a promise. And move low-risk, reversible, well-bounded calls out of the gate once the data supports it. OWASP also notes that rate limiting does not prevent excessive agency but reduces the number of undesirable actions in a window, giving monitoring time to catch them.[1]

## Using a gateway for the gray zone and the tool boundary

INFRO's Decisions endpoint can serve the gray-zone stage above, with thresholds and pins kept in a saved policy and each call on your own decision-model connection.[5] Its MCP gateway sits between agents and your own MCP servers: it serves only the tools an admin approved and granted to the key, refuses a tool whose definition changed since approval, validates arguments, applies guardrails to arguments and results, and records the call on the same trace as the agent's model calls.[9] INFRO executes no tool, so the pending-call store, the approver UI and the resume logic remain in your application. Per-run listings of requests, errors and estimated cost are in Runs, and budgets can refuse a model request before it reaches the provider.

## Checklist before enabling write tools

- [ ] Every tool is in a registry with a class, and unknown tools are denied.
- [ ] Read tools use a read-only identity; writes run in the requesting user's context where possible.
- [ ] Irreversible, external and money-moving calls ask; limits are set per argument.
- [ ] The gate runs in the shared executor, on final arguments, for every caller.
- [ ] A classifier or confidence band can only escalate a static rule.
- [ ] Pending calls are stored with arguments, hash, principal, expiry and a checkpoint.
- [ ] Resume re-checks status, expiry, hash, approver and current policy, and executes once with an idempotency key.
- [ ] Timeout and decision-service failure resolve to ask or deny, never allow.
- [ ] Approval rate, time to decision and rejects are tracked per tool.
- [ ] A kill switch can stop a misbehaving agent while approvals are still open.

## Questions

### Should the model itself decide when to ask for approval?

Let it ask, but never rely on it. A model can request clarification when it is unsure, which is useful, but the mandatory gate has to sit in code at the execution boundary. OWASP's guidance is to enforce authorization in downstream systems instead of relying on an LLM to decide whether an action is allowed.[1]

### What happens to a pending approval if the model provider fails over while the run is suspended?

Nothing, if the pending call is stored as data: tool name, exact arguments, run id and hash. The approval is about the call, not about the model that proposed it. When the run resumes, the next model request can go to any target your routes allow; check that the fallback model accepts the stored transcript and tool schema.

### Can a human approval be replayed or reused for a different call?

It must not be. Bind each approval to one pending record, the hash of its arguments, the approver and an expiry, and consume it once. MCP's guidance for request state is the same shape: integrity-protected, tied to the authenticated principal, short-lived and matched to the originating request.[7]

## Sources

1. LLM06:2025 Excessive Agency — OWASP Gen AI Security Project. https://genai.owasp.org/llmrisk/llm062025-excessive-agency/ (accessed 2026-11-22)
2. Model Context Protocol specification (2026-07-28) — Model Context Protocol. https://modelcontextprotocol.io/specification (accessed 2026-11-22)
3. Tools - Model Context Protocol specification — Model Context Protocol. https://modelcontextprotocol.io/specification/2026-07-28/server/tools (accessed 2026-11-22)
4. Decisions with Jev — INFRO Docs. https://infro.io/docs/features/decisions (accessed 2026-11-22)
5. Decisions API — INFRO Docs. https://infro.io/docs/api/decisions (accessed 2026-11-22)
6. Tasks extension overview — Model Context Protocol. https://modelcontextprotocol.io/extensions/tasks/overview (accessed 2026-11-22)
7. Multi Round-Trip Requests — Model Context Protocol. https://modelcontextprotocol.io/specification/2026-07-28/basic/patterns/mrtr (accessed 2026-11-22)
8. Elicitation - Model Context Protocol specification — Model Context Protocol. https://modelcontextprotocol.io/specification/2026-07-28/client/elicitation (accessed 2026-11-22)
9. MCP gateway — INFRO Docs. https://infro.io/docs/mcp-gateway (accessed 2026-11-22)
