---
title: "How to roll back failed agents: 2-state checkpoint, rollback vs retry"
site: "tryinterlock.com"
kind: "article"
author: "Colton Ramsey"
date: "November 21, 2026"
canonical: "https://tryinterlock.com/blog/how-to-roll-back-failed-agents-2-state-checkpoint-rollback-vs-retry.php"
markdown: "https://tryinterlock.com/blog/how-to-roll-back-failed-agents-2-state-checkpoint-rollback-vs-retry.php/index.md"
description: "Use a 2-state checkpoint to decide rollback vs retry after tool failure by matching pending intents with idempotency keys, request IDs, and timestamps."
---

# How to roll back failed agents: 2-state checkpoint, rollback vs retry

Colton Ramsey · November 21, 2026

> Use a 2-state checkpoint to decide rollback vs retry after tool failure by matching pending intents with idempotency keys, request IDs, and timestamps.

Check whether each pending intent is recorded with a stable identifier and timestamp that the external system can use to match a resumed or repeated call. If the tool supports an idempotency key, use it as the handle for that lookup; if it does not, check whether the system exposes a read-by-request-id result. The point is to turn an ambiguous "did it happen?" question into a lookup against a known identifier and time rather than an assumption.

After a failure, recovery begins from committed state and treats every pending intent as unconfirmed until the external system says otherwise. Nothing in pending intent is assumed to have happened, and nothing in committed state is re-derived from reasoning. This preserves a known-good boundary while leaving the uncertain work identifiable.

![Storm lit data center corridor with checkpoint archway forked](https://static.mm-ais.com/article-images-ai/how-to-roll-back-failed-agents-2-state-c-ai-62790605.jpg)
Storm lit data center corridor with checkpoint archway forked

## The evidence: what checkpointing literature shows

Check Point Software Technologies provides the enforcement half of the analogy. Wikipedia describes it as an Israeli cybersecurity company founded in 1993 by Gil Shwed, Marius Nacht, and Shlomo Kramer, whose first product was the FireWall-1 firewall. A firewall functions as a named control point that inspects traffic at a defined boundary before permitting or blocking passage. Read alongside Checkpoint Charlie, the evidence points to the same operational requirement: a boundary becomes auditable when its location, inspection rule, and decision outcome are explicit.

For a design audit, check three properties in any proposed checkpoint: the boundary has a stable name, the condition that opens or closes it is explicit, and the system records what crossed it and what decision was made. Checkpoint Charlie illustrates a named crossing with an explicit control decision, and FireWall-1 illustrates inspection at a defined network boundary, but neither source documents an agent-recovery test; use them as analogies to audit your design, not as proof. If an agent design cannot satisfy these checks, it may produce logs, but it does not provide the auditable control point described by the analogy.

The gap between these sources and agent systems is the central evidence limitation. Checkpoint Charlie documents a physical crossing control, and Check Point documents network enforcement; neither source measures how an AI agent should recover after a failed tool call. No agent-specific rollback benchmark exists in the available sources for this guide, so these analogies cannot support quantified claims about agent recovery rates, failure reduction, or production reliability. Any numeric performance claim attached to agent rollback would go beyond the cited evidence.

Use the literature as a design audit, not a performance proof. A reader can apply the checkpoint pattern by requiring named boundaries, explicit validity conditions, and inspectable crossing records in an agent system. Whether that pattern improves recovery in a specific workload is an empirical question that requires measurement outside the available sources provided here, and it should be answered before treating the analogy as an operational guarantee.

![Mountain pass dusk with stone checkpoint tower branching](https://static.mm-ais.com/article-images-ai/how-to-roll-back-failed-agents-2-state-c-ai-e2de72f9.jpg)
Mountain pass dusk with stone checkpoint tower branching

## Rollback vs retry: the comparison that decides it

Rollback-to-checkpoint is the safer branch when an external side effect may have committed, and the comparison below shows why. Retry re-executes the failed action from the top of the task, which means every side effect between the last checkpoint and the failure gets issued a second time — a payment charged twice, an email sent twice, a record appended twice. Rollback instead restores the last verified 2-state checkpoint and limits the uncertain work to one pending-intent window: the committed state is known-good, and the pending intent still needs to be reconciled or safely discarded. The asymmetry is structural, not incidental: retry can multiply side effects by the number of attempts, while rollback holds them to the single window that was open when the failure occurred. When the effect is irreversible or shared across agents, halt and use the compensation or coordination checks below rather than treating rollback as a universal default.

Reconciliation cost belongs in both formulas and should be logged separately. After a rollback, compare committed state with external systems and repair drift; after a retry, detect and compensate duplicates. If reconciliation is hidden inside either C_retry or C_rollback, the model will understate the cheaper-looking path and bias the decision.

Storage cost is frequency times checkpoint size times retention. Checkpoint size is the sum of committed state and the pending-intent log, so trimming or compressing the pending-intent log can lower storage without changing the interval. Retain only enough checkpoints to cover the slowest tool timeout plus reconciliation time; older checkpoints add storage without reducing recovery risk.

Calibrate the model with incident data, not assumptions. When a failure occurs, record whether it was pre-commit or post-commit, whether the action was idempotent, which path was taken, and the resulting C_retry or C_rollback. Update the interval and cost weights from that record. A method-only model with measured inputs is more reliable than a precise-looking model built on guessed prices or durations.

![Rollback vs retry: the comparison that decides it — How to roll back failed agents](https://static.mm-ais.com/article-images-pixabay/how-to-roll-back-failed-agents-2-state-c-169d099c.jpg)

## What this evidence does not establish

The rollback rule also has failure modes it cannot fix by itself. Start with irreversible external effects. If a sent email, settled payment, or filed record committed before the crash, restoring the agent to its last verified checkpoint will not reliably un-send the message, un-settle the funds, or un-file the record. In those cases the rule degrades to reconcile-then-compensate: query the external system of record, confirm what actually landed, then run a separate compensation workflow with explicit ownership and approval. The boundary model here does not cover compensation design — who approves a recall, refund, correction filing, or customer notice — so treat that as a separate decision before rollback is called complete. Check: can the effect be queried after the fact? If yes, reconcile first; if no, assume it committed and escalate.

A second break is tooling that cannot prove whether an intent became an effect. Pending-intent reconciliation depends on a tool accepting an idempotency key or exposing a read-by-request-id result. If the operation is non-idempotent and the API has neither safeguard, replaying the captured call can create a second invoice, charge, submission, or shipment; suppressing it can leave an unknown committed effect. The only safe action is halt-and-escalate with the exact request payload, endpoint, timestamp, and correlation identifiers attached. Check: does the tool accept an idempotency key, and can a caller look up the result by that key? Two noes mean freeze, not retry and not blind rollback.

Multi-agent fan-out breaks the rule when writers share state. If two agents can commit to the same store, one agent’s rollback can move its local view backward while the other agent’s verified checkpoint still rests on newer writes; the sibling may then hold approvals, budgets, or intents keyed to records that no longer match the restored boundary. The choice is no longer “roll back one agent” but “choose rollback scope.” Check: do the agents share record IDs, account balances, ticket states, or object versions? If yes, coordinate rollback across the fan-out or fence the stale agent before it issues new calls.

So the defensible reading is narrower: rollback wins where recovery is reversible, isolated, and independently queryable; outside that envelope, halt is the safer default. Build the compensation runbook and shared-writer registry before the next failure, because both require facts a crashed agent cannot reconstruct after the fact.

![What this evidence does not establish — How to roll back failed agents](https://static.mm-ais.com/article-images-pixabay/how-to-roll-back-failed-agents-2-state-c-e81280d5.jpg)

## A 3-checkpoint agent run

Consider an agent that updates a support ticket through three checkpoints. The reconciliation worksheet records, for each checkpoint, the drafted action, the external call status, the confirmation status, and the resulting decision. That record lets a failure be matched to the last verified state instead of being retried blindly.

At Checkpoint 1, the pre-tool checkpoint, the agent has drafted the ticket update but has issued no external call. Because no side effect has committed, a failure here is free to retry: C_retry = 0. The draft can be regenerated or resumed without risk of duplicating work in the ticketing system, and no reconciliation step is needed.

At Checkpoint 2, the post-issue, pre-confirm checkpoint, the update has been sent to the ticketing API but no confirmation has been received. Pending intent is non-empty, so the worksheet requires reconciliation by idempotency key before any retry. Query the ticketing system for that key: if the update is present, advance committed state; if it is absent, retry once using the same key. The key is the only safe way to distinguish a lost confirmation from a lost request.

At Checkpoint 3, the post-confirm checkpoint, the confirmation has been logged and committed state has advanced. A failure after this point means rolling back to Checkpoint 3, never to Checkpoint 2. Rolling back to Checkpoint 2 would treat the already-confirmed update as unfinished and re-send it, creating a duplicate side effect.

| Checkpoint | Observed state | Failure decision |
| --- | --- | --- |
| 1, pre-tool | Drafted update; no external call | Retry; C_retry = 0 |
| 2, post-issue, pre-confirm | Update sent; no confirmation; pending intent non-empty | Reconcile by idempotency key before retry |
| 3, post-confirm | Confirmation logged; committed state advanced | Roll back to Checkpoint 3, never Checkpoint 2 |

If the idempotency-key lookup itself fails, stop and escalate rather than retrying. An unresolved pending intent is not a retryable pre-commit failure, and proceeding would risk a duplicate external side effect.

The worksheet therefore turns the failure decision into a boundary check: no committed side effect means retry; an unconfirmed pending intent means reconcile first; a confirmed commit means rollback to the checkpoint that contains it. Record the observed system state—such as the idempotency-key lookup result—rather than the agent's memory of what it intended to do.

![A 3-checkpoint agent run — How to roll back failed agents](https://static.mm-ais.com/article-images-pixabay/how-to-roll-back-failed-agents-2-state-c-af4ac277.jpg)

## Decision rules for the on-call operator

When a failed agent lands in your queue, the recovery decision should be a deterministic check, not an intuition call. These four rules operationalize the canonical recovery rule into the sequence an on-call operator can execute before taking any action.

| Rule | If this condition holds | Then take this action |
| --- | --- | --- |
| 1 | pending_intent_keys is empty and the failed tool call is idempotent. | Retry from the last checkpoint. |
| 2 | pending_intent_keys is non-empty. | Reconcile each key against the external system before choosing retry or rollback; never retry blind. |
| 3 | Any external side effect has committed since the last checkpoint and the effect is reversible or compensable. | Roll back to the last verified checkpoint. |
| 4 | The external effect is irreversible. | Halt automated recovery and escalate to compensation rather than rolling back. |

Rule 2 handles the ambiguous case that can produce duplicate side effects. For every key in pending_intent_keys, query the external system of record, match the request identifier, and record whether the effect committed, failed, or remains unknown. Only after each key is reconciled should you choose retry or rollback. A blind retry skips this evidence and can turn an unknown state into a duplicate-write incident.

Rules 3 and 4 split on reversibility after reconciliation confirms a committed effect. When the effect can be reversed or compensated through a supported operation, roll back to the last verified checkpoint so the agent resumes from a known-good boundary. When the effect is irreversible, stop automated recovery, preserve the checkpoint record and reconciliation evidence, and escalate to the compensation workflow owned by the system that accepted the write. The operator’s responsibility in that case is to contain the failure boundary, not to force the agent into an artificial clean state.

## Frequently Asked Questions

**What should be checked on each pending intent so a resumed or repeated call can be matched?**

Check whether each pending intent is recorded with a stable identifier and timestamp that the external system can use to match a resumed or repeated call.

**What fallback exists when the tool has no idempotency key?**

If the tool supports an idempotency key, use it as the handle for that lookup; if it does not, check whether the system exposes a read-by-request-id result.

**How should an ambiguous "did it happen?" result be handled?**

The point is to turn an ambiguous "did it happen?" question into a lookup against a known identifier and time rather than an assumption.

**What state does recovery begin from after a failure?**

After a failure, recovery begins from committed state and treats every pending intent as unconfirmed until the external system says otherwise.

**What must not be assumed or re-derived during recovery?**

Nothing in pending intent is assumed to have happened, and nothing in committed state is re-derived from reasoning.

**What does the committed-state recovery rule preserve?**

This preserves a known-good boundary while leaving uncertain work identifiable.

## Quick answers

| What should be checked for each pending intent? | Check whether each pending intent is recorded with a stable identifier and timestamp that the external system can use to match a resumed or repeated call. |
| --- | --- |
| What should be used if the tool supports an idempotency key? | If the tool supports an idempotency key, use it as the handle for that lookup; if it does not, check whether the system exposes a read-by-request-id result. |
| What happens after a failure? | After a failure, recovery begins from committed state and treats every pending intent as unconfirmed until the external system says otherwise. |
| What is not assumed or re-derived during recovery? | Nothing in pending intent is assumed to have happened, and nothing in committed state is re-derived from reasoning. |
| How does a firewall function in the analogy? | A firewall functions as a named control point that inspects traffic at a defined boundary before permitting or blocking passage. |

Also worth reading: **Building Fault-Tolerant AI Agent Workflows That Resist Failure**: [Building Fault-Tolerant AI Agent Workflows](https://tryinterlock.com/blog/building_fault_tolerant_ai_agent_workflows_that_resist_failure.php) · **Agent Workflow Costs for 2026: 10,000 Multi-Agent Tasks — Split or Not?**: [Agent Workflow Costs for 2026:](https://tryinterlock.com/blog/agent-workflow-costs-for-2026-10000-multi-agent-tasks-split-or-not.php) · **Designing Self-Correcting Agent Workflows for Real-Time Adaptation**: [Designing Self-Correcting Agent Workflows for](https://tryinterlock.com/blog/designing_self_correcting_agent_workflows_for_real_time_adaptation.php)

### Related reading

- [Why one bad tool call breaks 5 AI agents: retry budget caps cascade at 3 tries](https://tryinterlock.com/blog/why-one-bad-tool-call-breaks-5-ai-agents-retry-budget-caps-cascade-at-3-tries.php)
- [State persistence strategies for long-running AI agents](https://tryinterlock.com/blog/state_persistence_strategies_for_long_running_ai_agents.php)
- [Agent handoffs across companies: 2 owners, 1 audit trail, 0 blind retries](https://tryinterlock.com/blog/agent-handoffs-across-companies-2-owners-1-audit-trail-0-blind-retries.php)
- [When software agents trip each other: after 3 failures, pause branch vs. kill run](https://tryinterlock.com/blog/when-software-agents-trip-each-other-after-3-failures-pause-branch-vs-kill-run.php)
- [Multi-Agent Security Orchestration: Zero-Trust Policy Enforcement vs. Manual Review — 40% Time Savings vs. Verify](https://tryinterlock.com/blog/multi-agent-security-orchestration-zero-trust-policy-enforcement-vs-manual-review-40-time-savings-vs-verify.php)
- [Building a health check system for your AI agent fleet: 3-minute latency budget vs. 15-minute timeout decision](https://tryinterlock.com/blog/building-a-health-check-system-for-your-ai-agent-fleet-3-minute-latency-budget-vs-15-minute-timeout-decision.php)

### Latest

- [Agent handoffs across companies: 2 owners, 1 audit trail, 0 blind retries](https://tryinterlock.com/blog/agent-handoffs-across-companies-2-owners-1-audit-trail-0-blind-retries.php)
- [When software agents trip each other: after 3 failures, pause branch vs. kill...](https://tryinterlock.com/blog/when-software-agents-trip-each-other-after-3-failures-pause-branch-vs-kill-run.php)
- [Multi-Agent Security Orchestration: Zero-Trust Policy Enforcement vs. Manual...](https://tryinterlock.com/blog/multi-agent-security-orchestration-zero-trust-policy-enforcement-vs-manual-review-40-time-savings-vs-verify.php)

Canonical: https://tryinterlock.com/blog/how-to-roll-back-failed-agents-2-state-checkpoint-rollback-vs-retry.php
Markdown: https://tryinterlock.com/blog/how-to-roll-back-failed-agents-2-state-checkpoint-rollback-vs-retry.php/index.md

```json
{"@context":"https://schema.org","@type":"BlogPosting","headline":"How to roll back failed agents: 2-state checkpoint, rollback vs retry","url":"https://tryinterlock.com/blog/how-to-roll-back-failed-agents-2-state-checkpoint-rollback-vs-retry.php","description":"Use a 2-state checkpoint to decide rollback vs retry after tool failure by matching pending intents with idempotency keys, request IDs, and timestamps.","datePublished":"November 21, 2026","author":{"@type":"Person","name":"Colton Ramsey"},"articleBody":"Check whether each pending intent is recorded with a stable identifier and timestamp that the external system can use to match a resumed or repeated call. If the tool supports an idempotency key, use it as the handle for that lookup; if it does not, check whether the system exposes a read-by-request-id result. The point is to turn an ambiguous \"did it happen?\" question into a lookup against a known identifier and time rather than an assumption. After a failure, recovery be..."}
```
