Skip to content

Agents and multimodal systemsGuide

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

An agent should stop for a human when a tool call is hard to undo, leaves your systems, spends money or exceeds the authority of the person it acts for. This guide places the gate at the execution boundary, shows how to suspend and resume a run without losing state, and sets which calls need a person.

By INFRO Editorial

Published

11 min read

A glowing autonomous agent core coordinating tools, memory, and multiple AI model routes

In short

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.23

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, and token handling is in MCP authorization.

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.

ClassExampleDefault
Read, scoped to the requesterSearch tickets, read a documentRun
Reversible write, boundedAdd a label, create a draftRun, rate-limited
Irreversible writeDelete rows, close an accountAsk
External messageSend email, post to a channelAsk
Money movementRefund, purchase, change a planAsk above a limit, deny above a ceiling
Privilege changeGrant access, rotate a credentialAsk, with a second approver
Unknown or unregistered toolAnything not in the listDeny

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.

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

loop.py
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:

gate.py
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

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.

FieldWhy
pending_id, run_id, call_idIdempotency key and audit join
tool, arguments, args_hashThe exact thing approved
requested_byThe principal; the approver must differ for risky classes
policy_version, reasonWhy it asked; what the approver is told
expires_atA stale approval is not an approval
statusopen, approved, rejected, expired, executed
Checkpoint pointerTranscript, 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 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

resume.py
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 readers ask

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

From the team that builds it

Where this shows up in INFRO

INFRO is a control plane in front of the provider accounts you already hold. The capabilities below are the parts of it this article touches, each with the documentation that defines its behaviour.

  • Decisions with Jev

    Available with a plan

    Saved questions your code calls as POST /v1/decisions/{slug}, answered by Jev on your own TypeSafe connection or by any other decision model you connect: an outcome, a confidence band from your thresholds, pins decided before any model call, a deadline with a fallback, and batches of up to 500 items. Tool-call gating, triage, evals, labeling and control loops are templates of it.

    Read the documentation for Decisions with Jev
  • MCP gateway for your agents' tools

    Available with a plan

    Register your own MCP servers once with their credentials, approve and pin each tool's definition, grant gateway keys access, and let agents call those tools through INFRO with guardrails, a call log on the same trace as their model calls, and kill switches checked on every call. INFRO executes no tool.

    Read the documentation for MCP gateway for your agents' tools
  • Runs

    Available with a plan

    Requests that share a trace id listed as one run each: requests, errors, duration, models, estimated provider cost, scores and prompt versions, filtered and sorted over a window of up to 31 days. In the API, the console, the management API and MCP, on every plan.

  • Budgets and spend ceilings

    Available with a plan

    A hard cap per organization, project, member, and key, with alerts at your own thresholds.

    Read the documentation for Budgets and spend ceilings
  • Guardrails

    Available with a plan

    Pattern-based checks on chat completion prompts and responses: block, redact or flag email addresses, phone numbers, card numbers, IBANs, US Social Security numbers, IP addresses, API keys and your own terms, plus optional classifier checks on your own connection to a decision model's provider. Detection can miss things. Included on every plan.

    Read the documentation for Guardrails

INFRO accounts are self-serve. Provider usage is billed to you by your providers; INFRO charges a software subscription and takes 0% of model spend. See plans.

Sources

Numbered in order of first citation. Each was opened and checked against the claim on the date shown.

  1. 1.LLM06:2025 Excessive Agency (opens in a new tab) — OWASP Gen AI Security Project. Accessed Nov 22, 2026.
  2. 2.Model Context Protocol specification (2026-07-28) (opens in a new tab) — Model Context Protocol. Accessed Nov 22, 2026.
  3. 3.Tools - Model Context Protocol specification (opens in a new tab) — Model Context Protocol. Accessed Nov 22, 2026.
  4. 4.Decisions with Jev (opens in a new tab) — INFRO Docs. Accessed Nov 22, 2026.
  5. 5.Decisions API (opens in a new tab) — INFRO Docs. Accessed Nov 22, 2026.
  6. 6.Tasks extension overview (opens in a new tab) — Model Context Protocol. Accessed Nov 22, 2026.
  7. 7.Multi Round-Trip Requests (opens in a new tab) — Model Context Protocol. Accessed Nov 22, 2026.
  8. 8.Elicitation - Model Context Protocol specification (opens in a new tab) — Model Context Protocol. Accessed Nov 22, 2026.
  9. 9.MCP gateway (opens in a new tab) — INFRO Docs. Accessed Nov 22, 2026.

About this article

Read on 2026-11-22: the MCP specification overview, tools, elicitation and multi round-trip pages, the MCP Tasks extension overview, OWASP LLM06:2025 Excessive Agency, and INFRO's docs on decisions and the MCP gateway. Thresholds, record fields and code are illustrative designs, not vendor figures; anything the pages did not state about approval UIs in INFRO is left out.

Last checked against its sources on . The next review is due by . No separate named reviewer is recorded for this article.

How articles are written, sourced and corrected is set out in the editorial standards.