Filed underL07 · Design
Published
Reading time33 min
Updated
Field notes · L07 Design

Designing approval screens for AI agentsHuman-in-the-loop UX that people actually read

Human-in-the-loop approval UI for AI agents: risk tiers, what an approval card must show, undo windows, batching, timeouts, mobile and accessibility.

The short answer

An approval prompt only protects you if it is rare enough to be read and specific enough to be judged. Sort every agent action into four tiers (auto, notify, approve, forbid) by reversibility, blast radius and whether untrusted content influenced it, so that humans only see the handful of actions that genuinely need them. When you do ask, show the exact arguments or diff, the blast radius in numbers, whether and how it can be undone, the cost, and where the request came from, never a model-written summary. Bind the approval to a hash of those exact arguments, expire it, and log it.

Most agent products get this backwards. They ask about everything, users learn to press Enter, and the one prompt that mattered gets the same half-second glance as the forty before it. This post covers why that happens, what the research on warning habituation says, the patterns that hold up, working HTML, CSS and TypeScript for an accessible approval card, and two assets you can take into a design review: a risk-tier matrix and an approval-card spec template.

01Why "click to allow" turns into security theatre

Anthropic published the number most agent teams already suspected. In its write-up of Claude Code's auto mode (March 2026), it reports that "Claude Code users approve 93% of permission prompts", and that "over time that leads to approval fatigue, where people stop paying close attention to what they're approving." A prompt that is accepted 93 times out of 100 is mostly training the user to accept it.

None of this is new. Security researchers spent years measuring the same effect on browser and OS warnings:

  • One-click warnings get clicked through. In a field study of over 25 million warning impressions, Akhawe and Felt (USENIX Security 2013) found users clicked through Chrome's SSL warning 70.2% of the time, against about a third for Firefox's, which took more clicks and looked sterner. Same threat, different design, very different behaviour.
  • Install-time permission lists are not read. Felt et al. (SOUPS 2012) found that 17% of Android users paid attention to permissions at install time, and only 3% of survey respondents answered all three comprehension questions correctly.
  • The brain habituates, measurably. Anderson, Vance, Kirwan, Jenkins and Eargle (JMIS 2016) used fMRI to show attention to repeated warnings dropping in the brain itself. A follow-up, Vance et al. (MIS Quarterly 2018), found attention declines over days, recovers only partially between workdays, and that warnings whose appearance changes ("polymorphic" warnings) held adherence high after three weeks while standard ones decayed.
  • Forcing interaction with the critical field works. Bravo-Lillo et al. (SOUPS 2014) found that without countermeasures, habituation caused a three-fold drop in people noticing a change in a dialog, and that designs forcing the user to interact with the specific field that matters resisted it.
  • Interruption beats ambient indicators. Egelman, Cranor and Hong (CHI 2008) found 79% of participants heeded active phishing warnings, while only one participant heeded the passive warning they tested.

Then there's automation bias. Parasuraman and Manzey's review concluded that it affects novices and experts alike and "cannot be prevented by training or instructions". The EU AI Act names it directly: for high-risk systems, Article 14(4)(b) requires that overseers can "remain aware of the possible tendency of automatically relying or over-relying on the output... (automation bias)". If your agent proposes and a human disposes, assume the human will drift towards agreeing.

The conclusion is a design constraint, not a moral: human attention is a budget, and every prompt spends it. A prompt that never changes the outcome is not free. It makes the next prompt less likely to be read.

A quick calculation of what "review everything" costs

Illustrative numbers, not a measurement. Say an engineer working with a coding agent sees 60 approval prompts in a day. Reading each one properly (the command, the paths, the flags) takes perhaps 20 seconds. That's 60 × 20 = 1,200 seconds, or 20 minutes of pure review a day, per person. Nobody does that. What actually happens is 60 × 1 second, which is a minute of pressing Enter and no review at all. The fix is not exhortation. It's getting the 60 down to 3.

02What a human-in-the-loop approval is actually for

Before designing the screen, decide which job it's doing. There are three, and they need different UIs:

  1. Catching wrong intent. The agent misunderstood the task: it wants to email the whole customer list, not the five people you meant. The human needs to see scope and recipients.
  2. Catching a hijack. Something the agent read (a web page, a ticket, a README) told it to do something else. The human needs to see provenance: what untrusted content was in context when this action was proposed. Our post on securing AI agents against prompt injection covers why taint tracking, not filtering, is the defence.
  3. Assigning accountability. Someone with authority signs off: a refund over a limit, a production change. The human needs the exact thing being signed, and the system needs an audit record.

An approval is not a sandbox. If a mistaken approval can wipe a disk or leak a credential, the bug is the permission model, not the button. Put the hard limits in scoped credentials, network egress controls and a sandbox around code execution, and use approvals for the judgement calls that remain.

03The risk-tier matrix: auto, notify, approve, forbid

This is the first half of the original asset. Classify every tool, and every argument pattern within a tool, into one of four tiers. Score four factors, then take the highest tier any factor demands.

Factor Tier 0: Auto Tier 1: Notify Tier 2: Approve Tier 3: Forbid (or out-of-band only)
Reversibility No side effect (read, search, dry run) Reversible by the user in one action (draft, branch, soft delete) Reversible only with effort or by an admin (merged PR, DB restore) Irreversible (hard delete, payment sent, email delivered externally)
Blast radius The agent's own workspace One record or file the user owns Shared resources, other people's data, more than N records Production, all customers, security settings, permissions
Externality Nothing leaves the system Internal notification Message or write to another person or team External party, public surface, money
Provenance Only the user's own instructions in context Trusted internal data in context Untrusted content in context (web, inbound email, third-party tickets) Untrusted content in context and the action can exfiltrate or spend

How each tier behaves in the UI:

Tier What the user sees When Undo
0 Auto A line in the step timeline As it happens Not needed
1 Notify A dismissible notice with an Undo button Immediately after, with a 10 to 30 second undo window where you can delay the effect One click
2 Approve An approval card that blocks this action (not the whole run) Before execution Shown on the card
3 Forbid A refusal that explains why and links to the out-of-band route (a ticket, a change request, the admin console) Instead of the action N/A

Three rules make the matrix work.

Tier by arguments, not by tool name. send_email to yourself is Tier 1. send_email to 4,000 external addresses is Tier 3. run_sql with a SELECT is Tier 0; with DELETE and no WHERE, it's forbidden. A per-tool toggle is too coarse to avoid either fatigue or danger.

Taint escalates, never de-escalates. Once untrusted content enters the context, every externally visible or state-changing action moves up at least one tier for the rest of the session. That one rule turns most indirect prompt injection from silent exfiltration into a visible approval card.

Tool annotations are hints, not policy. The MCP specification defines readOnlyHint, destructiveHint, idempotentHint and openWorldHint, and its schema is blunt: "Clients should never make tool use decisions based on ToolAnnotations received from untrusted servers." The tools spec says clients MUST treat them as untrusted unless the server is trusted. Use them as defaults for servers you control; assign tiers yourself for everything else. Note the conservative defaults: if a server says nothing, destructiveHint and openWorldHint default to true.

Here is the classifier as code. It lives in your harness, outside the model, so the model cannot talk its way past it.

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

interface ProposedAction {
  tool: string;
  args: Record<string, unknown>;
  // Filled in by the harness, never by the model:
  sessionTainted: boolean;       // untrusted content has entered context
  externalRecipients: number;    // people outside your org affected
  recordsAffected: number;       // estimated from a dry run where possible
  reversible: "none" | "user" | "admin" | "no";
  environment: "sandbox" | "staging" | "production";
  spendMinorUnits: number;       // money, in pence/cents
}

interface Policy {
  maxAutoRecords: number;        // e.g. 1
  maxApproveRecords: number;     // above this, forbid in-agent
  maxApproveSpend: number;       // above this, out-of-band only
}

export function tierFor(a: ProposedAction, p: Policy): { tier: Tier; reasons: string[] } {
  const reasons: string[] = [];
  let tier: Tier = 0;
  const raise = (t: Tier, why: string) => {
    if (t > tier) tier = t;
    reasons.push(why);
  };

  if (a.reversible === "user") raise(1, "reversible by user");
  if (a.reversible === "admin") raise(2, "needs admin to reverse");
  if (a.reversible === "no") raise(2, "irreversible");

  if (a.recordsAffected > p.maxAutoRecords) raise(2, `${a.recordsAffected} records`);
  if (a.recordsAffected > p.maxApproveRecords) raise(3, "exceeds bulk limit");

  if (a.externalRecipients > 0) raise(2, `${a.externalRecipients} external recipients`);
  if (a.environment === "production" && a.reversible !== "none") raise(2, "production write");

  if (a.spendMinorUnits > 0) raise(2, "spends money");
  if (a.spendMinorUnits > p.maxApproveSpend) raise(3, "spend above limit");

  // Taint escalates anything with an effect beyond the workspace.
  const hasEffect = a.reversible !== "none" || a.externalRecipients > 0;
  if (a.sessionTainted && hasEffect) {
    raise(Math.min(3, Math.max(tier + 1, 2)) as Tier, "untrusted content in context");
    if (a.reversible === "no" && a.externalRecipients > 0) raise(3, "tainted + irreversible + external");
  }

  return { tier, reasons };
}

The reasons array is not decoration. It goes on the approval card ("Why am I being asked?"), into the audit log, and into your metrics so you can see which rule generates the most prompts.

04What an approval card must show

An approval card has one job: give a busy, slightly sceptical person enough to say no. Order the content by what changes the decision, not by what the data model looks like.

Diagram
+--------------------------------------------------------------+
| [!] Approval needed                       expires in 14:52   |
|                                                              |
| Send email to 3 external recipients                          |
| from: ops@yourco.example   via: gmail MCP (verified server)  |
|                                                              |
| TO   anna@client-a.example, raj@client-a.example,            |
|      billing@unknown-domain.example   <- first contact       |
| SUBJ Updated invoice                                         |
| BODY [view full text, 412 chars]  attachments: invoice.pdf   |
|                                                              |
| Cannot be undone once sent (no undo window on this tool)     |
| Why asked: external recipients; untrusted content in context |
| Context included: inbound email from billing@unknown-dom...  |
|                                                              |
| Agent's note (unverified): "Customer asked for a resend."    |
|                                                              |
|   [ Deny ]   [ Edit ]   [ Approve and send ]                 |
+--------------------------------------------------------------+

Name the action in plain words, generated from a template

The headline should be a verb, an object and a count: "Send email to 3 external recipients", "Delete 1,204 rows from orders in production", "Push 4 commits to main". Generate it from the tool name and arguments with a template you wrote. Do not ask the model to describe its own action. A model that has been hijacked will describe exfiltration as "sharing the report as requested", and a model that is simply wrong will describe its mistake confidently.

Show the exact arguments or diff, not a summary

Show what will actually be sent to the tool: the full command line, the SQL, the file diff, the recipient list, the URL with its query string. The MCP tools spec says clients SHOULD "show tool inputs to the user before calling the server, to avoid malicious or accidental data exfiltration". Three details matter in practice:

  • Make invisible characters visible. Bidirectional control characters can make text render differently from what a machine will execute; that is the Trojan Source attack (CVE-2021-42574). Render zero-width and bidi characters as visible tokens, and flag Punycode and mixed-script hostnames. The MCP elicitation spec asks clients to warn on Punycode URLs for the same reason.
  • Highlight the registrable domain. In https://docs.yourco.example.attacker.example/upload, the part that matters is attacker.example. Bold it. The elicitation spec asks clients to "highlight the domain of the URL to mitigate subdomain spoofing" for the same reason.
  • Summarise large diffs, but let people open them. For a 400-line change, lead with a structured summary you compute (files touched, lines added and removed, any change under .github/workflows/, any new dependency, any secrets-shaped string) and put the full diff one click away. Compute the summary in code; flagging .github/workflows/ changes is a regex, not a judgement.

Put the blast radius in numbers

"Update customer records" is not a blast radius. "Update 1,204 rows in customers (production), estimated from a dry run" is. Run a dry run or EXPLAIN or a count query before asking, wherever your tools allow, and show the number. If you can't estimate it, say so ("affected rows: unknown"), and treat unknown as large.

State reversibility and the exact undo path

Say whether it can be undone and how: "Undo available for 30 seconds", "Soft delete, restorable for 30 days from Trash", "Cannot be undone". When there's a real undo path, you often don't need an approval at all; Tier 1 with an undo window is less work for the user and more honest. Gmail's Undo Send is the canonical example: the message is held for a cancellation period of 5, 10, 20 or 30 seconds before it actually goes. Agents can do the same with outbound messages, webhooks and queued jobs. WCAG treats this as an equal option: SC 3.3.4 accepts submissions that are "reversible" as an alternative to ones that are "confirmed".

Show cost when there is one

Money: the amount, the currency, the payee and whether it's a one-off or recurring. Infrastructure: "Creates 3 × m7i.2xlarge, about $X/month" computed from your price list, not estimated by the model. If the agent's own run cost is material (a long research run, a batch job), show it on approvals that start more work.

Show provenance: who asked, through what, with what in context

This is the field most products leave out and the one that catches injection:

  • Who initiated the run (user, schedule, webhook) and on whose authority the action runs.
  • Which tool and which server, with its verified identity. The elicitation spec requires clients to "provide UI that makes it clear which server is requesting information"; apply the same rule to tool calls.
  • What untrusted content is in context, with links: "Read 2 web pages and 1 inbound email this session." If the session is tainted, say so on the card in words, not only with a colour.

Label the agent's rationale as a claim

The agent's explanation can be useful, but it's the least reliable thing on the card. Put it last, in a visually quieter style, labelled as the agent's own note. Never put it where the action description should be.

Show an expiry

Every approval request should expire, and the card should say when. More on timeouts below.

05Interaction patterns that hold up

Default focus on the safe choice

The WAI-ARIA Authoring Practices modal dialog pattern advises: "If a dialog contains the final step in a process that is not easily reversible, such as deleting data or completing a financial transaction, it may be advisable to set focus on the least destructive action." For Tier 2 cards, initial focus goes on Deny, or on the card heading, never on Approve. Pressing Enter by reflex should not ship anything.

Make friction proportional to risk, and put it on the field that matters

Generic friction (a three-second disabled button, a second "Are you sure?") habituates like everything else. The Bravo-Lillo result above points to a better kind: make the person interact with the specific risky value. GitHub's repository deletion flow asks you to type the repository name. For agents, that translates to:

  • Type the environment name to approve a production change.
  • Type the record count ("1204") to approve a bulk update.
  • Select each external recipient domain to approve a send to first-contact domains.

Reserve this for the riskiest slice of Tier 2. If every card demands typing, people will type without reading too.

Editable proposals: approve with changes

The most useful button on an approval card is often Edit, not Approve. Let the user fix the recipient, narrow the WHERE clause, or shorten the message, then approve the edited version. Two rules:

  • The edited arguments go through the tier classifier again. An edit can raise the tier (adding a recipient) as easily as lower it.
  • Tell the agent what changed. Return the edited arguments and a note ("user changed to and approved") in the tool result, or the agent will keep proposing the original.

The Vercel AI SDK and the OpenAI Agents SDK both pause on a pending approval and resume with an approve or reject decision. Neither turns an approval into an edit for you. Build editing as "reject with replacement arguments" in your harness, which our post on what an agent harness is treats as the layer that owns this loop.

Batch similar actions, but never batch across risk

Ten near-identical file edits in one workspace can be one card with a list and a combined diff. Batching cuts the prompt count without hiding anything, provided:

  • every item in the batch has the same tool, the same tier and the same tier reasons;
  • the card shows the count and lets the user deselect individual items;
  • a Tier 2 item is never folded into a batch of Tier 1 items, where it would hide behind its neighbours.

Scope "remember this decision" carefully

"Allow once / allow for this session / always allow" is standard in coding agents, and it is how you get the prompt count down. Make the scope explicit (this exact command, this command prefix, this tool on this server, this session only) and expire session grants when the session ends or becomes tainted. For the highest-risk tools, don't offer "remember" at all. Claude Code does exactly this for connector tools an organisation sets to ask: it prompts on every call, even in acceptEdits, auto and bypassPermissions, and "never offers an option to remember your choice".

Distinguish deny, cancel and timeout

The MCP elicitation spec uses three response actions: accept, decline (an explicit no) and cancel (dismissed without a choice: Escape, clicking away, a failed load). Copy that model for tool approvals. An explicit Deny should feed back to the agent ("the user declined; do not retry this action"). Cancel or timeout should pause the action and leave it pending or expired, not tell the agent the user objected. Conflating them produces agents that either retry denied actions or abandon tasks because someone closed a laptop.

Timeouts and expiry

Approvals should expire, for two reasons. The world changes (the row count you showed is stale after an hour), and a pending approval is an attack surface (a forgotten card approved next week by someone who no longer remembers the context). On expiry, the action is not executed; the run either pauses or takes its documented fallback.

Accessibility shapes how you do this. WCAG SC 2.2.1 Timing Adjustable requires that a time limit can be turned off, adjusted to at least ten times the default, or extended with a warning and "at least 20 seconds to extend the time limit with a simple action", unless an exception applies (one is a limit longer than 20 hours). Practical reading: don't build 60-second approvals that vanish. Use long expiries (hours for most Tier 2 actions), warn before expiry, offer "extend", and make an expired request re-requestable with fresh data rather than silently lost. Short undo windows on Tier 1 notices are fine because missing one loses nothing: the action simply happens, as it would have without the window.

For waits longer than a request, persist the paused run. The OpenAI Agents SDK serialises a paused run with state.to_json() and restores it with RunState.from_json(...), and warns: "Only deserialize snapshots from trusted storage". Keep that state on the server, never in the client.

Mobile approvals

Approving from a phone notification is convenient and is where context goes to die. Rules we'd ship:

  • Tier 1 actions only from a lock-screen notification action. Undo-able, low radius.
  • Tier 2 requires opening the app and seeing the full card. On iOS, mark the action with authenticationRequired ("The action can be performed only on an unlocked device"); on Android, use Notification.Action.Builder setAuthenticationRequired(true). Even then, deep-link to the card rather than offering "Approve" in the notification itself.
  • The riskiest Tier 2 actions get step-up authentication: a fresh passkey assertion with user verification, bound to the approval ID. If you're rolling out passkeys across the company, this is a second use for them.
  • Design the card for a 375 px viewport. Arguments wrap; long diffs collapse to the computed summary with "open on desktop" for the full view. Never truncate the recipient list or the domain.

06Accessible approval card: HTML, CSS and TypeScript

An approval card that only works with a mouse, or communicates "danger" only in red, fails real users and fails WCAG (SC 1.4.1 Use of Color). Here is a reference implementation of an inline card (it blocks one action in a run, not the whole page). For a page-blocking confirmation, use <dialog> with showModal(), which gives you focus containment and Escape handling for free.

html
<section class="approval" role="region" aria-labelledby="ap-title" aria-describedby="ap-why"
         data-tier="2" data-approval-id="apr_7f3c">
  <header class="approval__head">
    <h3 id="ap-title" tabindex="-1">Approval needed: delete 1,204 rows from <code>orders</code> in production</h3>
    <p class="approval__expiry">Expires at <time datetime="2026-07-12T16:30:00Z">16:30 UTC</time></p>
  </header>

  <dl class="approval__facts">
    <dt>Blast radius</dt><dd>1,204 rows (from dry run at 14:28 UTC)</dd>
    <dt>Reversible</dt><dd><strong>No.</strong> Restore requires a point-in-time recovery.</dd>
    <dt>Requested by</dt><dd>Run #8812, started by priya@yourco.example</dd>
    <dt>Context</dt><dd>Session includes untrusted content: 1 web page</dd>
  </dl>

  <details class="approval__args" open>
    <summary>Exact SQL</summary>
    <pre><code>DELETE FROM orders WHERE status = 'test' AND created_at &lt; '2026-01-01';</code></pre>
  </details>

  <p id="ap-why" class="approval__why">Asked because: production write; irreversible; untrusted content in context.</p>
  <p class="approval__note">Agent's note (unverified): "Cleaning up test orders as requested."</p>

  <div class="approval__confirm">
    <label for="ap-confirm">Type <strong>production</strong> to enable approval</label>
    <input id="ap-confirm" autocomplete="off" spellcheck="false" aria-describedby="ap-confirm-hint">
    <span id="ap-confirm-hint" class="visually-hidden">Approval stays disabled until this matches.</span>
  </div>

  <div class="approval__actions">
    <button type="button" data-action="deny">Deny</button>
    <button type="button" data-action="edit">Edit SQL</button>
    <button type="button" data-action="approve" aria-disabled="true">Approve and run</button>
  </div>

  <p class="visually-hidden" role="status" aria-live="polite" data-status></p>
</section>
css
.approval {
  border: 2px solid var(--border-strong);
  border-radius: 12px;
  padding: 16px;
  max-inline-size: 72ch;
}
/* Risk is never colour alone: tier 2 also gets a text label and an icon in the heading. */
.approval[data-tier="2"] { border-color: var(--danger); }
.approval__facts { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; }
.approval__args pre {
  white-space: pre-wrap;          /* wrap long SQL and URLs on phones */
  overflow-wrap: anywhere;
  font-family: "JetBrains Mono", ui-monospace, monospace;
}
.approval__note { color: var(--text-muted); font-style: italic; }
.approval__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.approval__actions button { min-block-size: 44px; min-inline-size: 44px; }
.approval__actions [data-action="approve"][aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; }
.visually-hidden {
  position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}
@media (prefers-reduced-motion: no-preference) {
  .approval { animation: approval-in 160ms ease-out; }
}
@keyframes approval-in { from { opacity: 0; transform: translateY(4px); } }
ts
const INVISIBLES = /[\u200B-\u200F\u202A-\u202E\u2066-\u2069\uFEFF]/g;

/** Make zero-width and bidi control characters visible before rendering arguments. */
export function revealInvisibles(s: string): string {
  return s.replace(INVISIBLES, (c) => `<U+${c.codePointAt(0)!.toString(16).toUpperCase().padStart(4, "0")}>`);
}

export function mountApproval(card: HTMLElement, send: (d: Decision) => Promise<void>) {
  const id = card.dataset.approvalId!;
  const approve = card.querySelector<HTMLButtonElement>('[data-action="approve"]')!;
  const confirm = card.querySelector<HTMLInputElement>("#ap-confirm");
  const status = card.querySelector<HTMLElement>("[data-status]")!;

  // Focus the heading, not Approve: an Enter keypress by reflex does nothing harmful.
  card.querySelector<HTMLElement>("#ap-title")!.focus();

  // aria-disabled (not disabled) keeps the button focusable and announced.
  const sync = () => {
    const ok = !confirm || confirm.value.trim() === "production";
    approve.setAttribute("aria-disabled", String(!ok));
  };
  confirm?.addEventListener("input", sync);
  sync();

  card.addEventListener("click", async (e) => {
    const btn = (e.target as HTMLElement).closest<HTMLButtonElement>("button[data-action]");
    if (!btn || btn.getAttribute("aria-disabled") === "true") return;
    const action = btn.dataset.action as Decision["action"];
    btn.setAttribute("aria-disabled", "true");          // no double submits
    await send({ approvalId: id, action });
    status.textContent = action === "approve" ? "Approved. Running now." : action === "deny" ? "Denied." : "Editing.";
  });

  card.addEventListener("keydown", (e) => {
    if (e.key === "Escape") {                            // Escape is cancel, not deny
      e.preventDefault();
      void send({ approvalId: id, action: "cancel" });
      status.textContent = "Dismissed. The action is still pending.";
    }
  });
}

type Decision = { approvalId: string; action: "approve" | "deny" | "edit" | "cancel" };

A few choices in there are deliberate. aria-disabled rather than disabled keeps the Approve button in the tab order, so a screen reader user can find it and hear why it's unavailable. Status changes go through a polite live region so the outcome is announced without moving focus (SC 4.1.3 Status Messages). Escape maps to cancel, matching the MCP decline/cancel distinction. Touch targets are at least 44 px. Animation only runs when the user hasn't asked for reduced motion.

07The approval is a server-side record, not a modal

The most common implementation bug is treating the approval as UI state. The button sends approved: true, the harness runs whatever the model currently wants, and nobody checks that "whatever the model currently wants" is what the human saw. Fix it on the server:

ts
import { createHash, randomUUID } from "node:crypto";

/** Stable JSON: sorted keys, so the same arguments always hash the same. */
function canonical(v: unknown): string {
  if (Array.isArray(v)) return `[${v.map(canonical).join(",")}]`;
  if (v && typeof v === "object") {
    return `{${Object.keys(v).sort().map((k) => `${JSON.stringify(k)}:${canonical((v as any)[k])}`).join(",")}}`;
  }
  return JSON.stringify(v);
}

export interface ApprovalRecord {
  id: string;
  runId: string;
  tool: string;
  argsHash: string;               // sha256 of canonical(args) shown to the human
  tier: 2;
  reasons: string[];
  shownSnapshot: object;          // exactly what the card rendered, for the audit trail
  requestedBy: string;            // initiating principal
  status: "pending" | "approved" | "denied" | "cancelled" | "expired" | "consumed";
  decidedBy?: string;
  decidedAt?: string;
  expiresAt: string;
}

export function createApproval(runId: string, tool: string, args: object, meta: Omit<ApprovalRecord,
  "id" | "runId" | "tool" | "argsHash" | "status">): ApprovalRecord {
  return {
    id: `apr_${randomUUID()}`,
    runId, tool,
    argsHash: createHash("sha256").update(canonical(args)).digest("hex"),
    status: "pending",
    ...meta,
  };
}

/** Called by the harness immediately before executing the tool. */
export function assertApproved(rec: ApprovalRecord, tool: string, args: object, now = new Date()) {
  if (rec.status !== "approved") throw new Error(`approval ${rec.id} is ${rec.status}`);
  if (new Date(rec.expiresAt) <= now) throw new Error(`approval ${rec.id} expired`);
  if (rec.tool !== tool) throw new Error("approved tool differs from executed tool");
  const h = createHash("sha256").update(canonical(args)).digest("hex");
  if (h !== rec.argsHash) throw new Error("arguments changed after approval");
  // Caller must atomically flip status to "consumed" in the same transaction as dispatch.
}

What this buys you:

  • No time-of-check to time-of-use gap. The human approves a hash of exact arguments. If the model regenerates the call with a different recipient, it fails closed.
  • Single use. Marking the record consumed when dispatching means a retry can't replay an approval for a second execution. Pair it with an idempotency key on the downstream call, as in our post on idempotency keys for APIs that survive retries, so a network retry after approval doesn't send the email twice.
  • Self-approval rules. For accountability approvals, check that decidedBy is not requestedBy, the same way branch protection stops authors approving their own PRs.
  • An audit trail that answers "who approved what they saw". Store shownSnapshot, not just the arguments. If the card truncated a recipient list, the audit log should show the truncation. Emit each decision as a span event on the run's trace so approvals line up with tool calls; our post on tracing agent runs with the OpenTelemetry GenAI conventions covers the span model.

The MCP tools spec also lists "log tool usage for audit purposes" among the things clients SHOULD do. Approval decisions belong in that log.

08What current agent products do

These are the behaviours as documented at the time of writing. They change fast, so check the linked docs before you copy anything.

Product Approval model What's worth copying
Claude Code Permission modes: default (Manual), acceptEdits, plan, auto, dontAsk, bypassPermissions; allow, ask and deny rules on top Auto mode puts a separate classifier model in front of actions instead of the user. If it blocks "3 times in a row or 20 times total", auto mode pauses and prompting resumes. Explicit ask rules are never auto-approved, in any mode. Deny rules block even in bypassPermissions
OpenAI Codex approval_policy (on-request, never, or a granular table) plus sandbox_mode (read-only, workspace-write, danger-full-access) Granular policy lets you prompt for some categories (sandbox escalation, MCP elicitations, skill scripts) and auto-reject others. approvals_reviewer = "auto_review" routes eligible requests to a reviewer agent first
GitHub Copilot cloud agent Agent works on a branch and opens a PR; Actions workflows don't run on its pushes until someone clicks "Approve and run workflows" (admins can turn this off) The approval sits on an artefact humans already know how to review: a PR diff with CI
MCP specification Tools: there "SHOULD always be a human in the loop with the ability to deny tool invocations"; elicitation: accept, decline, cancel Sensitive input goes through URL mode so it never passes through the client or the model; clients must show the full URL and the requesting server
Vercel AI SDK toolApproval per tool ('not-applicable', 'approved', 'denied', 'user-approval') or as a function; tool-approval-request and tool-approval-response parts Approval as data in the message stream, which makes it easy to persist and render
OpenAI Agents SDK needs_approval as a boolean or per-call function; interruptions; state.approve() / state.reject(); serialisable RunState Per-call approval functions are where your tier classifier plugs in

Two lessons run through this table.

The products with the most users are moving humans out of routine approvals, not adding more prompts. Sandboxing, allowlists and classifier reviewers handle the bulk; humans see escalations. Our post on rolling out coding agents across a team covers the policy side of that for engineering orgs.

Classifier reviewers are a tier, not a replacement. Anthropic is candid about the limits of its own: on a small set of real overeager actions (n = 52), the full pipeline's false-negative rate was 17%, which the post calls "the honest number". A model reviewing a model is a useful filter that cuts prompt volume. It does not turn a Tier 3 action into a Tier 0 one. Use it to decide which Tier 2 actions reach a human, keep hard denies in deterministic code, and keep an outer sandbox.

09Anti-patterns to remove this quarter

  • Approve-all buttons on a list of mixed-risk actions.
  • Model-written headlines ("I'll tidy up the old records") instead of templated ones.
  • Truncated arguments with no way to expand, especially recipient lists, URLs and SQL WHERE clauses.
  • Focus on Approve when the card opens, or Enter mapped to approve.
  • Colour-only risk signalling.
  • "Always allow" on a tool with an open world, such as arbitrary HTTP requests or shell, without a scope.
  • Approvals as UI state: no server record, no argument hash, no expiry.
  • Escape or timeout treated as deny, so the agent tries a workaround; or treated as approve, which is worse.
  • Approving tainted sessions with no indication they're tainted.
  • Using approvals instead of a sandbox for actions that should simply be impossible.
  • Asking for approval after the fact, where the "approval" is really a notification with a misleading button. If it already happened, say so and offer Undo.

10The approval-card spec template

This is the second half of the original asset. Fill one in for every Tier 2 action type before you build its card. If a field can't be filled, that's the finding: you either can't show the user enough to decide, or the action belongs in a different tier.

yaml
# approval-card spec: one per Tier 2 action type
action_id: email.send.external
tool: gmail.send_message            # server + tool, as the harness sees it
tier: 2
tier_reasons_that_trigger:          # from the classifier, shown on the card
  - external recipients
  - untrusted content in context

headline_template: "Send email to {recipient_count} external recipient(s)"
                                    # templated from args; never model-written

exact_payload:
  show: [to, cc, bcc, subject, body, attachments]
  never_truncate: [to, cc, bcc]     # fields that must always be fully visible
  reveal_invisible_chars: true
  highlight_registrable_domain: [to, cc, bcc]
  first_contact_flag: true          # mark recipients/domains never contacted before

blast_radius:
  measure: "count(to + cc + bcc)"
  source: computed                  # computed | dry_run | unknown
  unknown_means: treat_as_large

reversibility:
  kind: none                        # none | undo_window | soft_delete | admin_restore
  undo_window_seconds: 0
  card_text: "Cannot be undone once sent."

cost:
  kind: none                        # none | money | infra | run_cost
  display: null

provenance:
  show_initiator: true              # user / schedule / webhook, and identity
  show_server_identity: true
  show_untrusted_context: true      # list of untrusted sources read this session

agent_rationale:
  show: true
  label: "Agent's note (unverified)"
  position: last

controls:
  buttons: [deny, edit, approve]
  initial_focus: heading            # heading | deny; never approve
  typed_confirmation: null          # e.g. "production", "{record_count}"
  remember_options: [once]          # once | session | prefix | tool; [] to disable
  edit_reclassifies: true

lifecycle:
  expires_after: PT4H               # ISO 8601 duration
  warn_before_expiry: PT15M
  extendable: true
  on_expiry: pause_run              # pause_run | fallback:<name>
  on_cancel: leave_pending
  on_deny: tell_agent_do_not_retry

binding:
  args_hash: sha256_canonical_json
  single_use: true
  separation_of_duties: false       # true: approver must differ from requester
  step_up_auth: none                # none | passkey_uv

surfaces:
  desktop: full_card
  mobile_app: full_card             # wraps, never truncates never_truncate fields
  notification_action: none         # Tier 2 deep-links to the card instead

audit:
  store_shown_snapshot: true
  trace_event: approval.decision
  retain_days: 400

metrics:                            # review these monthly
  - approval_rate
  - median_time_to_decision
  - edit_rate
  - post_approval_reversal_rate

And the review questions to run against each completed spec:

  1. Could a reasonable person say no from what's on this card alone, without opening the agent transcript?
  2. Is every field on the card computed by code, apart from the clearly labelled agent note?
  3. Would the card look different if the session were tainted? How?
  4. Is there an undo path that would let this be Tier 1 instead?
  5. What happens if the model changes one argument after approval?
  6. What happens if nobody answers for a week?
  7. Can it be fully used with a keyboard and a screen reader, and at 375 px wide?
  8. Does the audit record show what the approver actually saw?

11How to tell whether your approvals are working

Instrument the approval surface like any other product feature. Four signals, with how we'd read them (these are heuristics, not industry benchmarks):

Metric What it tells you Action when it looks wrong
Approval rate per action type If it's near 100% over hundreds of decisions, the prompt isn't changing outcomes Demote to Tier 1 with an undo window, or add an allow rule; spend the attention elsewhere
Median time to decision A median of about a second on a card with a diff means nobody is reading it Cut prompt volume first; then move the critical field to the top or add targeted friction
Edit rate People are fixing proposals, so the agent's defaults are off Feed the edits back into prompts, tool defaults or evals
Post-approval reversal rate Approved actions later undone or rolled back: the card didn't show what mattered Read the reversed cases and find the missing field

You can also test approvers directly, the way phishing simulations test inboxes: seed a known-bad proposal into a staging run and see whether it's caught. Our post on agent failure modes in production covers the destructive and out-of-policy actions worth seeding, and why you verify outcomes against the world rather than the agent's report.

If you're building on MCP, much of the information an approval card needs (honest tool names, structured arguments, dry-run support, actionable errors) has to come from the server. That's a tool-design problem, covered in our guide to building MCP servers agents can actually use. And because approval cards sit inside a running agent's timeline, they should follow the same rules as the rest of the run's progress UI, which we covered in designing for AI latency and agent step disclosure.

12Where this crosses into other layers

Approval UX looks like a design problem and is mostly decided elsewhere. Whether you can show a blast radius depends on tools that support dry runs and counts (Software). Whether you can show provenance depends on the harness tracking taint per session (AI & Automation). Whether a mistaken approval is survivable depends on scoped credentials, egress control and sandboxing (Security). Whether an approval can be trusted later depends on server-side records, argument hashes and audit retention, which auditors and the EU AI Act's human-oversight article will ask about (Strategy). A design team handed a "make the permission prompts nicer" ticket can't fix any of that alone. It works when design, platform and security agree on one tier matrix and build the card from it.

13FAQ

What is approval fatigue in AI agents?

It's what happens when an agent asks for permission so often that users approve without reading. Anthropic reports Claude Code users approve 93% of permission prompts, and years of research on browser and OS warnings shows attention to repeated prompts measurably declines. The fix is fewer, better prompts: auto-allow safe actions, use undo windows for reversible ones, and reserve approvals for risky, irreversible or tainted actions.

Which AI agent actions should require human approval?

Actions that are hard or impossible to reverse, affect shared or production resources, reach external people, spend money, or are proposed after the agent has read untrusted content. Read-only actions in the agent's own workspace should run automatically. Actions that are both irreversible and externally visible in a tainted session should usually be forbidden in-agent and routed out of band.

What should an AI agent approval prompt show?

A templated headline (verb, object, count), the exact arguments or diff, the blast radius in numbers, whether and how it can be undone, any cost, who initiated the run, which tool and server will execute it, whether untrusted content is in context, the agent's own rationale labelled as unverified, and an expiry time. Never use a model-written summary as the main description.

Is an undo window better than a confirmation dialog?

For reversible actions, usually yes. An undo window lets the action proceed, costs the user nothing when it's right, and catches mistakes when it's wrong. WCAG 3.3.4 treats reversibility and confirmation as equal options. Use confirmation when the effect can't be held back or reversed, such as a payment or an email that has already been delivered.

Can an AI classifier replace human approval?

It can replace most routine approvals and should, because humans approving dozens of prompts aren't reviewing them. It shouldn't replace deterministic denies or the outer sandbox. Anthropic reports a 17% false-negative rate for its own classifier on a small set of real overeager actions, so treat a classifier as a filter that decides what reaches a human, not as the last line of defence.

How do you make an approval dialog accessible?

Put initial focus on the heading or the least destructive action, never on Approve. Signal risk with text as well as colour. Keep disabled buttons focusable with aria-disabled and explain why. Announce outcomes in a live region. Make Escape cancel rather than deny. Size touch targets to at least 44 px. Give time limits a warning and a way to extend them, as WCAG 2.2.1 requires.

If this is the layer that hurts, we should talk.

Tell us which layer hurts →