Rifty Notes
Glossary

Human-in-the-loop

Human-in-the-loop is a control pattern where an agent pauses at a defined decision point and waits for a person to approve, edit, or reject its proposed action before execution, typically gating irreversible or high-blast-radius operations so a confident but wrong plan cannot run unchecked.

How it works

Human-in-the-loop (HITL) inserts a blocking checkpoint into the agent loop. The agent runs freely until it reaches an action the harness has marked as gated; there it stops, serializes its proposed action into something a person can read, and waits. The loop does not advance until a human resolves the gate.

A clean HITL gate has four parts:

  1. A trigger — a rule that decides which actions require sign-off (an action class, a blast-radius threshold, a confidence signal, or a specific tool).
  2. A proposal — the exact action rendered for review: the command, the diff, the recipient, the amount. Not a summary the agent wrote about itself.
  3. A decision — approve, reject, or edit-then-approve, ideally with the edited action becoming the one that executes.
  4. A record — who decided, when, and on what version of the proposal.

The part people skip is that the proposal must be the real thing, not the agent's description of it. An agent that says "I'll clean up the temp files" and then runs rm -rf on the wrong path passed a review of its narration, not its action. Gate on the serialized action, and make the approved artifact the exact thing that runs.

Why it matters in an agent harness

HITL is how you convert an autonomous system into a bounded one at the exact points that matter. Most agent actions are cheap and reversible; a few are neither. A blanket "ask before everything" gate destroys autonomy and trains the operator to rubber-stamp. A blanket "never ask" gate means a single confident hallucination reaches production.

The leverage is selective placement. You spend the operator's attention only where an action is irreversible or its blast radius is large: deletes, payments, outbound messages, schema changes, deploys. Everywhere else the agent proceeds and you rely on observability and rollback instead of pre-approval.

Done this way, HITL gives you three concrete properties. Containment: a wrong plan stops at the gate instead of executing. Legibility: the review point is the one place the system is forced to make its intent inspectable in the operator's terms. Attribution: every gated action carries a decision record, so you can reconstruct who authorized what. These are the same properties you want from permissions and audit logging — HITL is where a human supplies the authority a static policy can't encode.

Human-in-the-loop vs a deterministic guardrail

Both stop bad actions, but they answer different questions. A guardrail encodes a rule you already know; HITL supplies judgment you can't pre-write. Use the guardrail when the boundary is knowable in advance, and HITL when the action needs a human's contextual call.

Deterministic guardrailHuman-in-the-loop
DecidesAutomatically, by ruleA person, at runtime
LatencyNoneBlocks until answered
Best forKnown, enumerable violationsNovel, contextual, high-stakes calls
Failure modeSilent gap when reality exceeds the ruleReviewer fatigue, rubber-stamping

In practice they compose. A guardrail hard-blocks the clearly forbidden, HITL gates the ambiguous-but-consequential, and everything else runs. If you find yourself sending routine, rule-shaped decisions to a human, promote them to a guardrail.

The Rifty take

We treat human attention as the scarcest resource in the loop, so we gate on irreversibility and blast radius, not on uncertainty in general. A gate that fires constantly is worse than no gate, because it manufactures the rubber-stamp reflex it was meant to prevent. We accept that a well-placed HITL point adds latency to a handful of actions; that is the price of keeping a wrong plan from executing unchecked, and it is cheap next to an unwound production mistake.

Common failure modes

  • Reviewing narration, not the action. The human approves the agent's summary while the executed command differs. Gate on the serialized action and run exactly the approved artifact.
  • Alert fatigue. Too many low-stakes gates train reflexive approval. Every gate that always gets approved should become a guardrail or be removed.
  • Approving a stale proposal. The world (or the plan) changes between proposal and execution. Bind the approval to a specific version and re-gate if it drifts.
  • The gate that can be skipped. If the agent can reach the underlying tool without passing the checkpoint, the gate is decorative. Enforce it at the permission boundary, not by prompt instruction.
  • No decision record. Without who/when/what, you have oversight in the moment but nothing to reconstruct later. Log the decision as a first-class artifact.

Frequently asked questions

When should an agent action require human-in-the-loop approval?

Gate an action when it is irreversible or its blast radius is large: deletes, payments, outbound messages, deploys, or schema changes. Leave cheap, reversible actions ungated and rely on observability and rollback instead. Gating on general uncertainty rather than consequence produces reviewer fatigue and reflexive rubber-stamping.

How is human-in-the-loop different from a guardrail?

A guardrail encodes a rule you can write in advance and enforces it automatically with no latency. Human-in-the-loop supplies runtime judgment you cannot pre-write, blocking until a person decides. Use guardrails for known, enumerable violations and HITL for novel, contextual, high-stakes calls; compose both in one harness.

What is the most common way human-in-the-loop gates fail?

The most common failure is reviewing the agent's narration instead of its actual action. The human approves a friendly summary while a different command executes. Always serialize the real action — the exact command, diff, recipient, or amount — and make the approved artifact the precise thing that runs.

Does human-in-the-loop conflict with autonomous operation?

No, when placed selectively. HITL converts an autonomous system into a bounded one only at high-consequence points, letting the agent run freely everywhere else. A blanket ask-before-everything gate destroys autonomy and trains rubber-stamping; a well-scoped gate preserves speed while containing the few actions that are costly to undo.

Where should a human-in-the-loop gate be enforced?

Enforce the gate at the permission boundary, not through prompt instructions. If the agent can reach the underlying tool without passing the checkpoint, the gate is decorative and will eventually be bypassed. Bind approval to a specific action version so a stale proposal cannot execute after conditions change.

Related glossary terms.

Human-in-the-loop