try: charge(inv, amt)
except Timeout:
ifledger.get(inv) is None:
charge(inv, amt)
The number
Duplicates drop from 10.2% to 1.8%. Better, but not zero. The next slide shows why.
Pattern 1 · why one look isn't enough
Poll, don't peek
Pattern 2 · idempotency keys
Make every retry safe
The number
Duplicate charges: 0.0%. But a call that half-succeeds still says "ok", so 9.9% of runs are still silent failures.
Medium faults · 3,200 runs per row · seed 0
Only the combination holds
design
task success
duplicate charges
silent failures
pass^8
naive retry
80.6%
10.2%
18.3%
18.8%
verify before retry
88.2%
1.8%
11.7%
36.9%
idempotency key
89.3%
0.0%
9.9%
38.9%
key + polled verify + repair
99.8%
0.0%
0.0%
98.5%
With no faults, all four rows read 100%. Across seeds 1 to 3, cells move by about 2 points.
Pattern 3 · the unconfirmed state
Let the agent say "I can't confirm it"
for _ in range(3):
try: ledger.charge(inv, amt, idempotency_key=key)
except ToolTimeout: pass
state = poll(ledger, inv) # read back, up to 3 timesif state.count >= 1:
if not state.fulfilled: ledger.complete_fulfillment(inv)
return"success"if exactly_one_fulfilled(ledger, inv) else"unconfirmed"return"unconfirmed"# never a confident guess
At medium faults it answers "unconfirmed" on 0.2% of runs. That's the price of never lying, and it's cheap.
Recorded demo · one lost response, scripted so every run is the same
Run 1: a plain retry agent
$ python lost_response.py naive -> charge(INV-7, $100) server: charge written ... response lost <- TIMEOUT -> charge(INV-7, $100) server: charge written <- okagent says : successledger says: 2 charge(s), $200 takenverdict : SILENT FAILURE (said success, state is wrong)
Honest patches flagged: 0 of 345. Scripted cheat patches, not a measurement of any LLM.
Pattern 5 · put faults in your evals
Three faults, three intensities
fault
what the agent sees
low
medium
high
timeout after commit
a timeout; the write landed
5%
20%
35%
delayed visibility
a read-back that misses it
5%
15%
25%
partial success
"ok", with half the work done
3%
10%
15%
Rates from Mansoor, Phadke, Rana (2026), arXiv:2608.02645, Table 1. Medium is the default experiment.
Pattern 5 · pass^k over pass@1
One clean run proves almost nothing
99% per run
92%
95% per run
66%
90% per run
43%
pass^8: the chance all eight runs succeed, if runs are independent. An agent you run thousands of times a day lives here.
Pattern 5 · what it looks like in CI
Make it a gate, not a one-off
Pattern 6 · two tools to run today
MIT licensed, vendor-neutral, no API keys
agent-fault-lab · tool-call faults
# the full grid, under a second
agent-fault-lab simulate --out results
# or put a fault under a real client
agent-fault-lab proxy --fault F1:write_file@1 \
-- <your MCP server>
claim-check · "all tests pass"
# check a coding agent's claim
claim-check run --base git:origin/main \
--test-cmd "python -m pytest -q" \
--claim "All tests pass."# exit 0 VERIFIED, 1 REFUTED, 2 UNCONFIRMED
What the numbers are: scripted policies and cheats that show how a metric moves. To measure your agent, wrap its tool loop or put the proxy under its client.
Take it with you
01Verify the postcondition. Read the real state back. Poll, don't peek.
02Idempotency keys. Every retry safe. A timeout never becomes a second charge.
03The unconfirmed state. "I can't confirm it" beats a confident guess.
04A verifier out of reach. The worker can't edit what grades it.
05Faults in your evals. Inject, score two numbers, gate on pass^k.
06Two tools today. agent-fault-lab and claim-check.