Human checkpoint: pause, save state, and let a person decide
A human checkpoint pauses an agent before a risky step, saves its state, and waits for a person to approve, edit, or reject. Use it for actions that send, pay, delete, or publish.
Human checkpoint in 60 seconds
- What: the run stops before a risky step, saves its state, and waits for a person to approve, edit, or reject.
- Who decides the path: a person, at the points your design marks as risky.
- Best for: sending messages, moving money, deleting data, publishing content, or anything hard to undo.
- Weak spots: slow approvals, reviewers who click approve without reading, and state that is lost while waiting.
- Key rule: the run waits in storage, not in memory, so a pause can last minutes or days.
Where this type fits
In the orchestration patterns hub, patterns are grouped by who decides the path: your code, a model, a reviewer, or a person. The human checkpoint is the one where a person decides. It is rarely used alone. It sits inside another pattern, such as a single agent or a state graph, and guards the few steps where a wrong action costs too much.
The problem it solves
Agents act. They send emails, issue refunds, edit records, and publish pages. Models also make mistakes: they misread an instruction, pick the wrong customer, or follow text hidden inside a document. When an agent only drafts text, a mistake is cheap, because a person reads the draft anyway. When an agent can take real actions, the same mistake becomes an incident.
The obvious fix is to require approval for every action, but that removes the point of automation. People get flooded, approvals become a reflex, and the agent saves no time. The opposite fix, trusting the agent fully, accepts all the risk. Neither extreme works.
A checkpoint is the middle path. You mark a small set of steps as risky, usually the ones that are irreversible, expensive, external, or sensitive. The agent runs freely until it reaches one of them. Then it stops, shows a person exactly what it is about to do, and continues only on their decision. The person's attention goes where it matters most.
How it works
- Run: the agent works normally, calling safe tools such as search and read-only lookups without interruption.
- Detect a risky step: before a tool call that sends, pays, deletes, or publishes, a rule in your code catches it. The rule is code, not a model's judgement, so the model cannot talk its way past it.
- Save state and pause: write the full run state to durable storage: the task, the messages so far, the proposed action and arguments, and a request id. Then stop the process.
- Ask a person: put the request in a review queue with the context a person needs: what the agent wants to do, why, and what the effect will be.
- Decide: the person approves, edits the arguments, or rejects with a reason. The decision is stored with their identity and a timestamp.
- Resume and act: load the saved state, apply the decision, and continue. An approved action runs once. A rejection goes back to the model as feedback so it can choose another path.
The note about storage is the heart of the design. A person may take an hour or a weekend to respond. If the run is held in a process's memory, a restart or a deploy loses it. Saving state to a database or a queue means no process needs to stay alive while waiting. Any worker can pick up the run later, which is the same idea behind message queues.
The second note is about placement. Put checkpoints before the action, never after it. A review that happens once the email has gone out is only a record. Choose the points by effect: can it be undone, who sees it, how much does it cost, and does it touch personal data.
A worked example
Acme runs a billing assistant. A customer, Dana, writes that she was charged twice for a 24.00 plan. The agent looks up her account with read-only tools, finds two charges on the same day, and decides a refund is right. Looking up is safe and runs without a pause. Issuing a refund is on the checkpoint list, so the run stops.
{
"request_id": "ck-20481",
"status": "waiting",
"proposed_action": {"tool": "issue_refund", "args": {"charge_id": "ch_902", "amount": 24.00}},
"reason": "Two identical charges on 3 March; second is a duplicate.",
"expires_at": "2026-03-05T09:00:00Z",
"run_state": {"messages": "[stored]", "step": 4}
}A support lead, Sam, sees the request in the queue. It shows the two charges, the proposed refund of 24.00, and the agent's reason. Sam checks that the amounts match and approves. The system stores 'approved by Sam at 14:12', loads the run state, and issues the refund once with the request id as an idempotency key. The agent then sends Dana a confirmation. Had Sam edited the amount or rejected the action with a note, the agent would have received that as its next input.
If nobody had responded before the expiry time, the request would have moved to a fallback: escalate to a second reviewer, and if still unanswered, cancel the action and tell the customer a person will follow up. Silence never counts as approval.
Building it
import time
import uuid
# store, queue, tools, and llm are placeholders for your own storage,
# review queue, tool registry, and model call.
RISKY_TOOLS = {'issue_refund', 'send_email', 'delete_record', 'publish_page'}
MAX_STEPS = 10 # the agent loop is still bounded
APPROVAL_TTL = 24 * 3600 # seconds before a waiting request expires
def run_agent(state):
for _ in range(MAX_STEPS):
step = llm.generate(state['messages'], tools=list(tools))
if step.get('answer'):
return {'done': True, 'answer': step['answer']}
call = step['tool_call']
if call['name'] in RISKY_TOOLS:
# Decided by code, so the model cannot skip it.
request_id = str(uuid.uuid4())
store.save(request_id, {
'state': state, 'call': call, 'status': 'waiting',
'expires_at': time.time() + APPROVAL_TTL,
})
queue.publish('review', {'request_id': request_id, 'call': call})
return {'done': False, 'waiting_on': request_id} # process can exit
result = tools[call['name']](**call['args'])
state['messages'].append({'tool': call['name'], 'result': result})
return {'done': True, 'answer': 'Step limit reached.'}
def resume(request_id, decision, reviewer_id):
record = store.load(request_id)
if record['status'] != 'waiting':
return # a second click must not run the action twice
if time.time() > record['expires_at']:
store.update(request_id, status='expired')
return
call, state = record['call'], record['state']
store.update(request_id, status=decision['action'], by=reviewer_id)
if decision['action'] == 'approve':
args = decision.get('edited_args', call['args'])
result = tools[call['name']](**args, idempotency_key=request_id)
state['messages'].append({'tool': call['name'], 'result': result})
else:
state['messages'].append({'rejected': decision.get('reason', 'no reason')})
return run_agent(state)Notice that resume checks the status first. Two reviewers clicking approve, or a retried message, must not run a refund twice. The idempotency key adds a second layer, as explained on the idempotency page.
Design decisions
- Which steps need a checkpoint: default to irreversible, external, costly, or sensitive actions. Keep the list in code or configuration, reviewed like any security rule.
- State storage: use a durable database or queue, never process memory. Store enough to resume without the original process.
- Approval content: show the exact action and arguments, the reason, and the likely effect. Reviewers decide badly when they only see a summary.
- Timeouts: give each request an expiry, such as 24 hours. On expiry, escalate or cancel. Default to cancel, never to proceed.
- Access control: check that the reviewer is allowed to approve this kind of action and amount. Keep an audit record of who decided and when.
- Duplicate protection: make resume idempotent, with a status check and an idempotency key on the action.
- Editing: allow reviewers to change arguments, such as a smaller amount, and re-validate the edited values before running.
Measuring it
- Approval rate: approved divided by all requests. A rate near 100 percent may mean the checkpoint is too broad. A low rate means the agent proposes poor actions.
- Edit rate: requests where the reviewer changed arguments. Group the edits to find systematic agent mistakes.
- Time to decision: median and 95th percentile from request to decision. This sets the delay users feel.
- Expiry rate: requests that expired divided by all requests. It shows queue overload or poor routing.
- Reviewer review time: seconds spent on each request. Very short times with high approval suggest rubber-stamping.
- Post-approval incident rate: approved actions later found to be wrong. This tells you whether the review is catching real errors.
When to use it, and when not to
| Situation | Use this type? | Why |
|---|---|---|
| Agent can send external email or messages | Yes | A sent message cannot be recalled, and wording errors reach customers. |
| Agent moves money or issues refunds | Yes | Mistakes cost money and may need audit evidence of approval. |
| Agent deletes or changes records | Yes | Deletion is often irreversible. Review before, not after. |
| Read-only research and drafting | No | Nothing leaves the system, so review adds delay without reducing risk. |
| Low-value, easily reversed actions | Usually no | Undo is cheaper than a person's time. Log them and sample. |
| Very high volume of similar risky actions | Partly | Approve by batch or by risk score, and sample the rest, or reviewers will tire. |
| Decisions regulated or needing named accountability | Yes | A recorded human decision is often required. |
Trade-offs
| Dimension | Effect | What to do about it |
|---|---|---|
| Quality | Catches wrong actions before they take effect | Show the exact action, and track post-approval incidents to confirm the review works. |
| Latency | A task waits for a person, which can take hours | Tell the user it is pending, set expiry times, and route by urgency. |
| Cost | Reviewer time is the main cost, while compute is low | Keep checkpoints narrow, and use batching for repeated low-risk cases. |
| Complexity | Needs durable state, a review queue, and an interface | Reuse your workflow or queue system, and keep the state record small. |
| Failure modes | Lost state, double execution, stale approvals, and rubber-stamping | Store durable state, check status on resume, expire requests, and audit review times. |
Compared with related types
A state graph is the natural home for a checkpoint, because each node has saved state and a pause is just a node that waits for an event. The long-running agent relies on the same save-and-resume idea for runs that span days. A critic loop uses a model as the reviewer, which is cheaper and faster, but a person is still the better judge when the action is irreversible.
In practice, combine them. Let automated checks and a critic loop filter obvious problems, then ask a person only about what remains. See guardrails and safety for the wider set of controls.
What this means for your role
Common mistakes
Further reading
- Orchestration patterns: the hub that compares every pattern.
- Message queues: how work waits in durable storage until a consumer is ready.
- Idempotency: making an action safe to retry.
- Guardrails and safety: other controls that work alongside human review.
A good checkpoint is narrow, durable, and honest about what it asks. Start with the three or four actions you could not undo, and widen the list only when the data says you should.