Have a project in mind? Let's talk.

Human in the loop AI agents pause before sensitive actions and wait for a person to approve, reject, or edit what the agent was about to do. That sounds simple, but most teams get it wrong in one of two ways: they either gate nothing and hope the model behaves, or they gate everything and train their reviewers to click approve without reading. Both end the same way, with an agent taking an action nobody actually reviewed, and the postmortem finding that the control existed on paper only. This post covers where the approval gate belongs, how the interrupt flow works in the two frameworks most teams use, why approvals must fail closed, and the operational details that decide whether the gate survives contact with production.
Microsoft's guidance on reducing agentic AI risk names the underlying problem: autonomy increases both the impact of errors and the attractiveness of the system to adversaries, and every agent-to-tool, agent-to-service, and agent-to-agent interaction expands the attack surface (Microsoft Learn). The same document lists "human oversight and control" as a first-class design risk: a system that lacks meaningful points for user review, approval, correction, or interruption of autonomous behavior is a system design failure, not a missing feature (Microsoft Learn).
The stakes are concrete. An agent that reads email and summarizes it can be wrong cheaply. An agent that replies to customers, moves money, changes production config, or deletes records can be wrong expensively, and it can be manipulated into being wrong through indirect prompt injection in the content it processes. The approval gate is where a person gets to see the exact action, with its exact arguments, before it becomes irreversible.
This is not about distrusting the model. It is about matching the cost of a mistake to the cost of a review. Reads are cheap to allow and cheap to get wrong. Writes, payments, deletions, and external messages are where a human earns their place in the loop.
The gate belongs on the action boundary, not on the agent's reasoning. You do not need a person to approve what the agent thinks; you need one to approve what it does. In practice that means marking specific tool calls as approval-required: sending email or messages, creating or updating records in systems of record, any payment or purchase, any deletion, any permission change, and anything that touches production infrastructure.
Two design rules follow. First, gate the tool, not the task. "Approve every customer support run" sounds safe and produces hundreds of meaningless approvals a day. "Approve the refund call and the outbound email call" produces a handful of meaningful ones. Second, decide per call when you can. A refund under a small threshold might auto-approve while a large one pauses, and the decision should depend on the parsed arguments of that specific call, not a blanket rule.
If you are deciding which tools to gate, sort every tool your agent can call into three tiers. Tier one is free-running: reads, searches, internal drafts, and anything fully reversible, which run without interruption. Tier two is gated: external writes, messages to customers, record changes, and anything a regulator or a customer would ask about later, which always pause for a person. Tier three is blocked outright: actions the agent should never take at all, such as changing its own permissions or touching systems outside its job, enforced in code rather than by review.
The tiering matters because it converts a vague instruction like "be careful with refunds" into an explicit, testable policy. It also gives you the natural place to grow: when a new tool is added, it lands in a tier on day one instead of inheriting whatever trust the agent already had. Microsoft's risk guidance frames the same idea as matching oversight to the impact of the action, and treats missing review points as a design gap to close, not a convenience to skip (Microsoft Learn).
Both major agent frameworks now ship this pattern natively, and the mechanics are nearly identical.
In the OpenAI Agents SDK, tools declare when they need approval: set needs_approval to True to always require it, or pass an async function that decides per call from the run context and parsed tool parameters (OpenAI Agents SDK). When a gated tool call arrives, the run pauses and surfaces the pending approval as an interruption. The approval surface is run-wide: it works the same whether the tool belongs to the top-level agent, to an agent reached through a handoff, or to a nested agent invoked as a tool, and you approve or reject on the outer run state (OpenAI Agents SDK). The paused run is serialized through RunState, so the process does not have to stay alive while a human thinks; the SDK documentation explicitly covers keeping approval state on the server, recovering after a crash, and long-running approvals (OpenAI Agents SDK).
LangGraph's model is the same shape with its own vocabulary. The interrupt function pauses graph execution mid-node and surfaces a payload to the caller; the run resumes when a person provides a decision (LangGraph). Its documented patterns map directly onto the approval use case: approve or reject, review and edit state before resuming, and validating human input before the run continues (LangGraph).
The common thread matters more than the syntax: in both frameworks, the pause is durable and resumable, and the human decision is an input to the run, not a side channel.
The most important single line in the OpenAI SDK documentation is easy to miss: callable approval rules fail closed. If the tool arguments are missing, empty, malformed JSON, valid JSON but not an object, or contain non-standard constants, the approval callback is not invoked and the call requires manual approval (OpenAI Agents SDK). When the system cannot safely inspect what the agent is about to do, the default is to stop and ask a person.
Adopt the same rule in your own gates. A gate that errors open, approving when the parser hiccups or the policy service times out, is worse than no gate because it manufactures false confidence. Every path that cannot produce a confident allow must route to a human or to a deny. LangGraph's guidance points the same direction from the operational side: side effects that run before an interrupt must be idempotent, because a paused-and-resumed run may execute them again (LangGraph). If your refund call is not idempotent, your approval gate plus one retry equals two refunds.
The interrupt mechanics are the easy part. The surrounding operations decide whether the gate works at 3 a.m. on a Friday.
Approval state must outlive the process. A gate that holds a paused run in memory loses every pending approval on deploy or crash. Serialize the paused state, store it server-side, and make resumption a first-class path, which is exactly what RunState serialization and LangGraph persistence exist for (OpenAI Agents SDK) (LangGraph).
Reviewers need context, not just a payload. "Approve send_email?" with a blob of JSON trains rubber-stamping. Show the rendered action in the reviewer's own tools: the email as it will be sent, the refund amount and customer, the diff of the config change. Include the agent's reason for the call too, because a plausible-looking action with a confused explanation is the clearest signal that something upstream went wrong. And set a service level on reviews: an approval queue nobody drains within an hour becomes the reason someone argues for removing the gate entirely.
Every decision needs an audit trail: who approved, who rejected, what was edited, and when. This connects to rollout discipline as well. As we covered in our post on AI agent canary deployment, retries around rollouts and rollbacks must be idempotent for exactly the same reason approval retries must be.
Finally, watch the approval rate as a metric. A gate that approves 99.8 percent of calls is a rubber stamp and should either be tightened or have its scope reduced to the calls that actually get scrutiny. OpenAI's own tooling has moved in this direction with managed approval surfaces, which we covered when the managed tool approvals feature in the OpenAI Agents SDK shipped.
The first failure is gating reads. Gating a database read teaches reviewers to approve reflexively while adding no safety; gate the write that follows instead. The second is a gate without an edit path. Rejecting forces the agent to guess again; editing lets the reviewer fix the arguments and resume, which both frameworks support (LangGraph). The third is forgetting that the gate is itself attack surface. An indirect prompt injection that reaches the approval payload can try to talk the reviewer into approving, so the rendered action shown to the human must be sanitized and treated as untrusted content, the same principle behind scoping AI agent tool permissions to the minimum each agent needs.
Human in the loop AI agents pause execution at defined points, usually before sensitive tool calls, and wait for a person to approve, reject, or edit the pending action before continuing. The pause is durable, so the run can wait minutes or days for a decision and then resume where it stopped.
Gate actions that are expensive or impossible to undo: external messages, payments and purchases, deletions, record changes in systems of record, permission changes, and production infrastructure changes. Reads and internal drafts rarely need gates.
Only if everything is gated. A well-scoped gate fires on a small percentage of tool calls, and per-call rules let routine low-risk actions proceed automatically. The pause is asynchronous, so other runs keep working while one waits for review.
The paused run stays serialized until it is resumed, expires, or is cancelled. Frameworks support long-running approvals with server-side state, so a deploy or crash does not lose the pending decision. You should also set an explicit expiry policy so stale approvals cannot be actioned days later without re-checking.
OpenAI Agents SDK: https://openai.github.io/openai-agents-python/human_in_the_loop/
LangGraph: https://docs.langchain.com/oss/python/langgraph/interrupts
Microsoft Learn: https://learn.microsoft.com/en-us/security/zero-trust/sfi/manage-agentic-risk
Ready to take the first step towards unlocking opportunities, realizing goals, and embracing innovation? We're here and eager to connect.