date: 2026-11-08

title: "Where Exactly-Once Behaviour Lives in Tool-Using Agents"

author: Brian Taylor


Where Exactly-Once Behaviour Lives in Tool-Using Agents

When an agent write might already have happened

A tool call that returns a timeout or 5xx often does not tell the agent whether its side effect occurred. Retrying blindly can charge a card twice, send a second email, or publish a second deployment; giving up can skip required work. A 2026 study asks where exactly-once behaviour should be enforced - in the model, in the agent harness, or in the tool contract.

What LIMBO measured

LIMBO is a deterministic sandbox of six services with realistic contracts: optional idempotency keys, eventually consistent reads, missing read paths. It injects 12 fault modes at the service boundary - late commits, redelivery, partial batches, lost acknowledgements - and grades every episode against a ledger of committed effects. Across 25,930 episodes, nine models, three harnesses, two contract variants and fifteen recovery conditions, the answer depends on the fault type.

Findings that matter for real pipelines

  • When an immediate read-back can reveal what happened, the model decides. Frontier models instructed to act exactly once duplicated an action whose acknowledgement was lost about 0.5% of the time. Weaker models degraded; model quality explained 53% of variance.
  • When no read-back can resolve it (request still in flight or delivered twice), frontier models still duplicated in 56% and 74% of episodes. The tool contract explained 81% of variance in those cases.
  • No verification-only policy is exactly-once under late commits without a known bound on in-flight time. Waiting helps only when bound is short and known; with heavy-tailed delays even an hour per episode fell short.
  • Idempotency keys on every write lowered duplicate rate from 28% to 4%, because agents used them when they existed; every remaining duplicate involved a first attempt without a key or a changed key on retry.
  • The harness barely mattered; a guard that attaches keys transferred across harnesses unchanged.
  • Transparency illusion: agents reported success in 90% of episodes where they had duplicated an effect.

Practical implications

  1. Do not rely on model reasoning or a generic retry wrapper alone for ambiguous writes.
  2. Make idempotency keys first-class in every external write tool contract; generate once and pin across retries.
  3. Provide read-backs where possible; they are the model's best recovery surface.
  4. Treat a clean success report as untrusted until the ledger says no duplicate occurred.
  5. For in-flight and late commits, use persistent keys plus escalation rather than waiting on unbounded delays.

For Brian's pipelines (trend-scout discovery, email archive, content-agent, Drive sync), this reinforces stable event keys and checkpoint-after-write ordering, plus a harder lesson: after ambiguity, report uncertainty instead of silently succeeding.

Sources