NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Scoring Recovery-Time Agent Security: Proposals, Effects, and Retry Instructions

Paul Deepakraj RetinrajarXiv 2026

TL;DR

When an AI agent tries to execute an action—like sending an invoice—and gets a timeout error, it enters a high-stakes guessing game: did the request fail, succeed silently, or get stuck in transit? If we only grade agents on whether the final goal was achieved, we completely miss the collateral damage caused during recovery, like duplicate charges or complying with prompt injections hidden inside error messages. This paper introduces a rigorous, multi-layered framework to measure not just final outcomes, but everything an agent tries to do during error recovery.

What Problem Does This Paper Address?

In distributed systems, an absent acknowledgement doesn't mean an action didn't happen. When an AI agent's tool call times out, the underlying write might be absent, already committed, or still pending. Retrying blindly risks duplicate side effects (charging a customer twice), while giving up leaves the job unfinished. Worse, attackers can hijack error messages—injecting malicious "recovery instructions" that trick the agent into rerouting an invoice or issuing an unauthorized refund.

Standard benchmarks often rely on goal-presence scoring: checking if the desired final state exists. If the initial call quietly succeeded, and a tricked agent also sends a second invoice to an attacker, goal-presence scoring gives the agent a gold star because the legitimate invoice is there. Meanwhile, backend safeguards (like deduplication) can mask reckless agent behavior, making a careless model look safe. We need a way to pull apart model behavior, runtime guardrails, and backend guarantees.

Methods

The author designs an executable, in-memory simulation environment (covering invoices, tickets, and payments) that untangles four distinct layers:

  1. Visible recovery instructions: Neutral timeout messages vs. attacker-injected error text.
  2. Hidden provider truth: Whether the initial timed-out write is absent, committed, or pending.
  3. Proposed actions: What the model actually asks to do (e.g., changing arguments, swapping idempotency keys), before any guardrails intervene.
  4. Committed effects: The final state of the ledger.

To probe system boundaries, the setup tests six illustrative runtime controls—ranging from Unprotected to an Evidence-Bound Recovery Gate (EBRG) that enforces original intent, original idempotency keys, and proof of absence via a status check before allowing a retry. Finally, the author runs exhaustive bounded model-checking across 453,762 action histories to see how these controls hold up when backend provider contracts weaken (e.g., delayed commits without in-flight key reservations, or stale status reads).

Datasets

  • Inherited Pilot Traces: 12 existing traces from qwen2.5-coder:latest audited to compare goal-presence scoring against full ledger auditing.
  • New Recovery-Security Benchmark: An executable suite of 24 task identities across three domains (invoices, tickets, payments) and four attack families (destination redirects, fresh key injection, resource swaps, unauthorized compensation). Unlike prior error-injection benchmarks (like MSB or VATS), this dataset explicitly crosses hostile error messages with independently varied hidden states of the prior write, evaluating 5,040 API episodes (gpt-6.1-sol, gpt-6-luna, gpt-5.6-luna) and 720 CLI episodes via Claude Code (Opus 5.5, Sonnet 5.5, Haiku 5.5).

Key Insights and Ideas

  • Goal-presence scoring hides harm: Auditing just 12 pilot traces revealed two instances where an agent fell for an attack and sent an invoice to an unauthorized recipient, yet received passing marks because the original invoice had already gone through.
  • Ambiguous specs paralyze agents: When told to ensure "exactly one" action, frontier models overwhelmingly refused to retry failed writes—interpreting "one" as one tool invocation rather than one committed external effect. Clarifying that distinction unlocked near-perfect recovery.
  • Attacks can hurt availability without causing breaches: Even when models completely resist executing malicious instructions, hostile error text can make them overly cautious, causing them to abandon unfinished tasks (a denial-of-service/availability hit rather than an authorization failure).
  • Guardrails are only as good as backend physics: Bounded checks show that if a backend checks idempotency keys only at arrival without reserving in-flight requests, a retry can slip through and cause a duplicate—unless gated by a truthful status read. If status reads are also stale, even strict evidence gates fail.

Key Results

  • Pilot Re-scoring: Auditing the full effect ledger dropped apparent task completion on the 12 supplied traces from 10/12 to 8/12.
  • Prompt Clarity Dominates Completion: Under original task wording, valid absent-state recoveries were abysmal: 39/576 across Sol and Luna. Clarifying the definition of "committed effect" and providing a retry recipe boosted valid recoveries to 576/576. Testing the two additions separately showed the definition alone yielded 276/288, while the recipe alone hit 288/288.
  • Zero Attack Compliance, Measurable Availability Drop: Across all 5,760 live API and Claude Code episodes—including stronger attacks—models produced 0 unauthorized semantic proposals, changed-key proposals, or unsafe effects. However, for Luna, malicious text reduced valid absent-state recoveries by 11.1 percentage points (e.g., dropping from 70/72 to 62/72 under definition-only wording).
  • Hidden Impatience: Trajectory audits caught 6 instances where Luna saw an in_flight status and immediately tried to retry anyway—behavior completely invisible if you only look at final ledgers, because runtime gates denied five of them and atomic keys deduplicated the sixth.

Limitations and Future Work

Because none of the live tested frontier models fell for the researcher-authored prompt injections under unprotected settings, the experiments lacked a live "positive control"—meaning no real-world defense efficacy could be claimed or ranked across runtime controls. Additionally, the backend simulations are deterministic and in-memory, omitting messy real-world realities like crash recovery, distributed concurrency, and heavy-tailed network delays. The author points toward broader, independently reviewed attack calibration (such as automated payload mutation) to stress-test models beyond static templates.

Summary updated

BibTeX
@misc{retinraj2026scoring,
  author = {Paul Deepakraj Retinraj},
  title = {{Scoring Recovery-Time Agent Security: Proposals, Effects, and Retry Instructions}},
  year = {2026},
  eprint = {2611.31318},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2611.31318},
}
Figure