AELSHA™ Nehemvix Start a free guide

Human in the loop for AI agents

Human in the loop means the agent stops and waits for a person at a defined point; human on the loop means it carries on while a person watches and can step in. Nehemvix uses both, and this article shows where each sits in its code.

What is human in the loop (HITL)?

Human in the loop (HITL) is a design in which an AI system cannot finish a task without a person acting at a set point. The system prepares something, such as a plan, a draft or a cost, then stops. A person approves, edits or rejects it, and only then does the system continue. If nobody answers, nothing happens.

In AI agents, HITL matters most at the points where an action is hard to undo: spending money, sending data to someone new, deleting something, or acting in another person's name. An agent can do the reading, planning and drafting on its own, and still leave those few decisions to a person.

Human in the loop vs human on the loop

The two phrases differ by one word and by who has to act.

Human in the loop Human on the loop
Who acts at the decision A person, every time The system, by rules a person set
If the person is away The task waits The task carries on
The person's role Approve or reject Watch, and stop or change course
Suits Costly or irreversible steps Frequent, low-risk, reversible steps

A third arrangement, human out of the loop, means the system acts with no person watching. It suits only work where a mistake costs little and is easy to undo.

Most real agents mix the first two. The design question is not "how autonomous should this be?" but "at which exact steps must a person act, and at which is it enough that they can see and stop?"

Where Nehemvix puts a person in the loop

Nehemvix turns a Git repository into a documentation guide with the person's own model key, so their money and their code are at stake. Each of these points stops the work until a person acts.

1. Approving the cost. After reading the repository and before any model call, the pipeline's estimate node computes a low, likely and high cost and stops the LangGraph run:

decision = interrupt({"type": "approve_estimate", "estimate": est})
if not decision.get("approved"):
    raise stages.JobCancelled()

The run continues only when the app sends the person's decision back, carrying the approval and the spending cap. Estimate and cap LLM costs shows how close the estimates came: on 3 November 2026 a three-audience guide of a 46-file repository was estimated at $0.036 to $0.077 and cost $0.0459.

2. Consent for each provider and model. Repository text goes only to the providers, models and endpoints the person agreed to. A consent check on the server refuses a new one with 400 consent_required and names it; when the person agrees, the consent is recorded on the job and in the audit log. The same rule covers switching a paused guide to another model and asking a question on a model the guide has not used.

3. A pause when a model's limit runs out. When every connection is out of quota, the job does not quietly pick another provider. It pauses, with the status paused_quota, and records what ran out, when it resets and what is already done. The person then waits, switches model, which needs consent, or finishes with what is done. On 15 October 2026 a Gemini free-tier job paused on its first call with a reset more than 14 hours away; the person switched it to gpt-6-luna and it finished at a grounding score of 98 for $0.0016.

4. Calls whose outcome is unknown. If the server dies during a model call, that call may or may not have been billed. It is marked OUTCOME_UNKNOWN, keeps counting against the cap, and is never sent again on its own. Resuming is the person's explicit choice.

5. AI assistants cannot start a guide. Assistants connected over MCP or A2A get seven read-only tools. The one that sounds like an action, prepare_guide, only builds a link to the app with the repository filled in. The rule fits in three words: agents cannot consent. A person chooses the model, gives consent and approves the cost in the app. On your own machine, nehemvix mcp can let an agent start a guide only when the person who configures it sets a spending ceiling, and the agent must still give a cap within it.

6. Connecting an assistant at all. When Claude or another MCP client connects by sign-in rather than a pasted token, Nehemvix sends the browser to its own consent screen. It shows which app is asking and where the answer will be sent, and the person approves or denies. The assistant then gets a one-hour, read-only token.

Where a person is on the loop

Stopping for everything would make the product tiresome, so some decisions follow rules the person set in advance, and the person can watch and intervene.

How to choose for your own agent

  1. List the irreversible actions. Spending, sending data to a new party, writing to someone else's system, deleting. Each one gets a person in the loop.
  2. Turn repeated approvals into rules. If people approve the same small thing every time, let them set a limit once and move that step on the loop.
  3. Make the stop a real stop. An interrupt that a retry or a restart can skip is not a gate. In Nehemvix the approval route checks the interrupt's type, so a quota pause can never be resumed as if it were a cost approval.
  4. Never let an agent approve for a person. An outside agent can prepare the decision; a person makes it.
  5. Record every decision. Who approved what, when and at which limit, so the loop can be checked afterwards.

Step 2 is how an agent earns more autonomy one step at a time, and our article on AI agent autonomy tiers covers when a repeated approval can become a rule.

What a person sees at each pause is in limits and pauses, and connecting an assistant is in connect an AI assistant. For the whole system as an agentic AI example, see one production agent, measured, and for resuming after a pause, pause and resume an agentic AI pipeline.

Learning this to build your own agent? AELSHA™ can help you design it.

Try it on a repository you know

Free to use with your own model key.

Start a guide