How do you design human-in-the-loop approval for agent actions?
705 views
35 of 83
1
The problem
Question presented to candidate:
"Our support agent can now issue refunds, email customers and close accounts. Product wants a human to approve the risky actions. How would you design that approval step so it is actually safe, and so the humans do not end up clicking Approve on everything?"
What a strong answer should cover:
Deciding what needs approval by risk (irreversibility, blast radius, external visibility), with tiers such as auto, notify-after and approve-before
The run mechanics: the agent pauses with its state persisted, an approval request is created, and the run resumes or is cancelled when a decision arrives, including timeouts that default to deny
Binding the approval to the exact action: arguments hashed and re-checked at execution, an expiry, single use, and the approver identity recorded, so the agent cannot change the action after the human said yes
An approval UI that lets a human judge: a preview or diff of the real effect, the agent reason, and edit-then-approve or reject-with-feedback
Approval fatigue as the main failure mode, and the fixes: fewer, better-targeted prompts, scoped grants, batching, and calibrating tiers from approval data
Routing to someone with authority and context, separation of duties for the highest tier, and an audit trail of proposed, shown, decided and executed
Clarifying questions expected:
Is the approver the end user in the chat, or a separate reviewer such as a support lead?
Must the agent wait synchronously, or can approvals arrive minutes or hours later?
Which actions are truly irreversible here (money, outbound messages, deletions)?
Code / implementation expected: Optional โ the approval data model and the execution-time check, or how a framework pauses and resumes a run.
human-in-the-loop
approvals
safety
agents
2
Try it yourself
Sketch your approach before you read the solution. That is what the interview tests.
Stuck? Get a hint.
A short nudge toward the approach. It will not give the answer away.
3
Solution
Target Audience: Engineers adding approval steps to agents that can spend money, message people or change data, and candidates asked to design that step.
Difficulty: Medium
Verified with: Node 22.22.0 and Python 3.12.3 (both examples, identical output). Framework APIs were checked in October 2026: AI SDK ai 7.0.143 type definitions (read from the published package), the LangGraph and OpenAI Agents SDK docs (via web search), and the @modelcontextprotocol/server 2.3.1 doc comments.
How to read this doc: Every idea is explained in plain language first, then tagged with ๐ Interview term: so you also learn the words an interviewer expects. All program output shown was produced by actually running the examples; the Verified section quotes it in full.
1. Why This Even Matters โ A Story First
A bank teller can hand you $200 on their own. For $20,000 they fill i
The solution is hidden so you can try first
15 min read ยท 12 sections
4
Read the code
Risk tiers and approvals bound to the exact action