Idempotency Is Not Recovery: A Fault-Injection Study of Language-Model Agent Tool Actions

Song Xu

This study from Song Xu at the University of Electronic Science and Technology of China tackles a critical but often overlooked aspect of AI agents: what happens when they break mid-action? As we move from agents that just "talk" to agents that "do"—updating tickets, moving money, or changing database states—the reliability of their tool calls becomes a first-order systems problem.

TL;DR

Idempotency (preventing duplicate actions) is necessary but insufficient for reliable AI agents; without a durable ledger and post-crash reconciliation, agents cannot distinguish between an action that failed and one that succeeded but lost its confirmation. This paper demonstrates that while full reliability safeguards can eliminate duplicate effects and "orphaned" actions, they come with a significant "reliability tax," reducing throughput to about one-seventh of a standard "fail-open" runtime.

What Problem Does This Paper Address?

When a language-model (LLM) agent calls a tool, a lot can go wrong: the network drops, the process crashes, or the external system times out. If the agent doesn't receive a confirmation, it faces a dilemma:

  1. Retry: Risking a duplicate action (e.g., double-charging a customer).
  2. Assume Success: Risking a "silent failure" where an action never actually happened.
  3. Stop: Leaving the system in an ambiguous state.

While "idempotency" (ensuring an operation has the same effect whether it's performed once or multiple times) is a common fix, the authors argue it doesn't solve the recovery problem. An agent might successfully suppress a duplicate, but it still won't know if the original action actually committed at the target.

Methods

The authors built a controlled agent runtime and subjected it to rigorous fault injection. They tested four primary configurations:

  • B0 (Fail-open): Volatile execution with no durable records.
  • B1 (Fail-closed): Adds authorization checks.
  • B2 (Durable Auth): Adds durable logging of authorization.
  • B3 (Full Runtime): The "gold standard" combining fail-closed auth, a durable action ledger, target-side idempotency keys, post-crash reconciliation, and sealed evidence.

They injected ten classes of faults (detailed in Figure 3 below), ranging from simple invalid authorizations to process crashes at specific "cutpoints" (e.g., after the effect happens but before the agent records it).

Table II: Declared Fault Classes and Principal Observation Focus

To track the "ground truth," they used a target-side oracle (a separate SQLite store) to record what actually happened at the destination, allowing them to compare the agent's internal state against reality. The state machine for the full B3 configuration is shown in Figure 1.

Figure 1: Simplified B3 action-record progression showing the path from proposed action to completion or unresolved outcome.

Datasets

The study didn't use a traditional ML training dataset. Instead, it used a benchmark of 24 constructed cases involving three operation types:

  1. OP1: Appending an alert record.
  2. OP2: Upserting a support ticket.
  3. OP3: Transitioning a case state based on a precondition.

They captured 96 model responses from glm-4-3-flash and deepseek-v4-1-flash to serve as the "proposals" for the agent. In total, they ran 7,513 trials across both Windows and Linux environments to ensure cross-platform reproducibility.

Key Insights and Ideas

  • Idempotency is not Recovery: This is the central thesis. Idempotency keys prevent the "double-click" problem, but they don't tell the agent the final status of a crashed request.
  • The "Orphaned Effect": Without a durable ledger (A1 ablation), the study found that actions often "orphaned"—they happened at the target, but the agent lost all record of them.
  • Reconciliation is the Missing Link: Even with a ledger, if you disable "reconciliation" (the process of checking the target after a crash), outcomes remain ambiguous. The agent knows it tried to do something, but doesn't know if it finished.
  • The Reliability Tax: Building a "bulletproof" agent isn't free. The full B3 configuration was significantly slower than the fail-open baseline, largely due to the overhead of synchronous writes to a durable ledger and evidence sealing.

Key Results

The quantitative results highlight the stark difference between a standard runtime and one designed for reliability:

  • Duplicate Suppression: In 200 crash-and-replay pairs, the full B3 configuration recorded 0/200 repeated effects, whereas simpler baselines suffered from 117/200 duplicates.
  • Recovery Success: The B3 configuration achieved a 100% recovery rate (300/300) in tested scenarios, while removing the ledger (A1) dropped success to 200/300 and resulted in 170 orphaned effects.
  • Performance Cost: The full runtime's throughput was approximately one-seventh of the fail-open baseline.
  • Ambiguity: Disabling reconciliation (A2) left 100/100 post-effect crash outcomes in an "ambiguous" state, proving that the agent couldn't resolve the status on its own.

Selected paired effects comparing the full B3 runtime against baselines are summarized in Table V.

Table V: Selected Original Paired Effects showing B3's superiority in preventing unauthorized and orphaned effects.

Limitations and Future Work

The authors acknowledge several constraints:

  • Single-Host Scope: The study focused on a single-host runtime and does not inherit the complex guarantees of fully distributed systems.
  • Controlled Environment: The "target" was a local SQLite database; real-world targets (like SaaS APIs) may not support the stable identities or idempotency keys required for these safeguards.
  • Limited Operation Types: Only three types of tool actions were tested.
  • Future Directions: The authors suggest future work should explore multi-host deployments, real-world provider outage rates, and more complex "sagas" (long-running transactions) involving multiple tool calls.

Summary updated

BibTeX
@misc{xu2026idempotency,
  author = {Song Xu},
  title = {{Idempotency Is Not Recovery: A Fault-Injection Study of Language-Model Agent Tool Actions}},
  year = {2026},
  eprint = {2611.23353},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2611.23353},
}

Loading related content...

Figure