Skip to content
All patterns
Agents

Human-in-the-loop

Pause agent execution for human approval before destructive or high-stakes actions, then resume.

How an agent pauses for human approval and then resumes

Step 1 of 5

Agent proposes

Working on a task, the agent reaches a high-stakes step, for example sending a refund of a given amount. It stops before executing.

The checkpoint is what lets the agent wait for hours without holding a process open.

User
Agent
Checkpoint
Human approval
Tools
clientservicemodeldatabaseagentexternal
Explanation

Before a high-stakes tool call, the agent serialises its state to a checkpoint and waits. A human reviews the proposed action and approves or rejects. The agent resumes from the checkpoint with the decision.

Components
State serialisationCheckpoint storeApproval UI / notificationResume mechanismTimeout + escalation
When to use
  • Agents that send emails, make payments, modify production data
  • Regulated workflows
  • High-value transactions
When NOT to use
  • Read-only or low-stakes actions
  • Real-time requirements
Failure modes
  • State cannot be resumed (deserialisation bug)
  • Approval never comes — workflow stalls
  • Approver rubber-stamps without review
  • Race condition between approval and state change
Production checklist
  • Idempotent resume
  • Approval timeout + escalation
  • Full audit of approvals
  • Two-person approval for highest-stakes
  • State versioning for migrations
  • Mobile approval path