
TL;DR
|
Human-in-the-loop, often shortened to HITL, describes AI systems where a person checks and approves the AI's work at defined points. The AI does the work. A human decides whether it goes further.
As AI agents take on real software work, such as writing code and opening pull requests, where to keep humans involved has become a practical question for every engineering team. This guide explains the term, where approvals belong, and how to design them so they actually help.
Key takeaway: the terms describe how closely people control an AI system, from approving every key step to not being involved at all.
| Level | What it means | Example in software development |
|---|---|---|
| Human-in-the-loop | A person must approve before the AI continues | An agent writes code, and a developer approves it before it's merged |
| Human-on-the-loop | The AI acts on its own, and a person monitors and can step in | An agent fixes minor issues automatically, while a team watches a dashboard |
| Human-out-of-the-loop | The AI acts alone, with no routine human oversight | An agent updates dependencies and merges them without review |
Many teams use a mix, with tighter control where mistakes would be costly.
Key takeaway: put approvals where decisions are hard to reverse or costly to get wrong.
| Point in the workflow | What the human checks | Why it matters |
|---|---|---|
| Before the work starts | The agent's plan or understanding of the task | Catches a misread task before time and money are spent |
| After code is written | The changes themselves, in a pull request | Catches bugs, security issues, and code that misses the point |
| Before merging | That tests pass and the change fits the codebase | Merged code becomes everyone's problem |
| Before deploying to production | That the release is safe to reach users | Production mistakes affect customers |
| Before touching sensitive systems | Changes to infrastructure, permissions, or data | These are the hardest mistakes to undo |
Key takeaway: AI agents are fast and often right, but they can be confidently wrong, and someone has to be accountable.
Key takeaway: good approvals are few, well-placed, and give reviewers what they need to decide.
| Principle | What it looks like |
|---|---|
| Approve at decision points, not every step | Gate the plan and the final change, not every intermediate edit |
| Show the reviewer what matters | The change, the reasoning, the test results, and what the agent touched |
| Make ownership clear | Each approval goes to a team or person with the knowledge to judge it |
| Keep a record | Log who approved what, and when |
| Adjust over time | Loosen gates where agents prove reliable, and tighten them where problems appear |
Here's how one gated run might look. A developer files an issue asking for a limit on login attempts. The agent reads the code and proposes a plan: which files it will change, how, and how it will test the result. Then the run pauses.
A reviewer from the team that owns sign-in reads the plan and notices it would also change the password reset page, which nobody asked for. She sends it back with a note. The agent revises the plan, she approves it, and only then does the agent write code. It finishes by opening a pull request with the change, its reasoning and the test results, and the team reviews and merges it as usual.
Afterward, the record shows who approved the plan, when, and what changed after the first review.
Key takeaway: too many approvals is as risky as too few, because people stop looking.
| Mistake | What happens | How to avoid it |
|---|---|---|
| Rubber-stamping | Reviewers approve without really checking, because there are too many approvals or too little context | Fewer, better-placed gates, with the right information attached |
| Approvals with no context | The reviewer can't tell what the agent did or why | Show the plan, the changes, and the test results |
| Unclear ownership | Approvals wait in a queue nobody watches | Route approvals to a specific team |
| No record | Nobody can say later who approved a change | Keep an audit trail of approvals |
| The same gates everywhere | Low-risk work is slowed down, and high-risk work isn't checked enough | Match the gates to the risk |
Key takeaway: in Upsun Dispatch, a human gate in the Issue to Code workflow means nothing is coded until a person approves the plan.
Upsun Dispatch™ is a governed software factory where teams and AI agents ship together. Its human gates put human approval into AI workflows:
| What to know | In Upsun Dispatch |
|---|---|
| What a gate does | In Issue to Code, the run pauses once the agent has drafted a plan. Reviewers can approve it, reject it or send it back for revision, and nothing is coded until it's approved |
| Who approves | Anyone on the team with approval rights can pick up a waiting approval, in the tool where the issue lives: GitHub, Jira or Linear |
| Turning approvals on | The gate can be switched on or off for the whole organization, with exceptions for individual repositories |
| Cost while waiting | Sandboxes don't bill while a run waits for approval. A plan that isn't approved expires after seven days |
| Record | Every run's record logs each plan decision, with who made it and when |
Upsun Dispatch workflows cover tasks such as Code Review and Issue to Code, and connect to tools such as GitHub and Jira. The workflows page has the full list. Our guide What is a software factory? explains how human gates fit alongside workflows, sandboxes, and audit trails.
You can try Upsun Dispatch with free AI usage (20 agent-minutes a day, no API key or card needed), or read the Upsun Dispatch announcement.
That a person reviews and approves an AI system's work at defined points before it continues.
Human-in-the-loop requires approval before the AI continues. Human-on-the-loop lets the AI act on its own while a person monitors and can step in.
It adds review time at chosen points. Placed well, it prevents costly mistakes, which saves more time than it takes.
At least before merging and before deploying to production. Approving the agent's plan before work starts also catches misunderstandings early.
Approving without really checking, often because there are too many approvals or too little information to judge them.
For some AI systems, yes. The EU AI Act requires human oversight for high-risk AI systems. Many organizations also require human review of code changes in their own policies.