HumanInTheLoopMiddleware in LangChain, or with the interrupt_on parameter in Deep Agents. The middleware pauses in one of two modes:
- Per-call: One pause for each tool call that needs review.
- Batched: One pause per model turn, covering every tool call in that turn. Batched mode is the current default.
Per-call mode requires
langchain>=1.4.6. Deep Agents uses batched mode.Follow an approval from pause to resume
Every approval follows the same steps in either mode:- The model proposes one or more tool calls.
- The middleware checks each call against your
interrupt_onpolicy. Calls that need review pause the agent with an interrupt. - The checkpointer saves the agent’s state, so the run can stop and resume later, even in another process.
- Your application shows the pending calls to a reviewer and collects a decision for each one.
- You resume the agent with a
Command(resume=...). The middleware applies each decision, and the agent continues.
The examples on this page use an agent with three tools.
write_file allows every decision type. execute_sql allows only approve and reject. read_data runs without review. In one turn, the model calls all three.
Review each tool call separately
In per-call mode, each tool call that needs review pauses on its own as it starts: Each interrupt value describes one call and hastype: "tool_approval". The execute_sql interrupt looks like this:
response_schema, a JSON schema of the answers that call accepts. For execute_sql, the schema allows approve and reject. For write_file, it also allows respond and edit. The edit branch includes write_file’s own argument schema. Clients can render a form from the schema instead of hardcoding the decision types. The LangChain guide shows the schema for each decision type.
You answer each interrupt with one decision, keyed by the interrupt’s ID:
Review a whole turn at once
In batched mode, the middleware pauses once after the model responds, before any tool runs.read_data waits for the review too, even though it is not gated. One interrupt lists every gated call in action_requests, and each call’s allowed decisions in a separate review_configs list:
action_requests:
response_schema. The middleware checks each decision only when it applies it, after LangGraph has saved the answer.
Compare batched-mode problems
Batched mode matches answers to calls by position, and checks each answer only after saving it. Each row shows a problem the example agent hits in batched mode, and how per-call mode avoids it:Choose an interrupt mode
Use per-call mode for new agents. LangChain plans to make it the default in the next major release.
Keep batched mode while your approval UI reads the batched format, such as one built with the
useStream approval pattern.
Per-call mode also changes how middleware order and multi-answer resumes behave. Before you switch, read Order middleware for per-call review and Resume each call by ID.
See also
- Human-in-the-loop in LangChain: configure the middleware and answer each decision type.
- Human-in-the-loop in Deep Agents: approvals for deep agents and their subagents.
- Define an interrupt response schema: how LangGraph checks resume values.
Connect these docs to your agent of choice via MCP for real-time answers.

