Human-in-the-loop (HITL)
A design in which an AI agent pauses at defined points so a person can approve, reject, edit or add input before the agent continues.
Human-in-the-loop (HITL) is a design pattern in which an AI agent pauses at defined points so a person can approve, reject, edit or add to what it is about to do, and the agent then continues from where it stopped.
How frameworks implement it. The mechanics are similar everywhere: pause, save state, show the request to a person, resume with the decision.
- OpenAI Agents SDK: a tool marked
needs_approvalstops the run and returns an interruption. The application can serialize the run state, recordapprove()orreject()for each pending call, and resume, even in another process. - LangGraph:
interrupt()saves the graph’s state through a checkpointer under a thread ID. The caller resumes withCommand(resume=...), and the interrupted node runs again from its start. - Google ADK: Tool Confirmation, an experimental feature, pauses a tool for a yes or no, or for structured input, before it runs.
Where to put the person. Anthropic describes agents pausing for human feedback at checkpoints or when they hit a blocker. Good checkpoints are actions that are hard to reverse or costly, policy exceptions, and anything outside the authority a person has granted. Each pause adds delay and asks for someone’s attention, so checkpoints should be deliberate.
Between agents. In A2A, the person can sit on either side. The specification’s in-task authorization section gives human approval before a destructive action as an example of authorization an agent may need. The remote agent can move the task to TASK_STATE_AUTH_REQUIRED and let the client obtain it, for instance by asking its own user. TASK_STATE_INPUT_REQUIRED covers a missing detail or a choice the client must make. Because A2A tasks keep their state, the exchange resumes on the same task once the person answers.
Neighbouring terms. Guardrails block or flag automatically, where HITL asks a person. Auth-required and input-required are the A2A task states that carry a human decision across organizations.
Sources
- OpenAI Agents SDK documentation: Human-in-the-loop (accessed )
- LangChain documentation: Interrupts (LangGraph) (accessed )
- Agent Development Kit documentation: Get action confirmation for ADK tools (accessed )
- Anthropic: Building effective agents (19 December 2024) (accessed )
- A2A Protocol Specification, section 7.6: In-Task Authorization (accessed )