Human in the loop for AI agents: when a person must decide

An AI agent that only answers questions can be wrong at little cost. One that sends e-mails, changes records or pays cannot. Human in the loop is the usual answer: a person approves before the agent acts. Applied to everything, it turns that person into a button that says yes. Applied to nothing, it leaves the agent alone with your customers and your money. This guide explains where to put a person in an agent’s actions, which actions need one, and what makes an approval hold.

Guide by KeybanUpdated 8 min read

What is human in the loop for AI agents?

Human in the loop (HITL), for an AI agent, means that a person must approve some of the agent’s actions before they take effect. The agent prepares the action and stops. A person sees what it wants to do and approves or declines. Only then does the action happen.

The term comes from machine learning, where people label and correct data to train a model. With agents, the question changes: not how a model learns, but which of its actions it may carry out on its own.

In, on or out of the loop

There are three places for a person, and an agent usually needs more than one.

Who decides, and whenWhat it stopsWhat it costs
In the loopA person approves each action, before it happensA wrong action, before it takes effectA person’s time on every action, and an agent that waits
On the loopThe agent acts within rules; a person watches and can stop itAnything outside the rules, and a drift once someone sees itMistakes within the rules can happen before anyone looks
Out of the loopThe agent aloneOnly what the agent checks by itselfNothing, until something goes wrong

Most agents combine the first two: on the loop for routine actions, in the loop for the few that matter. An agent that buys a web search for half a cent needs nobody. The same agent paying a 400-euro invoice should wait for someone. The rules decide which is which, ahead of time.

Which actions need a person

  • Irreversible actions. Money sent, data deleted, a message gone to a customer: none of it can be taken back.
  • Actions with effects outside your systems. What reaches a customer, a supplier or the public carries your name.
  • Large amounts or a wide reach. A payment above a threshold, an e-mail to a whole list, a change to many records at once.
  • Anything new. A supplier, a recipient or a kind of action the agent has never used before.

The rest can usually run on the loop: actions that are reversible, internal, small and already familiar.

How much a person approves at once

An approval does not have to cover a single action. From the finest to the widest, a person can approve:

  1. One action: this payment, this e-mail.
  2. One run: this morning’s job, which the agent then carries out step by step within a set budget.
  3. A recipe: a procedure tested once for real, then published, that the agent repeats without asking each time.
  4. A standing approval: this agent may do this task without asking, until the task changes.

The wider the approval, the fewer the clicks, and the more the limits around it have to do the work.

What makes an approval hold

  • It is enforced outside the agent. An agent that asks “may I?” in a chat and can go ahead anyway has approved nothing. The action has to be blocked by a system the agent cannot bypass until the decision arrives. A “yes” can also be faked: a text hidden in a web page or an e-mail can pose as the user’s answer.
  • The agent cannot approve itself. The approval comes from a signed-in person, never from a credential the agent holds.
  • The people who approve are named in advance, and told when something is waiting for them.
  • They see what they approve: the action, the recipient, the amount and the agent that asks.
  • An approval has a deadline, and conditions are checked again at the moment of the decision. An approval given hours later should not let through an action whose terms have changed.
  • The agent waits without working around it. It does not split a payment to stay under a threshold, or try another route to the same result.

Too many approvals: the rubber stamp

A person asked to approve every web search soon approves without reading. The approval then looks like control and no longer is. To avoid it:

  • set the approval threshold at the amount you want to see before it is spent, not at zero;
  • let limits handle routine actions: a cap per payment, budgets, allowed suppliers;
  • approve a run or a recipe rather than each of its steps;
  • look at what was held during the first week, then adjust.

Setting those limits is covered in spending limits for AI agents.

How agent frameworks build it

  • LangGraph: interrupt() pauses the graph at any point, saves its state, and waits until the application resumes it with the person’s answer.
  • OpenAI Agents SDK: a tool marked needs_approval, always or by a rule checked on each call, pauses the run until the application approves or rejects the call.
  • Model Context Protocol (MCP): the specification states that there should always be a human in the loop able to deny tool calls, and asks applications to show confirmation prompts. Elicitation lets a server ask the user for input in the middle of a call.

These mechanisms pause the agent inside your application. On their own, they do not stop a payment made with a card or a key the agent holds: for money, the approval has to sit where the money is, in the wallet that signs.

Human in the loop for payments, with Keyban

Keyban’s Agent Wallet gives each agent its own wallet, and puts a person in the loop where you set it.

In the loop: the approval threshold

Above a wallet’s approval threshold, Keyban signs nothing. The payment waits in the Inbox, and the wallet’s operators are told by e-mail. They see the agent, the amount and the service or recipient, with a countdown for an x402 payment, and they approve or decline. Keyban prices the payment again at the moment of approval. Approving takes a signed-in person, never an API key, and the agent cannot approve its own payment.

Meanwhile the agent tells the user that a payment is waiting, and waits for the decision with wait_for_intent. In agent apps that can show an approval card, the user approves from the card.

Approving a job rather than each payment: missions

For a task the agent repeats, a mission sets the services it may pay and the most one run may cost. A person approves a paid trial, then publishes the mission. In on_demand mode, a person approves each run, and the agent then pays within the run without further clicks. A standing approval lifts the threshold for one wallet and one mission, until a new version is published.

On the loop: limits, history and pause

Below the threshold, the agent pays on its own, within the cap per payment, the day, week and month budgets and the allowed destinations. Every payment is recorded with the agent, the supplier, the amount and how it was approved, and the history can be exported to CSV. Pause refuses every payment of a wallet at once, until someone resumes it.

€1 on us at sign-up, no card needed. Free for three months, then top up in euros by card.

Questions

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

In the loop, a person approves an action before it happens. On the loop, the agent acts on its own within rules, and a person watches and can step in or stop it. Out of the loop, nobody intervenes. Most agents need the first two: on the loop for routine actions, in the loop for the few that matter.

Can an AI agent approve its own actions?

It should not be able to. The approval must come from a person, through a channel the agent holds no credential for. With Keyban, approving a payment takes a signed-in person; the agent’s key can only ask for a payment.

What happens if nobody approves in time?

The action should not happen. With Keyban, a held payment is never signed by default, and an x402 payment expires with the window the service allows, often a few minutes. The agent then has to ask again.

Does human in the loop slow an agent down?

For the actions that wait, yes: the agent waits for a person. That is why approval is best kept for the actions that matter, while limits handle routine ones without anyone.

Does the EU AI Act require human in the loop?

For high-risk AI systems, Article 14 requires that people can effectively oversee them while they are in use, including by interrupting them through a stop button or a similar procedure. It does not require approving every action. Whether an agent is high-risk depends on what it is used for.

How do I choose an approval threshold for payments?

Set it at the amount you want to see before it is spent, below the cap per payment. Start low, look at what was held during the first week, then raise it.

NEXT STEP

Keep a person on the payments that matter.

Add Keyban to your agent, sign in, set its cap. €1 on us at sign-up, no card needed. Free for three months, then top up in euros by card.

Open my agent’s account — €1 on us