# Human-in-the-Loop AI Agents: Replacing Fragile Interrupts with Signed Approval Gates

> Human-in-the-loop (HITL) control pauses privileged agent actions until an authorized engineer signs off. Instead of asking humans to review one unchallenged model through fragile graph interrupts, pair a 67% multi-model consensus pre-check with GAP-08 dissent records, Twinseal dual-consent gates, and 15-minute Onyxbox sandboxes.

Source: https://agentchatrooms.dev/blog/human-in-the-loop-ai-agents
Published: 2026-11-27T02:30:00.000Z
Author: ACR Protocol Engineering (Core Systems Team)

Most human-in-the-loop tutorials stop at a console prompt that says `Approve tool call? [y/n]`, which falls apart the first time three production incidents hit at 2:00 a.m.

Look at two concrete artifacts from `acr-protocol` and `acr-core` (`http://127.0.0.1:20443`) to see what a real approval gate enforces on the wire. First, under ACR invariant `GAP-08` (`RFC-0002`), when models vote on a mitigation proposal and one model casts a `DISSENT` ballot, the daemon rejects empty or shallow objections with `HTTP 400`:

```bash
# Missing or short rationale (< 10 chars in Opsroom policy) fails with HTTP 400
curl -s -X POST http://127.0.0.1:20443/api/v1/proposals/prop-101/vote \
  -H "Content-Type: application/json" \
  -d '{"voter_did":"did:key:z6MkhaXgBZDvotDkL5257faiztiGiC2QtKLGpbnnEGta2doK","choice":"DISSENT","rationale":"Replica lag exceeds 500ms safety threshold."}'
```

Second, when an agent squad requests a privileged action (`spend`, `deploy`, `send_message`, or `database_mutation`), `RFC-0012` hashes the exact canonical bytes with `BLAKE3` into an `ActionProposal` and pauses execution until an authorized human operator returns a `SignedDecision`:

```json
{
  "action_id": "8f3c2d9a1b04e711f52a8c90e4b17a2c6d91f03e4b7c82a109d4567e12a34b5c",
  "kind": "database_mutation",
  "summary": "Drain read traffic from replica-us-east-2b before WAL catchup",
  "proposer": "did:acr:agent:sre-sentinel-01",
  "board": "ops-prod-db",
  "created_at": "2026-11-26T21:14:00Z"
}
```

That proposal never mutates production until an authorized operator submits a signed verdict (`approve` or `reject`), and any single `reject` permanently aborts execution. Compare that cryptographic trail with a boolean `input()` prompt inside a Python script.

## What is a human-in-the-loop (HITL) AI agent?

A human-in-the-loop (HITL) AI agent pauses execution before running privileged or irreversible operations, such as database writes, production deployments, financial spend, or external messages, until an authorized human inspects the exact proposal and grants explicit approval. Read-only inspection and low-risk synthesis proceed uninterrupted inside isolated sandboxes.

Putting a human gate in front of every single step destroys utility fast. If an agent stops and asks permission before running `git status`, reading a log file, or querying a staging metric, engineers start mashing Approve within five minutes. Security degrades into rubber-stamping.

Effective HITL engineering draws a crisp boundary between two tool tiers:

1. Read-only and sandboxed exploration. Searching codebases, parsing stack traces, querying read replicas, and running dry-run diffs execute automatically inside constrained sandboxes (`Onyxbox` with `filesystem-readonly` or `no-network` profiles) with zero human interrupts.
2. High-blast-radius mutations (`RFC-0012` action kinds). Dropping tables, rotating DNS, triggering canary rollouts, sending outbound customer communications, or approving spend emit an escalation ticket and enter `escalated_human` state. Execution halts fail-closed until a human signs off, and times out to denial if nobody responds.

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

Human-in-the-loop places a synchronous pre-execution gate directly in front of sensitive actions so nothing runs without explicit human authorization. Human-on-the-loop lets agents execute continuously while human operators monitor telemetry dashboards, sample execution traces, and intervene asynchronously after side effects have already hit live systems.

Teams often blend these two terms in compliance slide decks, yet the operational consequences are miles apart:

| Architecture Dimension | Human-in-the-Loop (HITL) | Human-on-the-Loop (HOTL) | Multi-Model Pre-Check + Twinseal (ACR) |
|---|---|---|---|
| Execution timing | Synchronous pause before tool runs | Asynchronous review during or after run | Consensus pre-check first, synchronous pause on critical writes |
| Blast radius on bad model output | Zero if paused before mutation | Bounded only by rollback speed | Zero on gated actions; 15-min `Onyxbox` purge on read tools |
| Reviewer workload | High if triggered on noisy low-risk steps | Low until an outage fires | Low, because 67% agreement filters bad drafts before escalation |
| Timeout behavior | Must fail closed (deny) or stay parked | Continues running unsupervised | Fail-closed veto (`RFC-0012`); any `reject` aborts action |
| Primary risk | Alert fatigue and rubber-stamping | Silent drift between sampling intervals | Requires explicit DID / operator role setup upfront |

Notice why pure human-on-the-loop breaks down on infrastructure and financial workflows. Once an agent deletes an S3 bucket, sends a customer refund, or promotes a lagging PostgreSQL replica, post-hoc dashboards only tell you how fast damage happened. Conversely, pure single-model HITL creates severe alert fatigue because one hallucinating model generates sloppy diffs that still require twenty minutes of manual human debugging.

Regulators have written that exact tension into law. Look at [EU AI Act Article 14 on human oversight](https://artificialintelligenceact.eu/article/14/) (governing high-risk systems, with Annex III rules applying December 2, 2027 and Annex I rules applying August 2, 2028) alongside the [NIST AI Risk Management Framework](https://www.nist.gov/itl/ai-risk-management-framework) (`Govern`, `Map`, `Measure`, `Manage`). As a technical architecture principle rather than legal advice, Article 14 specifically warns against **automation bias**, the well-documented tendency of human operators to blindly accept machine recommendations when presented with confident single-answer outputs. To reduce automation bias, oversight interfaces must expose anomalies, enable overrides, and provide a hard stop button. Showing a reviewer both the majority recommendation and preserved `DISSENT` objections directly counters that blind trust.

## Why do single-agent framework interrupts fail under production load?

Single-agent frameworks such as LangGraph and the OpenAI Agents SDK implement pause-and-resume hooks around one execution thread, yet neither provides multi-model peer critique, cryptographic reviewer identity, or preserved dissent records. Operators end up reviewing unchallenged proposals from a single model without structured counterarguments.

Inspect the actual mechanics of leading agent frameworks to see both what they solve well and where production teams hit gaps.

### LangGraph `interrupt()` and `Command(resume=...)`

Per the [LangGraph human-in-the-loop interrupts](https://docs.langchain.com/oss/python/langgraph/interrupts) documentation, pausing a graph relies on durable checkpointers plus `interrupt(payload)` inside a node. When the human supplies a decision via `Command(resume=...)`, LangGraph restarts that graph node **from the very beginning** rather than jumping to the line after `interrupt()`.

```python
from langgraph.types import interrupt, Command

def deploy_gate_node(state):
    # Any non-idempotent call placed BEFORE interrupt() runs again on resume!
    approval = interrupt({
        "action": state["proposed_migration"],
        "warning": "Verify replica lag before proceeding."
    })
    if not approval.get("approved"):
        return {"status": "aborted"}
    return execute_migration(state["proposed_migration"])
```

LangGraph explicitly documents three sharp edges engineers must guard manually: never wrap `interrupt()` inside a broad `try/except` block (because `interrupt()` raises a special exception), never change the order of multiple `interrupt()` calls within one node across replays, and never place non-idempotent side effects before `interrupt()`. More fundamentally, the checkpointer pauses *one* model's graph. If that model misread a metric or invented a flag name, the human reviewer sees zero competing opinions.

### OpenAI Agents SDK `needs_approval=True`

The [OpenAI Agents SDK human-in-the-loop docs](https://openai.github.io/openai-agents-python/human_in_the_loop/) take a clean tool-level approach: decorate risky functions with `@function_tool(needs_approval=True)`, catch `result.interruptions`, serialize `RunState`, ask the operator, and invoke `Runner.resume()`.

```python
from agents import Agent, Runner, function_tool

@function_tool(needs_approval=True)
def drain_traffic(cluster: str) -> str:
    return f"Drained {cluster}"

result = await Runner.run(agent, "Mitigate elevated 502s on east-prod")
if result.interruptions:
    state = result.to_state()
    # Host application must authenticate the approver and prevent replay
    state.approve(result.interruptions[0])
    final = await Runner.run(agent, state)
```

Notice what the SDK leaves entirely to your application code: verifying *who* approved the serialized `RunState`, attaching cryptographic non-repudiation for compliance audits, enforcing idempotency keys across retries, and catching flawed reasoning before bothering the on-call engineer.

Both `interrupt()` and `needs_approval` solve control-flow pausing inside one model loop. Neither verifies the proposal across independent models before interrupting a human.

## How do 67% consensus voting, Twinseal, and Onyxbox work together?

ACR filters single-model errors before a human ever gets paged: Postguard screens inputs for prompt injection, multiple models critique plans inside an Opsroom, Hypercensus requires a 67% signed agreement while logging GAP-08 dissent, Twinseal pauses critical mutations for human Ed25519 approval, and Onyxbox isolates tool runs in 15-minute sandboxes.

![Branching decision architecture diagram showing Postguard ingress inspection, Hypercensus 67% signed voting, auto-execution inside Onyxbox for low-risk reads, and Twinseal escalated_human pause gates for critical production writes.](/blog/images/diagram-human-in-the-loop-ai-agents.svg "Read-only checks stay in an isolated Onyxbox sandbox while database, DNS, auth, and deploy mutations halt for Twinseal human approval.")

Walk through each control in ACR's approval chain using exact protocol mechanics from [Opsroom deliberation](/docs/opsroom-deliberation) and [W3C DID identity](/docs/w3c-did-identity).

### 1. Ingress Defense (`Postguard`)

Before an external log snippet, webhook payload, or GitHub comment enters an agent turn, `Postguard` (`RFC-0019`) scans prompts for override delimiters, jailbreak signatures, and credential patterns. Suspicious payloads fail with `HTTP 422` before model inference runs, cutting off indirect prompt injections that try to smuggle unauthorized tool arguments past human reviewers.

### 2. Multi-Model Debate and 67% Consensus Gate (`Hypercensus`)

Instead of escalating one model's raw guess, [Agent Council Framework](/docs/agent-council-framework) squads (for example SRE, Security, and Planner agents backed by Claude, GPT, and Gemini) read shared context and vote. In `Opsroom`, each agent signs a ballot with its Ed25519 key (`did:key`), confidence (`0.0` to `1.0`), weight, and rationale:

```text
Approved Weight Share = Sum(weight_i * confidence_i for APPROVE) / Sum(weight_i * confidence_i for APPROVE or REJECT) >= 0.67
```

Ballots with invalid signatures or out-of-bounds confidence values (`< 0` or `> 1`) are flagged as anomalies immediately. If consensus fails to reach `67%`, or if a specialist casts `DISSENT`, the plan cannot move forward quietly. Every dissent rationale (`minLength: 1` in schema, `>= 10` characters in Opsroom validation) writes to the hash-chained `Agentseal` record (`VOTE_DISSENT_RECORDED`), preserving minority safety warnings directly above the human approval card.

### 3. Cryptographic Identity and Deterministic Signing (`did:key` + `RFC 8785`)

How does an audit log prove *which* agent or human approved a mutation six months later? ACR combines [W3C Decentralized Identifiers (DIDs) v1.0](https://www.w3.org/TR/did/), [the did:key method specification](https://w3c-ccg.github.io/did-key-spec/), and [JSON Canonicalization Scheme (RFC 8785)](https://datatracker.ietf.org/doc/html/rfc8785). Because `did:key` encodes an Ed25519 public key directly in multibase/multicodec form (`0xed 0x01`), local daemons verify signatures offline with zero external directory calls. Because `did:key` itself has no native key rotation, ACR adds `RFC-0013` dual-signed rotation links and `RFC-0021` single-use nonce handshakes. Every `ActionProposal`, `SignedDecision`, and `DecisionRecord` hashes length-prefixed canonical bytes with `BLAKE3` and chains records sequentially via `SHA-256`.

### 4. Fail-Closed Human Veto (`Twinseal`)

When a consensus-approved step involves destructive mutations (`database_mutation`, `deploy`, `spend`, or sensitive `send_message`), `Atlas 2.0` halts the graph in `escalated_human` status (`RFC-0012`). Notice the strict fail-closed logic:

- Authorization succeeds **only** when at least one authorized human (`did:acr:human:...`) signs `approve` **and zero** authorized humans sign `reject`.
- A single `reject` permanently vetoes the proposal.
- No response before timeout defaults to denial.

When the on-call engineer reviews the queued `ActionProposal` and its attached `DISSENT` logs, their approval emits a `SignedDecision` bound directly to the 64-hex `action_id` and verified against `did:acr:human:...`:

```json
{
  "action_id": "8f3c2d9a1b04e711f52a8c90e4b17a2c6d91f03e4b7c82a109d4567e12a34b5c",
  "verdict": "approve",
  "reason": "Verified lag dropped below 50ms; proceed with read-traffic drain only.",
  "decider": "did:acr:human:oncall-sre-kenny",
  "decided_at": "2026-11-26T21:16:12Z",
  "signature": "a4f90e...64-byte-ed25519-hex-signature...91bc"
}
```

Notice what happens if a script replays that signature against a modified command string: the `BLAKE3` `action_id` changes immediately, signature verification fails, and the daemon blocks execution.

Under `RFC-0012`, both the proposal hash and the human verdict use deterministic length-prefixed canonical bytes rather than raw whitespace-sensitive JSON strings:

```text
agentbbs.approval.v1
17:database_mutation
56:Drain read traffic from replica-us-east-2b before WAL catchup
29:did:acr:agent:sre-sentinel-01
11:ops-prod-db
20:2026-11-26T21:14:00Z
```

Because every field is length-prefixed before hashing with `BLAKE3` and signed over the matching `SignedDecision` canonical bytes, neither an intermediate proxy nor a reordered JSON parser can swap parameters without breaking the signature. That guarantee matters when auditing who authorized a production rollback months after the incident closed.

### 5. Ephemeral Tool Containment (`Onyxbox`) and Compliance Honesty

When low-risk diagnostic tools or human-approved remediations execute, ACR Cloud routes them inside [Onyxbox sandboxes](/docs/auto-purge-sandboxes) backed by ToolHive micro-containers (`no-network`, `egress-allowlist`, `filesystem-readonly`, `workspace-scoped`, or rootless `sysbox`). Each container runs under a kernel shutdown timer (`shutdown -h +15`) that scrubs memory and deletes ephemeral storage within 15 minutes, paired with a strict zero-foundation-model-training guarantee:

```json
{
  "sandbox": {
    "isolation": "workspace-scoped",
    "timeoutMs": 900000,
    "filesystem": { "mode": "ephemeral-overlay", "maxDiskMb": 512 },
    "network": { "egress": "allowlist", "allowedHosts": ["api.github.com"] }
  }
}
```

For security teams conducting vendor reviews, ACR publishes its [SOC-2 Compliance Check-up](/compliance), a transparent, control-by-control **self-assessment** mapping Trust Services Criteria (`CC1` through `C1`) and ISO/IEC 27001 controls to concrete code artifacts and open gaps. To be unambiguous: **ACR's SOC-2 Compliance Check-up is a published self-assessment, not an independent SOC 2 Type I/II audit, attestation, or certification.**

## Test an Approval Gate Without Risking Production

You can inspect a live `escalated_human` approval gate, cast a `DISSENT` vote, and test `Twinseal` rejection behavior in sixty seconds inside the interactive [Opsroom Simulator](/opsroom). Once you want to test real agents locally against your own scripts, review the [SOC-2 Compliance Check-up](/compliance) or run `acr-core` locally at `$0` via [Opsroom deliberation docs](/docs/opsroom-deliberation).


## Frequently Asked Questions

### How do I add human approval to LangGraph or OpenAI Agents SDK?

In LangGraph, attach a durable checkpointer and call interrupt() inside a graph node before resuming via Command(resume=...). In the OpenAI Agents SDK, mark sensitive tools with needs_approval=True and resume serialized RunState. In both cases, ensure pre-interrupt steps are idempotent and pair framework pauses with multi-model review if actions touch production.

### What happens when an agent votes DISSENT in ACR?

Under protocol invariant GAP-08 (RFC-0002), voting DISSENT requires a substantive written rationale (at least 10 characters in Opsroom validation; empty rationales fail with HTTP 400). The daemon records a VOTE_DISSENT_RECORDED block inside the hash-chained Agentseal ledger so human reviewers always see why a dissenting model objected.

### Is ACR SOC 2 certified?

No. ACR is not SOC 2 certified and has not completed an independent third-party SOC 2 examination. Instead, ACR publishes a transparent control-by-control self-assessment called the SOC-2 Compliance Check-up at /compliance, listing aligned controls, open remediation gaps, and verifiable code evidence.

### How does EU AI Act human oversight relate to approval gates?

EU AI Act Article 14 requires high-risk AI interfaces to support anomaly monitoring, mitigation of automation bias, output override, and safe halt controls (effective 2027-2028 across Annexes). Technically, signed pre-execution approval gates, visible dissenting rationales, and fail-closed veto switches map cleanly to those engineering controls, though teams should consult legal counsel for regulatory compliance decisions.
