Human approval for agent tool calls: a runtime lifecycle

Build per-action approval around exact tool arguments, identities, revisions, expiry, revocation, and duplicate delivery—not a model asking permission.

Updated

AIAgentsSecurity

Sources are linked in the guide. Read our editorial policy.

On this page 6 sections

Human approval for agent tool calls belongs at the executor boundary. The model can propose an action and explain it. Deterministic application code must decide whether that exact action may run, under whose authority, and whether the decision is still valid.

A recent Reddit question about approval is a useful starting point. Its indexed RSS excerpt highlights the gap between approving a summary and executing unseen arguments. Direct retrieval was rate-limited; this guide does not treat the unavailable comments as verified evidence or a community consensus.

The practical deliverable below is a proposed application contract, not an SDK feature list. It covers the lifecycle of one action after an integration is connected. For the earlier admission decision, use the MCP security checklist.

Separate a question from an enforcement gate

“Ask before sending email” is a model instruction. It does not prevent a tool implementation from sending without an approval record. Likewise, the model saying “the user approved” is not an authenticated decision.

In the OpenAI Agents SDK human-in-the-loop flow, a tool can declare needs_approval; pending calls surface as interruptions, and RunState supports approve, reject, serialization, and resume. The documented per-call decision is scoped to the call ID. That pause is useful infrastructure, but your application still owns reviewer authentication, authorization, trusted storage, and replay protection.

LangGraph interrupts offer another pause/resume mechanism using a checkpointer and thread ID. Resuming restarts the interrupted node from its beginning. Code before the interrupt runs again, so placing a side effect there is not made safe by the later approval.

Freeze the action the reviewer sees

Create a server-owned pending record before requesting a decision. Bind it to:

  • The run, logical action ID, tenant, and requesting user.
  • The exact tool implementation version or deployment digest, not just its name.
  • Validated arguments, including defaults resolved before review.
  • The executor identity and permitted resource scope, without storing credentials.
  • The target resource and expected revision.
  • The approval policy version, reviewer decision, and expiry.
  • A stable downstream idempotency key for this logical action.

Render these details understandably: recipient, amount, destination, attachment, or diff as applicable. A digest can detect a mismatch; it cannot substitute for showing the actual effect. Escape untrusted display text and redact secrets without hiding consequential fields.

This illustrative application record is not an OpenAI or LangGraph API schema. The identifiers, amount, and timestamps are fictional:

{
  "action_id": "refund-482-attempt-1",
  "run_id": "support-91",
  "tenant_id": "shop-a",
  "requester_id": "user-17",
  "tool": "refund_order",
  "tool_version": "refund-service-7",
  "executor_id": "refund-worker-shop-a",
  "arguments": {
    "order_id": "482",
    "amount_minor": 2500,
    "currency": "USD"
  },
  "resource_revision": "order-482-rev-12",
  "policy_version": "refund-policy-3",
  "expires_at": "2026-11-08T15:10:00Z",
  "decision": "approved",
  "reviewer_id": "manager-6",
  "decided_at": "2026-11-08T15:02:00Z",
  "idempotency_key": "shop-a-refund-482-attempt-1",
  "state": "approved"
}

Define a canonical representation for comparing the frozen fields. If you use a fingerprint, retain the corresponding authoritative record. A matching hash does not authenticate whoever submitted it. Keep runtime snapshots server-side; the browser should submit an opaque decision ID and decision, not replacement arguments or serialized execution state.

Use an explicit transition table

The following is a recommended state machine. Every transition is enforced by application storage and executor code, not generated prose.

Current state and event Next state Required behavior
Proposed call passes validation Pending Freeze the action; execute nothing
Pending, authorized reviewer approves Approved Record authenticated identity and decision atomically
Pending, reviewer denies Denied Return a denial result; do not execute
Pending or approved, expiry passes Expired Require a fresh review
Pending or approved, approval is revoked Revoked Block execution if it has not been claimed
Pending or approved, args, version, identity, scope, policy, or revision changes Superseded Create a new pending action; never carry approval forward
Approved, executor claims action Executing Atomically claim once; recheck expiry, authority, and frozen fields
Executing, destination confirms outcome Succeeded or failed Persist authoritative result and receipt
Executing, outcome cannot be established Unknown Reconcile before any replay
Terminal state, duplicate decision arrives Unchanged Return stored status; do not resume again

Recheck the reviewer’s authority and execution policy at claim time. For mutable resources, use a destination-side revision precondition or transaction where available. A separate “read revision, then write” still leaves a race. If the destination cannot enforce that condition, redesign the action or acknowledge that exact-revision approval cannot be guaranteed.

Revocation after execution starts cannot promise cancellation. Record when the claim occurred, attempt cancellation only if supported, and report the actual outcome. Reversing a completed refund is a different action, not a state reset.

Approval is not exactly-once execution

Two workers can receive the same queue message. An approval webhook can be delivered twice. A worker can complete the refund and crash before saving its result.

Use an atomic, owner-checked claim to prevent concurrent resumes. Separately, pass the stable idempotency key to a destination that atomically prevents duplicate effects. Preserve the same parameters across retries and respect that destination’s retention rules. Neither a local flag nor an approval ID makes the external effect and your database update one transaction.

Without valid downstream idempotency, an unknown result needs authoritative reconciliation. An empty lookup may reflect lag or an in-flight request, not proof that nothing happened. Do not automatically replay an uncertain payment, message, or deletion.

Exercise the refusal paths before rollout

Your acceptance cases should include denial, expired approval, changed recipient, redeployed tool, revoked reviewer authority, changed resource revision, concurrent workers, duplicate approval delivery, and a crash after the external effect. Each needs an expected state and external outcome.

Avoid “approve always” as a shortcut for per-action review: the OpenAI documentation distinguishes sticky tool decisions from per-call decisions. When several agents share data, pair this lifecycle with a shared-state revision contract. The invariant is simple: approval authorizes one frozen action, not whatever the agent decides to do next.

If you are wiring these ideas into n8n, use the n8n AI agent human-approval setup and verification checklist. It separates the platform’s documented review behavior from the authorization and failure cases you still need to check in your own workflow.

Sources and discussion

Connected by shared topics