Human-in-the-Loop for AI Agents

Human-in-the-loop (HITL) is how an AI agent asks a person before it does something it can't take back — issue a refund, send an email, merge a PR, move money. agentFast ships HITL as a first-class, durable part of the runtime, not a bolt-on.

Gate the risky call, pause durably, run it exactly once
Human-in-the-loop: risky tool calls pause durably for approval and execute exactly onceThe agent emits tool calls. Safe calls execute immediately. A high-risk call (a refund) is gated: the run pauses durably to Postgres, a human approves or rejects from the dashboard, CLI or playground, and the approved action executes exactly once.agentsafe tool callsexecute immediatelyrefund_requestrisk: high → gateddurable pausePostgres — survives a crashdashboard · CLI · playground✓ approveruns once✗ rejectreason → agent reasoning
Two modes

Suspend the run

Durably pause the whole run at the risky step. The process can die and the pause persists; on approval the run resumes from the exact step.

Defer one call

Hold back just the one gated tool call while the rest of the batch proceeds, then execute the approved call when a human decides.

How it works in practice

Approve from anywhere

Pending approvals show up in a queue you act on from the dashboard, the playground, or the CLI.

Rejections feed back

A rejection reason returns to the agent's reasoning, so it can escalate or try another path instead of silently failing.

Any tool can be gated

Risk is a per-deployment property — mark a built-in or MCP tool high-risk in config and it routes through approval.

Exactly once, even under retries
The dangerous bug in naive approval flows is double-execution — two workers, or one retried worker, both run the approved side effect. agentFast keys each approval per run and tool call and commits it with a database compare-and-set on the approval's executed_at column. The side effect fires once, and the outcome is memoized, no matter how many times resume is called.

HITL is only safe because of durable execution. Read the worked example in how to add human-in-the-loop with durable execution, or see it on LangGraph.

Stop rebuilding the plumbing.

agentFast is the production layer — memory, 50 tools, observability, evals, guardrails, human-in-the-loop — for LangGraph, CrewAI, the Claude & OpenAI Agent SDKs & Vanilla. Own it for life.

Get agentFast — from $89