All patterns
Agents
Human-in-the-Loop
Pause agent execution for human approval before destructive or high-stakes actions, then resume.
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