Agentic Pattern Libraryby Vikas Goyal
← All patterns
18

Human-in-the-Loop

Also known as: approval gate, human checkpoint, HITL

Pause for human approval before risky or irreversible actions.

TrackAgentic systems FamilySafety & control Maturity Established ChangesVerificationDecision
01

Problem

Agents now send emails, change records, move money and deploy code. Most of those actions are routine, but some can’t be undone or carry real business risk. Letting the agent do everything unsupervised is unsafe; making a person approve every step makes the agent pointless.

  • Some actions are irreversible or expensive to undo.
  • Every approval request costs a person’s time and attention.
  • Reviewers who see too many requests start approving without reading.
  • The agent may wait hours for an approval, so its state must survive the pause.
02

Solution

Classify every action the agent can take by risk: reversibility, money, data exposure and who is affected. Low-risk actions run automatically. High-risk actions pause the run and send the reviewer a short approval card: what the agent wants to do, why, the exact change, and what happens if it’s rejected. The agent’s state is saved so it can resume hours later. Approve, edit and reject are all first-class outcomes, and every decision is logged with who made it.

03

Diagram

Agentproposes action Riskpolicy Execute Pausesave state Approval cardaction · why · exactchange · if rejected Personapprove · edit · reject low risk · auto high risk approved every decision logged with who and when

Risk is decided by policy, not by the agent's own judgment. Only the actions that need a human ever reach one.

04

When to use

Use it when

  • The agent takes irreversible actions (payments, deletions, external messages)
  • Regulations or contracts require a named person to approve
  • You're rolling out a new agent and building trust in it
  • Errors are rare but very costly

Avoid it when

  • Every action is easily reversible; log and allow undo instead
  • Volume is so high that reviewers would rubber-stamp
  • Decisions must happen faster than a person can respond
05

Trade-offs

Latency Gated actions wait minutes to hours for a person
Cost Human review time is the main cost
Complexity Risk policy, approval UI, pause and resume
Reliability A person signs off on every high-risk action

Gains

  • Prevents costly irreversible mistakes
  • Meets audit and compliance requirements with a clear record
  • Lets organizations adopt agents before trusting them fully

Costs

  • Slows high-risk work down to human speed
  • Approval fatigue erodes the value of review
  • Pause-and-resume state is real engineering work
06

Worked example

Scenario
A procurement agent handles purchase requests for an operations team.
  1. AgentProcesses 42 requests in a week. 37 are under $1,000 from approved vendors, so the policy lets them run automatically.
  2. PolicyA $14,500 request for a new vendor trips two rules: amount over $5,000 and an unapproved vendor. The run pauses.
  3. Approval cardSent to the operations manager: “Buy 3 GPU workstations from NovaTech for $14,500. Reason: ticket OPS-311. NovaTech is not an approved vendor. If rejected, I’ll request quotes from the 2 approved vendors instead.”
  4. ManagerEdits the request to 2 workstations and approves. The agent resumes the next morning with the edited quantity.
  5. Audit logRecords the original request, the edit, the approver and the timestamp. Monthly review shows 5 approvals in total, with a median response time of 3 hours.
07

Failure modes

FailureSymptomMitigation
Rubber-stampingApprovals take seconds and are almost never rejectedGate fewer actions; show only the key facts; sample-audit approvals
Vague approval requestsReviewer can't tell what will actually changeShow the exact action, amounts and recipients, plus the alternative
Lost state on resumeAgent restarts the task or acts on stale data after approvalSave state at the pause; re-check key facts before executing
Agent decides its own riskRisky action classified as routine by the modelRisk tiers set by policy and code, not by the agent