4 min di lettura
What human-in-the-loop means for automations and AI agents
Human-in-the-loop is not a person watching every step. It is a deliberate pause in front of the few actions that are expensive to get wrong, with a clear question, a named person and an answer your code can trust.
Dal team di TaskToHuman
- agenti IA
- approvazioni
"Human-in-the-loop" gets used for almost anything: labelling training data, reviewing a model's output, a person approving a refund. For teams that run automations and AI agents in production, it has a narrower and more useful meaning: a point in an automated process where the process stops, a specific person makes a decision, and the process continues based on that decision.
That definition has three parts, and each one matters.
The process stops
The automation does not carry on while someone "keeps an eye on it". It reaches a step it is not allowed to take alone, and it waits. Nothing irreversible happens until the answer arrives.
This sounds obvious, but many setups get it wrong. A notification that says "the agent just refunded €400, check it" is not human-in-the-loop. It is human-after-the-fact. Monitoring and alerts are useful, but they only help with actions you can undo. For actions you can't undo, such as money leaving, data being deleted, a message reaching a customer or a release going to production, the check has to come before the action.
A specific person decides
"Someone on the team will look at it" is how approvals get lost. A loop needs an owner: the one person who is asked first, and who knows the question is theirs. It also needs a plan for when that person doesn't answer: a reminder, then a backup, then a deadline after which something defined happens.
The person also needs enough context to decide in seconds. A good request answers three questions on one screen:
- What exactly will happen? "Refund €249 to order #4821", not "Approve request 7731".
- Why is this being asked? The rule that triggered it, or the agent's reasoning: "Second claim from this customer this month."
- What can I do? Approve, reject, or correct a value and approve. A comment field for anything that doesn't fit.
If the person has to open three other tools to understand the request, they will postpone it, and the loop stalls.
The process continues based on the decision
The answer has to get back into the automation reliably. That means a machine-readable result (approved, rejected, edited, expired), delivered to the waiting process in a way it can verify, and handled exactly once.
This is the part that is easy to underestimate. Real systems retry. Networks time out. A callback can arrive twice, or not at all. Your process needs to know the decision really came from the approval system, not from someone who guessed the URL, and it needs a defined path when no decision comes.
Why agents make this more pressing
Rule-based automations are predictable: if the refund is above €200, ask. AI agents are different in two ways.
First, they act on judgement, and their judgement is sometimes confidently wrong. An agent that drafts a reply, decides a customer deserves a credit and issues it can make a mistake no rule anticipated.
Second, they are good at preparing work. An agent can gather the order history, draft the reply, propose the amount and explain why. That makes the human's job small: read a clear proposal and say yes, no or "yes, but €25 instead of €40".
So the useful pattern for agents is: let the agent do the preparation, and keep the final, irreversible step behind a person. The agent calls a tool that creates an approval request with its proposal and reasoning, then waits. If the person approves, the agent continues with the approved, possibly edited values. If they reject, the action never runs, and the agent can tell the user why.
A sensible split looks like this:
- Reading data, searching, drafting and summarising: the agent does it on its own.
- Actions with a small, bounded cost: the agent does it, within a limit you set.
- Actions above that limit, or that can't be undone: the agent proposes, a person approves.
Where to put the loop
You don't want a person in front of everything. That just moves the bottleneck and teaches people to click "approve" without reading. Put the loop where three things are true:
- The action is hard or impossible to undo. Payments, deletions, messages to customers, production changes.
- A wrong action costs more than a short wait. A refund that waits an hour is fine; a fraudulent payout is not.
- A person can actually judge it quickly. If the decision needs an hour of research, it is a task for a ticket queue, not an approval.
Then make the loop cheap to answer: one clear question, the facts on one screen, an answer from any device, and no account to create for an occasional approver.
What it looks like in practice
In practice, a human-in-the-loop step is a small contract between your code and a person:
- Your code sends a request with the question, the facts, who should answer and how long it may wait.
- The person is reached where they will see it, reminded if they don't answer, and replaced by a backup if they still don't.
- The decision comes back to your code signed, with who decided, when and any comment or corrected values.
- If nobody decides in time, your code is told that too, and follows the path you defined.
That is what TaskToHuman does: your code or workflow creates a task with one API call or a webhook, and gets the decision back as a signed callback. Whether you use it or build your own, the principles are the same. Pause before the irreversible step, ask one named person a clear question, and make sure the answer gets back to your code exactly once.