AI agents

How to Add a Human in the Loop to an AI Workflow

Antonio Evans8 min read

A robot carries a parcel along a conveyor belt and pauses at a gate, where a person inspects it and raises a green flag before it moves on.
Key points

Key points

  1. 1Human oversight comes in three strengths: approving individual decisions, monitoring and stepping in by exception, and setting policy and auditing outcomes over time.
  2. 2Put people where the stakes are high, the model is unsure, the action is irreversible or regulated, or the situation needs empathy, and let the rest run with logging.
  3. 3Build approval as a real pause in the workflow, with saved state, clear decision options and a recheck before the approved action runs.
  4. 4Review only works if reviewers see the evidence, have useful outcomes beyond yes or no, stay alert and feed their corrections back into the system.

What human in the loop means

IBM defines human in the loop (HITL) as a system "in which a human actively participates in the operation, supervision or decision-making of an automated system," with the goal of keeping the efficiency of automation "without sacrificing the precision, nuance and ethical reasoning of human oversight" (IBM, What is human-in-the-loop).

The phrase covers several levels of involvement, and choosing the right one is the first design decision. Databricks separates three (Databricks, What is human-in-the-loop):

LevelHuman roleTimingFits
In the loopApproves, corrects or rejects specific outputs before they take effectBefore the actionHigh-stakes, lower-volume decisions
On the loopWatches the system and steps in when something looks wrongAlongside the systemMedium-stakes, higher-volume decisions
Over the loopSets policy, audits outcomes and adjusts the systemPeriodicLower-risk or highly automated work with strong governance

Most real systems mix all three: direct approval for the riskiest actions, monitoring for routine ones and periodic audits for everything.

The stakes rise when AI moves from suggesting to acting. Databricks puts it plainly: a chatbot suggesting an email draft is one thing, while an agent sending the email, updating a customer record or triggering a downstream workflow "is something very different."

Decide where people belong

Review everything and you lose the point of automation. Review nothing and one bad call reaches a customer. Zapier's guide lists the situations where an agentic workflow should pause for a person (Zapier, Human-in-the-loop in AI workflows):

  • Low confidence or ambiguity. If the agent cannot confidently classify a request, it should escalate instead of guessing.
  • Sensitive actions. Anything that can cause data loss or permanent errors, such as overwriting customer records or deleting data.
  • Regulatory and compliance implications. For example, a lawyer reviewing contract language before anything is sent or signed.
  • Anything requiring empathy. Decisions that call for human judgment and accountability.

Zapier also suggests starting with more checkpoints and pulling back as the system proves itself, which is a sensible default for anything a customer can see.

The opposite list matters too. Databricks names cases where human review adds more problems than it solves: latency-sensitive systems that cannot pause, low-risk and high-volume tasks where review costs more than the occasional mistake, narrow tasks where the model outperforms reviewers, and outputs too complex or too fast for a person to evaluate, where review becomes "accountability theater rather than meaningful oversight" (Databricks).

A simple way to place each step of a workflow:

Low volumeHigh volume
High risk or irreversibleApprove every actionApprove by policy: only flagged or above-threshold cases
Low risk or reversibleMonitor and spot-checkAutomate with logging and periodic audit

Five patterns for human involvement

Zapier describes five practical patterns, which cover most needs (Zapier):

  1. Approval flows. The workflow pauses at a set checkpoint until a person approves or declines. Letting the reviewer edit the output, such as refining a drafted email, before approving it makes this far more useful than a yes or no button.
  2. Confidence-based routing. The agent proceeds on its own when confident and sends uncertain cases to a person. Zapier's example is an invoice system that routes missing or conflicting fields, unknown vendors and low-confidence extractions to an exception log for manual review.
  3. Escalation paths. When a request falls outside the agent's limits, such as a refund above its threshold, it routes the case to the right team with a note instead of retrying or stalling.
  4. Feedback loops. People review outputs at defined stages and their corrections shape later work.
  5. Audit logging. The workflow runs at full speed, and every action is recorded for later review. This is oversight without hard stops, suited to work where visibility matters more than real-time intervention.

The patterns combine. A typical support agent answers routine questions automatically with audit logging, routes unclear requests by confidence, escalates refunds above a limit and requires approval before closing an account.

Build approval gates into an agent

An approval gate in an agent is not a confirmation dialog. It is a pause in a running process that may last minutes or days, and the agent has to resume exactly where it stopped.

Pause and persist state. Scalekit's guide to approval gates describes the core pattern: when the agent reaches a write action, it serializes the pending tool call, emits an approval request and blocks, with its full state saved until a decision arrives. It notes that frameworks implement this differently, but the requirement is the same everywhere: execution must be resumable from persisted state (Scalekit, Human-in-the-loop tool calling). LangChain's documentation states it as a configuration rule: a checkpointer is required for human-in-the-loop (LangChain, Human-in-the-loop).

Mark which tools need approval. Microsoft's Agent Framework lets you set an approval mode on each function tool, and its sample code notes that the no-approval setting is used "for sample brevity" and tells developers to use the always-require setting in production (Microsoft, Tool approval).

Offer the right decisions. LangChain defines four options a reviewer can take on a proposed tool call (LangChain):

DecisionEffectExample
ApproveRun the tool with the agent's argumentsSend the drafted email as written
EditChange the arguments, then runCorrect the recipient before sending
RejectSkip the call and tell the agent whyDeny a file deletion with a reason
RespondReturn the person's reply as the tool resultAnswer an "ask the user" question

Two cautions from the same documentation are worth keeping. Use reject, not respond, to deny an action with side effects, because the model may read a response as a successful result. And edit arguments conservatively, because large changes can make the model rethink its approach and act unexpectedly.

Gate by policy, not by tool alone. Not every call to a tool deserves the same treatment. LangChain supports conditional interrupts that pause only when the arguments meet a condition, such as a file write outside the workspace. Scalekit describes a policy check at the moment of each call that returns allow, block or escalate based on who is asking, which resource is affected and which environment it runs in. Its example: developers may merge to feature branches automatically, but merges to the main branch escalate to a person (Scalekit).

def approval_policy(call, user, env):
    if call.tool == "issue_refund":
        if call.args["amount_cents"] > user.refund_limit_cents:
            return "ESCALATE"
        return "ALLOW"
    if call.tool == "delete_account":
        return "ESCALATE"
    if env == "production" and call.tool in WRITE_TOOLS and not user.can_write:
        return "BLOCK"
    return "ALLOW"

Recheck before executing. Time passes between request and approval. Scalekit points out that credentials can expire or be revoked during the wait, so the resume path should check them before calling the tool rather than failing halfway (Scalekit). The same applies to the request itself: confirm it has not changed or been cancelled since it was approved.

Design the review queue

An approval gate is only as good as the screen and process behind it. Autommate's guide to running a review queue for a service desk offers concrete rules (Autommate, Human-in-the-loop AI review queue).

Describe the actual decision. The reviewer is not approving "the AI." They are deciding whether a specific action should happen under a specific policy. Show the original request, the proposed action, the relevant source records and the reason it needs review. Separate facts retrieved from systems from the model's interpretation, and make missing facts visible instead of letting a fluent summary paper over them.

Give reviewers more than approve and reject. A binary choice forces people to pick the nearest answer when the real problem is missing information. Autommate recommends separate outcomes for rejection with a reason, a request for clarification that names the missing input, and a hold that states what must change.

Agree the operating rules for each queue:

RulePrevents
Only named approvers may decideA support role mistaken for business authority
A named deputy covers absencesRequests stuck in an absent person's inbox
Unanswered requests expire into a held stateSilence becoming approval
A changed request invalidates an earlier approvalAn approval reused for a different action
The system rechecks validity before actingA stale approval triggering an unauthorized change

Plan the workload. Estimate how many items will reach review, how long a proper decision takes and how much reviewer time exists. Autommate warns against solving a backlog by quietly broadening who can approve.

Test it on a bad day. Confirm that two reviewers cannot trigger the same action twice, that an expired approval link cannot revive a cancelled request, that a rejected proposal cannot slip through a retry path and that a missing response shows up as a visible exception, not a success.

Keep the review meaningful

Adding a person does not guarantee oversight. Databricks lists the ways human review fails (Databricks):

  • Vigilance decay. People reviewing long streams of mostly correct outputs start approving too quickly or trusting the model by default. Rotating reviewers, limiting batch sizes and auditing approval patterns help.
  • Inconsistent judgment. Different reviewers, or the same reviewer on different days, decide similar cases differently. Clear guidelines and regular calibration reduce the noise.
  • The wrong human. The person in the loop may not be qualified to make the decision. Route each queue to people with the authority and expertise for that decision.
  • Opaque output. If reviewers cannot understand what the model did and why, approval becomes a rubber stamp.
  • Wrong feedback. People make mistakes and carry biases, and systems learn from that feedback either way.

Measure decision quality, not only speed. Autommate suggests sampling decisions that were later reversed, requests returned for missing evidence and cases where the executed action differed from what the reviewer approved (Autommate). A queue that approves everything in seconds may be the least safe one you have.

Close the loop

The "loop" in human in the loop should feed back into the system. Zapier notes that with feedback loops in place, "human corrections become training data," making the system more reliable over time (Zapier).

Concrete ways to close it:

  • Turn every rejection and edit into a test case in the agent's evaluation set, with the reviewer's corrected outcome as the expected result.
  • Track override rates by action type. A high rate points to a prompt, tool or policy that needs fixing. A rate near zero over a long period may mean a gate can move from approval to audit logging.
  • Review the escalation reasons. Repeated clarification requests often mean the intake form or the agent's questions need work.
  • Revisit thresholds. Confidence and value thresholds that made sense at launch should change as evidence accumulates.

Keep a complete record throughout: what the agent proposed, who reviewed it, what they decided, what actually ran and when. That record is what lets you audit the system, explain a decision to a customer and show that the human in the loop was more than a formality.

FAQ

FAQ

What is the difference between human in the loop and human on the loop?

In the loop means a person approves or corrects specific outputs before they take effect. On the loop means a person monitors the system as it runs and intervenes by exception. Most systems use both: approval for the riskiest actions and monitoring for the rest.

Which actions should always need human approval?

Actions that are irreversible, regulated, high in value or visible to customers in ways that are hard to undo, such as deleting data, issuing large refunds, signing contracts or closing accounts. Start with more approval gates and remove them as evidence shows the agent handles a case reliably.

How do I stop human review from slowing everything down?

Only route the cases that need it. Use confidence thresholds, value limits and policy checks so routine, low-risk work runs automatically with logging. Plan reviewer capacity and set expiry rules so requests do not sit indefinitely.

Can the model's confidence score decide when to escalate?

It can be one input, but not the only one. Models can be confidently wrong, so combine confidence with rules based on the action, the amount and the data involved. Treat a confidence indicator as a reason to look closer, never as authorization.

How do I make sure reviewers actually review?

Show them the evidence behind each proposal, not only a summary. Limit batch sizes, rotate reviewers and audit a sample of approvals against later outcomes. Track reversals and corrections so you can see whether review is catching problems.

Sources

Sources

  1. https://www.ibm.com/think/topics/human-in-the-loop
  2. https://www.databricks.com/blog/human-in-the-loop
  3. https://zapier.com/blog/human-in-the-loop/
  4. https://www.scalekit.com/blog/human-in-the-loop-tool-calling
  5. https://docs.langchain.com/oss/python/deepagents/human-in-the-loop
  6. https://learn.microsoft.com/en-us/agent-framework/agents/tools/tool-approval
  7. https://www.autommate.com/resources/blog/human-in-the-loop-ai-service-desk-review-queue/
About the author

About the author

Antonio Evans
Antonio Evans

Antonio Evans is the founder of Quanta Intelligence and a fractional CTO who builds HIPAA-ready AI systems for health and life-science companies. Before that he was technical co-founder of FriendsEAT for twenty years, CEO of Socialdraft, and a data engineer at IBM. Antonio lives with his dog Santino in Lisbon, Portugal.

All articles