Durability
What happens to an agent's work when a machine crashes in the middle of an action, and how we prove it.
Full measurement tables: /benchmarks § Durability · Source draft: docs/gtm/clawql-durability-page-draft.md
Agents don't just answer questions. They send payments, file records, update databases and call APIs that change the world. A crash at the wrong moment can make an agent do something twice, or lose track of what it already did. ClawQL is built so that neither happens, and this page shows the evidence, including where it is still incomplete.
Two ways a crash goes wrong
- A repeated action. The agent sends a payment, crashes before recording that it did, restarts, and sends it again.
- A lost intent. The agent decides to act, but the record of that decision disappears in the crash, so after recovery nobody knows whether the action happened.
Most agent frameworks handle neither at the infrastructure level; they rely on each tool or developer to cope. ClawQL handles both underneath every tool call.
How ClawQL prevents them
- Record the intent before acting. Before any external call, the agent's intent is written to a durable journal. If the machine dies a moment later, the intent survives.
- Never acknowledge before it's durable. Nothing is confirmed until the write behind it is stored on a quorum of disks. In celld's default fleet mode, the copy to object storage can finish afterward. Acknowledging too early is exactly how intents get lost.
- Attach an idempotency key to every external write. The key is derived from the journaled intent, so if a call is retried after a crash, the receiving service recognizes it as the same request and performs it once.
- One live owner per agent. Each agent is owned by exactly one process at a time, through a lease. A process that falls behind is fenced off, so it cannot act on stale state.
- Silence is not death. A lease running out does not mean its owner is dead; a frozen process can wake up. ClawQL only treats an owner as gone when it can prove it (for example, the process no longer exists on that host) or when it has fenced the old owner out.
- Uncertainty is explicit. If a crash lands mid-call and ClawQL cannot know whether the call took effect, the outcome is recorded as unknown and resolved by checking, never by guessing or blindly retrying.
What we measured
On ClawQL's lab build of the celld runtime (version 0.6.3 plus ClawQL's fixes), on one host, in celld's default fleet durability mode (two nodes with disk replicas on that host, Cloudflare R2 as the fleet bucket), against a mock upstream service:
| Measurement | Result |
|---|---|
| Soak: repeated node restarts | 1,000 of 1,000 cycles, no failed readiness, no self-fencing |
| Crash trials, killed at every phase of an action | 1,000 trials |
| Wrong outcomes (repeated or lost actions) | 0 |
| Crashes during an external call where the intent was visible on recovery | 241 of 243; the other 2 never sent the call, confirmed by their effect records |
| Trials that missed the recovery deadline | 18 of 1,000 (1.8%, under our 2% limit) |
| Median recovery time | About 17 seconds |
Zero wrong outcomes in 1,000 trials means the true rate is at most about 0.3%, with 95% confidence. It does not mean never, and we say so.
The soak and the crash trials are proven, inside their own result files, to have run the same binary, identified by commit and SHA-256 hash.
Why recovery takes 17 seconds. An earlier build recovered in about 7, by treating an unresponsive owner as dead once its lease ran out. That was unsafe: a frozen owner can wake up and act. We now wait until the old owner is provably gone or fenced out. That makes recovery slower and correct, and we chose correct.
How we test
- Kill at every phase. Each trial kills the agent at a chosen point: before recording intent, after recording it but before calling, during the call, and after the call but before recording the result. Every phase must end with the right outcome.
- Hostile timing. Owners are frozen past their leases, stale owners are revived, and renewals are made ambiguous, the conditions under which ownership bugs appear.
- Ground truth outside the system. Every trial keeps an independent record of what the receiving service actually did, so results never depend on the system grading itself.
- Criteria fixed in advance. Pass and fail criteria are frozen before a board runs and never loosened after seeing results. A run is voided only for a monitored environment fault recorded at the time.
- Formal models. Ownership, leases, resume and approval lifecycles are modeled in TLA+, and the model checker is used to find counterexamples before code changes.
- Same binary, proven. Result files record the exact build they ran, so a claim can't quietly mix evidence from different code.
What went wrong along the way
We publish failures alongside passes, because the failures are how the system got here.
- Lost intents. Early boards found that acknowledging a write before it was durable could lose a recorded intent in a crash. The upstream runtime fixed this with an always-on output gate, and ClawQL moved to that release.
- Expiry treated as death. A lease running out was once enough to recover an owner's work, even while that owner was frozen rather than dead. The rule is now that expiry is never proof of death.
- A grading bug. Our own test harness once counted a timed-out status check as a lost intent. It now records those as unknown, and every reclassification is published side by side with the original.
- Earlier boards that failed (versions 1 to 3) remain published with their results.
Still open
- An unexplained result. An earlier board with very short leases recorded 2 lost intents in 100 trials. One was later classified as a missed fault injection, based on the journal; the other remains unsettled.
- Recovery time. 17 seconds is the honest cost of fencing, and we want it lower without giving up correctness.
- Scope. These results are from one host, a lab build and a mock upstream service. They cover process and node crashes with the host's disks intact, not the loss of the host's disks, a zone or a region. Multi-host runs, the unmodified upstream runtime and real services are next.
- What isn't covered. Calls to services that don't accept idempotency keys can end with an unknown outcome that must be checked rather than retried. Containers' own internal state is not covered. ClawQL's own payment flows are not yet covered by these results.
Beyond one machine
Design work, not yet built or measured. See the network whitepaper §10, §11, §28A.
- Faster recovery without guessing. When a service accepts idempotency keys, any replica could safely carry out an agent's recorded intent, so recovery would no longer wait for a lease to expire. This follows leaderless consensus designs such as QuePaxa, and will be modeled formally before it is built.
- Agreement among parties who don't trust each other. For networks of independently operated nodes, consensus that tolerates malicious participants: asynchronous DAG-based protocols that never depend on timeouts, and designs that use attested hardware to need fewer replicas.
- On-chain actions. A blockchain transaction's nonce can land only once, so it serves as a natural idempotency key: ClawQL journals the signed transaction before broadcasting and checks the chain before ever resending. Finality is tracked explicitly, including chain reorganizations.
- An independent witness, optionally. For customers who want proof that does not depend on ClawQL at all, decisions can be committed on-chain, executed through Chainlink's Runtime Environment with consensus and attested enclaves, or proven with zero-knowledge proofs. These are opt-in and never the default.
Check it yourself
Everything above is reproducible from the public repository:
- Crash boards and evidence:
docs/benchmarks/program-cell-fleet-kill/ - Authorizing soak and the v4 board, with matching binary identity: soak remesure · board remesure · branch
v4-soak-mac-mini-20261106 - During-call settlement of the 2 trials:
v4-identity-remeasure-during-call-settle.json - Formal models:
formal/tla/(program resume, leases, mandates, payments)