Designing Human-AI Collaboration in Agent Products
When an AI agent should stop for approval, accept an edit or hand over to a person, plus how to show uncertainty and collect feedback, from official guidance.
An agent that sends email, edits records or spends money needs a clear answer to one design question: when does a person step in, and what can they do then? This guide answers it from four primary sources: Microsoft’s Guidelines for Human-AI Interaction, Google’s People + AI Guidebook, the NIST AI Risk Management Framework, and the human-in-the-loop features of LangGraph and the OpenAI Agents SDK.
The guidance in one table
Microsoft’s guidelines come from a CHI 2019 paper by Saleema Amershi and colleagues, which proposes 18 guidelines and tested them in a study where 49 design practitioners applied them to 20 AI-infused products. Google’s PAIR guidebook covers similar ground, and NIST frames the organisational side as risk management.
| Design question | Microsoft HAX guideline (paraphrased) | Google PAIR advice | NIST AI RMF outcome |
|---|---|---|---|
| Who decides, and on what? | G10: scope services when in doubt | Let people keep control where stakes are physical, emotional or financial | Govern 3.2: roles for human-AI configurations and oversight |
| How sure is the system? | G2: be clear about how well the system works | Test confidence displays before shipping them | Map 3.5: human oversight processes are defined and documented |
| Why did it act? | G11: explain why the system acted | Explain which data the system used | Accountable and transparent as a trust characteristic |
| What if it is wrong? | G9: support efficient correction | Make manual takeover easy | Manage 2.4: ways to supersede, disengage or deactivate the system |
| How does it improve? | G15: invite granular feedback; G16: show what user actions change | Explain what feedback changes and when | Measure 3.3 and Manage 4.1: user feedback, appeal and override |
Approve, edit or take over
There are three distinct ways a person can step into an agent’s work, and they need different interfaces.
- Approve or reject. The agent has a complete action ready (send this email, issue this refund) and waits for a yes or no. Use it for actions that are hard to undo.
- Edit. The person changes the proposal before it runs: a different recipient, a corrected amount, a rewritten paragraph. HAX guideline 9 asks for exactly this, so that fixing a mistake takes less effort than starting again.
- Take over. The agent stops and the person finishes the task by hand. PAIR’s errors chapter says that when a system fails, letting the user take over is often the simplest route, and that the handover must give them what they need to carry on: what is going on, what comes next, and how to do it.
To decide which actions need a gate, sort them by consequence rather than by how confident the model sounds. PAIR observes that people usually want to stay accountable for decisions involving safety, health, feelings or money. Microsoft’s guideline 10 adds a rule for ambiguity: when the agent is unsure what the user meant, it should ask a clarifying question or do less, not guess. NIST treats the whole arrangement as a governance matter: Govern 3.2 asks organisations to set out who plays which role in human-AI configurations, and Map 3.5 asks that oversight processes be defined, assessed and written down.
Building an approval gate in LangGraph
LangGraph’s interrupt() function pauses a graph at any point in a node and hands a JSON-serialisable payload to the caller. The graph’s state is saved by a checkpointer, and the run waits with no time limit until your application resumes it with Command(resume=...). Whatever you pass to resume becomes the return value of interrupt().
The docs show the pattern inside a tool, so the gate travels with the tool wherever the model calls it:
from langchain.tools import tool
from langgraph.types import interrupt
@tool
def send_email(to: str, subject: str, body: str):
"""Send an email to a recipient."""
response = interrupt({
"action": "send_email",
"to": to,
"subject": subject,
"body": body,
"message": "Approve sending this email?"
})
if response.get("action") == "approve":
final_to = response.get("to", to)
final_subject = response.get("subject", subject)
final_body = response.get("body", body)
return f"Email sent to {final_to} with subject '{final_subject}'"
return "Email cancelled by user"
The reviewer’s decision comes back on the same thread, and it can carry edited fields:
graph.stream_events(
Command(resume={"action": "approve", "subject": "Updated subject"}),
config={"configurable": {"thread_id": "email-workflow"}},
version="v3",
)
That single payload covers approve, edit and cancel. A few rules from the LangGraph docs matter in production:
- Resume with the same
thread_id. It is the pointer to the saved checkpoint; a new ID starts an empty thread. - Use a durable checkpointer. The docs ask for a persistent one, for example backed by a database, in production.
- The node reruns from the top. On resume, LangGraph restarts the whole node, so any code before
interrupt()executes again. Put side effects after the interrupt, split them into their own node, or make them idempotent (an upsert rather than an insert). - Type the response. From langgraph 1.2.12,
interrupt()takes aresponse_schemathat validates the resume value and lets clients render a form.
The same idea in the OpenAI Agents SDK
The OpenAI Agents SDK puts the rule on the tool. needs_approval=True always pauses; an async function decides call by call, for example only when an email subject mentions a refund. Paused calls appear in result.interruptions as ToolApprovalItem entries with the agent name, tool name and arguments. You turn the result into a RunState, call state.approve(...) or state.reject(...), and run again.
Two details are worth copying. The per-call function fails closed: if the arguments are missing, malformed or not a JSON object, the SDK skips it and asks a human. And “always approve” decisions stick while the run context is reused, so when agents have different permissions the docs advise per-call decisions and a fresh context for new runs.
Showing uncertainty and sources
An approval screen is only useful if the reviewer can judge the proposal. HAX guideline 2 asks products to help users understand how often the system may make mistakes, and guideline 11 asks for an explanation of why it acted. PAIR’s explainability chapter frames the aim as calibrated trust: people should know when to rely on the output and when to use their own judgement.
In practice, for an agent:
- Show the inputs behind the action. List the documents, records or tool results the agent relied on. PAIR notes that knowing what data the system used helps people spot a fact they have and the system lacks.
- Say when data is thin. PAIR suggests admitting that missing data may hurt the result, and pointing the user to their own judgement.
- Be careful with numbers. PAIR warns that fine-grained scores can confuse, and that an inflated score can lead people to accept a result without checking. Its alternatives are categories such as high, medium and low, each tied to a clear next step, or a short list of the top alternatives when confidence is low. Whatever you choose, test it with users early.
A language model’s own “confidence” label is not a calibrated probability. Route approvals with rules you can test, such as missing sources or a sensitive action type, and treat the model’s label as one signal. Our guide to drafting support replies with an LLM applies this to a draft-then-review workflow.
Feedback loops that people will use
PAIR separates implicit feedback (what people do, such as accepting or rejecting a suggestion) from explicit feedback (ratings, thumbs, written comments). Approval gates produce both for free: each approve, edit and reject is a labelled example of what the agent should have done. Store the original proposal, the final version and the reviewer’s reason together so you can measure edit rates per action type and tighten or loosen gates with evidence. Observability platforms such as Langfuse, which traces and evaluates agents, and the tools in our evaluation and monitoring hub are a natural place to keep these records.
On the user side, HAX guideline 15 asks for feedback during normal use, and guideline 16 asks the product to show how that feedback will change later behaviour. PAIR adds that a thank-you is not enough: say what the feedback does and when it takes effect. Let people reset what they have told the system, and tell them when you collect behavioural signals.
NIST’s framework closes the loop at the organisation level. Measure 3.3 calls for ways for end users to report problems and appeal outcomes, with that input feeding evaluation metrics. Manage 4.1 asks post-deployment monitoring plans to cover user input, appeal and override, incident response and decommissioning. Manage 2.4 asks that someone is responsible for, and able to, supersede or switch off a system that behaves outside its intended use, which for an agent means a kill switch someone actually owns.
A short checklist
| Check | Source |
|---|---|
| Irreversible and financial actions require approval; the rule lives with the tool | LangGraph interrupts, OpenAI Agents SDK |
| Reviewers can edit arguments, not just accept or reject | HAX G9, LangGraph resume payload |
| Ambiguous requests trigger a question, not a guess | HAX G10 |
| Approval screens list the sources the agent used | HAX G11, PAIR explainability |
| Confidence shown as buckets or alternatives, tested with users | PAIR explainability |
| Takeover gives the person full context to continue by hand | PAIR errors |
| Feedback is acknowledged and its effect explained | HAX G15 and G16, PAIR feedback |
| A named owner can pause or switch off the agent | NIST Manage 2.4 |
Honest limits
None of these sources gives thresholds. They will not tell you which dollar amount needs a second approver or what edit rate means a gate can be lifted; NIST says people should set those metrics and thresholds for their own context. Approval gates also slow work down, and a reviewer facing a stream of requests may approve without reading, which is why the request has to be easy to judge quickly. For framework choice beyond human-in-the-loop support, see our agent frameworks hub.
Written by AI Agents Directory
Editorial team
Facts in this guide are checked against official documentation and repositories, which are linked in the article.