Sep 10One Agent, Three Surfaces

What Is Human-in-the-Loop (for AI Agents)?

Human-in-the-loop (HITL) is the pattern where an AI agent pauses at defined points mid-run so a person can review, approve, correct, or choose before the agent continues. The agent proposes, the human decides, and the run resumes with that decision incorporated. It is how teams ship autonomous behavior without surrendering human judgment on consequential actions.

Agent runsHuman approvesRun resumes

Give an agent real capabilities, the ability to send, spend, delete, and deploy, and the question stops being whether it can act and becomes whether it should act unsupervised. Human-in-the-loop is the answer most production teams converge on: let the agent run autonomously through the routine work, and make it stop and ask at the points where a wrong action is expensive.

Why agents need a human in the loop

Four reasons recur across every serious deployment:

The point is not to slow the agent down everywhere. It is to place a small number of deliberate gates exactly where the cost of error is highest, and let the agent move at full speed between them.

The interrupt patterns

Nearly every human-in-the-loop interaction is one of five patterns. Each one pauses the run, puts a decision in front of a person, and resumes with the response.

What the interface has to do

Most writing about human-in-the-loop covers the policy half: which actions to gate and who approves them. The other half is what the interface must actually do when the agent pauses, and it decomposes into three jobs.

Render the interrupt. A raw text prompt in a chat window is the floor, not the pattern. A real interrupt carries structure: the tool being called, its arguments, the options on offer, the schema of the expected response. The interface should render that structure as purpose-built UI: an editable diff of the proposed arguments, option cards for a choice, a form for missing input. A reviewer who can see exactly what will execute makes faster and better decisions than one parsing a paragraph.

Collect the response. The response must be validated against what the agent expects and correlated with the right interrupt, because a run can raise more than one. A free-text reply is not a response; an approval, an edited payload, or a selection is.

Resume the run. This is the hard part, and it is a transport problem before it is a UI problem. The paused run lives on a server; the decision happens in a browser, possibly hours later, possibly after the user closed the laptop. The connection between agent and interface must be bi-directional, the agent’s state must be checkpointed at the pause, and the response must reach the paused run and continue it exactly where it stopped. Plain request-response cannot do this, which is a specific case of why agents break the request-response paradigm in general.

Human-in-the-loop vs. human-on-the-loop

The two terms describe different supervision postures. In the loop means the agent waits: the human decision is a blocking step in the run, and nothing consequential happens without it. On the loop means the agent proceeds on its own while a human monitors with the power to intervene: dashboards, alerts, and a halt button rather than a gate. In-the-loop fits low-volume, high-consequence actions; on-the-loop fits high-volume work where per-action approval would not scale and errors are recoverable.

Both are distinct from agent steering, where the human volunteers direction mid-run without being asked. In human-in-the-loop the agent initiates the pause; in steering the user initiates the correction. Mature agent interfaces support both.

The other meaning: HITL in model training

The same phrase names an older machine-learning practice: humans inside the training pipeline. Data labelers annotate examples, domain experts review edge cases the model is unsure about (active learning), and raters rank model outputs to train the reward models behind RLHF, reinforcement learning from human feedback.

Same words, different loop. Training-time HITL improves the model in general, before deployment, across all future users. Run-time HITL, the subject of this article, governs one specific action in one specific run at execution time. The two are complementary rather than competing: a team can fine-tune a model with human feedback and still gate its deployed agent’s irreversible actions.

How protocols carry interrupts

Because the pause spans a server-side run and a client-side decision, human-in-the-loop needs support from the protocol connecting them, the agent-user connectivity layer. AG-UI, the Agent-User Interaction protocol, treats interrupts as first-class run outcomes: a run ends with an interrupt outcome instead of a completion, and each interrupt carries an id, a reason (a tool call awaiting approval, required input, or a confirmation), a human-readable message, and optionally a schema describing the expected response and an expiry timestamp. The client resumes by starting a new run on the same thread with a response for every open interrupt.

Splitting the interaction across two runs is what makes the pause durable: the interrupted run has already checkpointed its state, so the decision can arrive seconds or days later, from the same device or a different one, and the audit trail records the proposal, the human’s response, and the executed result as separate entries. Agent frameworks map their own pause mechanisms onto this contract (LangGraph’s interrupt function is one example), and CopilotKit’s frontend hooks render the interrupt and collect the response on the application side of the same protocol.

FAQs

Does human-in-the-loop defeat the purpose of automation?
No. In a well-designed agent, interrupts gate the small set of consequential actions, not the work itself. The agent still does the research, drafting, and orchestration autonomously; the human spends seconds deciding instead of minutes doing. If an agent interrupts so often that supervising it costs more than doing the task manually, the fix is better interrupt criteria, not removing the human.
When should an agent interrupt instead of proceeding?
Interrupt when the action is irreversible or expensive to undo, when it is externally visible (messages sent, money moved, records changed), when the agent's confidence is low, or when policy or regulation requires sign-off. Proceed silently for read-only work and cheap-to-reverse internal steps. The threshold usually loosens over time as the agent earns trust on a given class of action.
Is human-in-the-loop the same as an approval workflow?
Approval is one interrupt pattern among several. A traditional approval workflow routes a fixed request between people. Agent human-in-the-loop is richer: the human can also edit the proposed action, choose among alternatives, supply missing input, or send the agent back with guidance, and the run resumes immediately with that response.
What happens if the human never responds?
The run stays paused, so the system needs an explicit policy: a timeout that expires the interrupt, a safe default (usually declining the action), or escalation to another approver. Protocol support helps here; AG-UI interrupts, for example, carry an optional expiry timestamp so a stale response fails cleanly instead of executing late.
Is human-in-the-loop the same as RLHF?
No. RLHF is training-time human-in-the-loop: people rate model outputs to train a reward model that shapes the model's general behavior. Agent human-in-the-loop is run-time: a person approves or corrects one specific action in one specific run. RLHF improves the model before deployment; run-time HITL governs a single consequential decision during execution.

Related concepts

Talk to an engineer about human-in-the-loop

Bring your use case. A CopilotKit engineer will walk you through how this applies to what you are building.