Skip to content
arXiv· arXiv:2610.16333· Yutong Zhi, Jie Zhang, Xiuqi Lu, Jiayuan Xu, Jing Shao·Indexed by this site · Originally publishedSelectedAttention41

TRAP: Tool Result Replay Attacks for Probing LLM Agent Misbinding

TRAP: Tool-result Replay Attack for Probing Misbinding in LLM Agents

Quick read

Attacks

Based on the paper PDF (generated by Gemini); refer to the original

The paper constructs the ReplayBench evaluation tool, finding incorrect result binding; 8 models across tasks have an average replay FSER of 0.649, and runtime validation can eliminate the errors.

Threat modelAn attacker (or a faulty runtime component) can associate a previously generated real tool result with an incorrect execution context while preserving content integrity (breaking the result-context binding). Ordinary runtime enforcement mechanisms remain effective; the attacker cannot directly bypass action checks or independently modify external state, and the wrong action must be generated by the target agent itself after observing the real result.

Questions
As AI agents execute long-horizon stateful tasks through external tools, tool results persist and flow through caches, queues, and recovery mechanisms. If a tool result is detached from its original execution context and misbound to an incompatible task or state, real and unmodified results can induce the agent to perform unintended actions and cause persistent state corruption.
Methods
The paper proposes a tool-result replay attack and the ReplayBench evaluation benchmark, covering 19 scenarios, 4 failure templates (attribution errors, context validity, repetition effects, causal ordering), and 3 replay mechanisms. The evaluation replays untampered real tool results and tracks the full propagation chain from delivery to final-state errors in stages.
Experiments and results
Evaluation of 8 LLMs and 3 frameworks shows an average FSER of 0.649 under cross-task replay and 0.989 across the full benchmark; the main cause of failures lies in model-side action generation. Explicit freshness and revocation prompts can reduce errors but cannot eliminate them. Three runtime defenses including call-ID binding all reduce FSER to 0.
Limitations and future work
Experiments cover 8 LLMs, 3 agent frameworks, and 19 sandbox scenarios. The main experiment evaluates each configuration with n=10 runs. Defenses are implemented only at the tool gateway and do not change model prompts; object-ID binding can only defend against T01 and fails for T03; the paper does not report defense overhead or large-scale reproduction on production distributed middleware.
Experimental setupGPT-5.5、GPT-5.6-Sol et al. · ReplayBench · FSER、DAR et al.
Evaluated models
GPT-5.5GPT-5.6-SolGPT-5.6-LunaGemini-3.8-FlashDeepSeek-V4-ProGLM-5.3Qwen3.8-MaxClaude-Opus-5
Benchmarks
ReplayBench
Metrics
FSERDARWARAARFRRecov
AI summaryand selection rationaleThe paper proposes Tool Result Replay Attacks (TRAP), calling the failure where tool results are consumed in the wrong execution context, causing agents to take unsafe actions, tool result misbinding, and releases the evaluation benchmark ReplayBench. The benchmark covers 19 application scenarios, 4 failure templates (attribution, context validity, repeated execution, causal order), and 3 replay mechanisms (persistent recovery, queue redelivery, cache recovery), spanning 4 propagation stages. Across 8 large language models, 3 agent frameworks, and 7 representative scenarios, the average final-state error rate for cross-task replay is 0.649, with 64 of 168 model-framework-scenario combinations (38.1%) reaching 1.0; when extended to the full benchmark, the average is 0.989. Model-level differences are significant, with average final-state error rates ranging from 0.019 to 0.967, and variance decomposition shows about 74% comes from model identity. Stage analysis localizes failures to model-side action generation, and models such as DeepSeek-V4-Pro and GLM-5.3 can reject prompt injection yet still accept replayed results.

The paper proposes Tool Result Replay Attacks (TRAP), calling the failure where tool results are consumed in the wrong execution context, causing agents to take unsafe actions, tool result misbinding, and releases the evaluation benchmark ReplayBench. The benchmark covers 19 application scenarios, 4 failure templates (attribution, context validity, repeated execution, causal order), and 3 replay mechanisms (persistent recovery, queue redelivery, cache recovery), spanning 4 propagation stages. Across 8 large language models, 3 agent frameworks, and 7 representative scenarios, the average final-state error rate for cross-task replay is 0.649, with 64 of 168 model-framework-scenario combinations (38.1%) reaching 1.0; when extended to the full benchmark, the average is 0.989. Model-level differences are significant, with average final-state error rates ranging from 0.019 to 0.967, and variance decomposition shows about 74% comes from model identity. Stage analysis localizes failures to model-side action generation, and models such as DeepSeek-V4-Pro and GLM-5.3 can reject prompt injection yet still accept replayed results.

Why it was selectedThe paper measures an average final-state error rate of 0.649 for cross-task replay across 8 models and 3 agent frameworks, and provides a reusable replay evaluation method.

Paper analysis

6 questions; open one to read the full answer

  1. What problem does this paper attempt to solve?

    The authors state that when real and untampered tool results in an agent runtime are misbound to a context, the agent can execute wrong actions and cause external state corruption.

    This paper attempts to address the security risks caused by contextual misbinding of real, unmodified tool results (tool-result misbinding) in tool-using agents.

    • Scenario and importance: In long-horizon and asynchronous agent workflows, tool execution results rely on runtime components such as persistent storage, caches, message queues, and checkpoints to flow between steps. System correctness requires that each result be accurately attributed to the task and execution state that generated it.
    • Gap in existing research: Existing agent security research mainly focuses on malicious input content (e.g., prompt injection, poisoned tool outputs) or execution-layer failures, and has not deeply explored the systemic risks of real, unmodified legitimate tool results being fed into incompatible contexts.
    • Core observation and hypothesis: Tool results are not just simple outputs but execution artifacts with contextual constraints; once a result is decoupled from its original execution context, even if the content is real and unmodified, the agent may mistake it for valid evidence for the current task and take incorrect actions.
    • What the paper proposes: The paper formalizes the tool-result misbinding problem and proposes the replay attack benchmark ReplayBench and three runtime validity-checking defense mechanisms implemented at the tool gateway.
    • Threat model:
      • Attacker goal: Induce the target agent to generate inconsistent actions based on misbound real tool results, causing persistent external state errors.
      • Attacker knowledge and capability: The attacker (or faulty runtime component) associates previously generated tool results with the wrong execution context while preserving content integrity; ordinary runtime enforcement checks remain in effect, and the attacker cannot directly bypass action checks or independently modify external state.
      • Victim system: Tool-using agent systems that rely on persistent state, caches, or queues to pass tool results (e.g., systems built on LangGraph, LlamaIndex, or OpenAI Agents SDK).
  2. What related research exists?

    The authors position this paper as a systematic evaluation of real, unmodified tool results being replayed across contexts, distinguishing it from existing work focused on adversarial content injection or isolated states.

    Safety of tool-using agents

    • Multi-step tool use risks: Ruan et al. (2024), Andriushchenko et al. (2025) (AgentHarm) evaluated safety risks and harmful behaviors in multi-step tool use.
    • Indirect prompt injection: Zhan et al. (2024) (InjecAgent), Debenedetti et al. (2024) (AgentDojo) studied indirect prompt injection (IPI) that manipulates agents through external content.
    • Multi-stage and protocol security: Zhang et al. (2025) (Agent Security Bench / ASB), Zong et al. (2026) (MCP-safetybench) studied broader attacks spanning prompt, memory, and execution stages. The authors note these works establish tool-mediated information flow as a core security boundary, but mainly focus on adversarial or corrupted input content.

    State, replay, and context integrity

    • Persistent memory and cross-task interference: Gao et al. (2026) (Mempoison) demonstrated the impact of stored information persisting in memory on subsequent behavior; Jaye et al. (2026) (Corpgen) studied cross-task interference in interleaved long-horizon agent execution.
    • Asynchronous calls and replay risks: Shi et al. (2026) (Asynctool) tested asynchronous tool state maintenance under concurrent tasks; Jing et al. (2025) (MCIP), Zheng et al. (2026) (Acrfence) studied replay and rollback risks in MCP systems and checkpoint recovery.
    • Formal policies and provenance: Siu et al. (2026), Wang et al. (2026), Alvarez et al. (2026) (ProvenanceGuard), Palumbo et al. (2026) formalized agent security from the perspectives of context integrity, execution provenance, and runtime policy enforcement.

    Execution-layer failure evaluation and benchmarks

    • Model state isolation evaluation: Bazinska et al. (2026) isolated and tested the fragile states of backbone LLMs, but did not trace end-to-end propagation of failures through the full execution flow.

    • Baseline methods and benchmarks: The baseline defense used as a comparison in the evaluation is Object-ID binding; the comparison attack is indirect prompt injection (IPI) with explicit instructions. The benchmark environment is ReplayBench constructed in this paper, covering 19 application scenarios.

    • Difference from existing work: The authors note that, unlike studies focusing on adversarial content injection or isolated model states, this paper systematically evaluates how real, unmodified tool results are replayed across contexts and traces the full propagation chain from delivery, action generation, and action acceptance to final state errors.

  3. How does the paper address this problem?

    The paper proposes the ReplayBench benchmark, tracking four-stage propagation through 19 scenarios, 4 failure templates, and 3 replay mechanisms, and designs three types of gateway defenses.

    The paper proposes the evaluation benchmark ReplayBench based on controlled replay to probe agent misbinding of tool results, and designs three runtime validity-check defenses implemented at the tool gateway.

    Problem Formalization and Failure Propagation

    • Misbinding formalization: Let a tool call be cs = (f, xs), generating a real result rs = f(xs) under source context Cs, with a binding function satisfying B(rs, Cs) = 1. When rs is used in a target context Ct that does not satisfy the original binding, tool-result misbinding occurs: B(rs, Ct) = 0. This formula defines the semantic invalidation of a legitimate result in an incompatible context.
    • Four-stage failure propagation model:
      1. Result delivery: The source result is successfully delivered at the runtime level and becomes visible to the agent in the target context.
      2. Wrong action generation: After observing the misbound result, the agent generates an action inconsistent with correct execution in the target context.
      3. Action acceptance: The generated wrong action passes routine checks in the downstream execution layer and is accepted for execution.
      4. Final-state error: The accepted action causes the persistent external environment state to deviate from the correct outcome of the target task.

    ReplayBench Evaluation Framework Design

    • 19 application scenarios: covering email (F01), instant messaging (F02), calendar tasks (F03), cloud drive sharing (F04), search knowledge base (F05), e-commerce orders (F06), banking payments (F07), travel logistics (F08), medical prescriptions (F09), HR payroll (F10), customer support (F11), project approval (F12), identity isolation (F13), software release (F14), cloud operations and databases (F15), security operations (F16), compliance governance (F17), IoT control (F18), and government/legal (F19), all with sandboxed tools and verifiable persistent states.
    • Four failure templates:
      • T01 (Cross-task wrong-object replay): Replays a legitimate result generated for task A into task B, which operates on a different object, violating task-result attribution.
      • T02 (Stale context replay): Reuses a previously valid result after authorization, resource state, or policy changes, violating context validity.
      • T03 (Repetition effect replay): Replays the result of an already committed state-changing operation, causing the operation to execute again, violating idempotency constraints.
      • T04 (Out-of-order replay): Delivers multiple real results in an order inconsistent with state transitions, violating causal ordering.
    • Three replay mechanisms:
      • M1 (Durable Recovery): Persists the source result to a SQLite event store, from which a recovery consumer reads and delivers it to the target task.
      • M2 (Queue Redelivery): Writes the source result to an outbound queue, from which a worker node serving the target task dequeues it.
      • M3 (Cache Resume): Stores the source result in a session checkpoint or cache, loading it when the target execution resumes.

    Runtime Validity-Check Defense Mechanisms

    • Call-ID binding: At the tool gateway, assigns a call identifier to each pending verification call; delivery is allowed only if the identifier of the returned result matches the identifier of the current pending call; otherwise, it is intercepted directly at the gateway layer.
    • One-shot tickets: Allows results to be delivered to the model but issues a single-use valid credential for each valid result; the agent must submit an unused credential when executing state-modifying actions; cross-session or already-used tickets are rejected by the gateway.
    • World-state epochs: Binds tool results to the state generation number of the referenced object; the epoch increments when the external object undergoes state transitions such as revocation, commit, or cancellation; if the epoch does not match at action submission, execution is rejected.
  4. What experiments did the paper conduct?

    Evaluation shows an average cross-task replay FSER of 0.649 with large differences across models; all three runtime defenses reduce FSER to 0 with FR of 0.

    Experimental Setup

    • Models under test: The evaluation covers 8 LLMs, including GPT-5.5, GPT-5.6-Sol, GPT-5.6-Luna, Gemini-3.8-Flash, DeepSeek-V4-Pro, GLM-5.3, Qwen3.8-Max, and Claude-Opus-5.
    • Agent frameworks: The evaluation uses 3 representative agent frameworks: LlamaIndex, LangGraph, and OpenAI Agents SDK.
    • Evaluation scenarios and benchmarks: The main experiment T01 uses 7 representative scenarios (email, calendar, files, banking, identity, DevOps, security); the full benchmark extends to 19 scenarios (including e-commerce, healthcare, HR, CRM, etc.).
    • Evaluation metrics: Final-state error rate (FSER) is the primary end-to-end metric, supplemented by delivery rate (DAR), wrong action rate (WAR), and action acceptance rate (AAR) for stage attribution; defense evaluation reports false rejection rate (FR) and recovery rate (Recov).
    • Review and verification method: All state-changing actions are executed in a local sandbox; an independent checker reloads the persistent state after execution and checks against template-specific correctness conditions to determine whether a final-state error occurred; no LLM judge scoring is used.
    • Sample size and repetitions: All experimental configurations are evaluated on n=10 valid trials by default, except sensitivity experiments extended to n=30.

    Main Results

    ModelMean FSER95% Bootstrap CI
    DeepSeek-V4-Pro0.967[0.933, 0.995]
    Gemini-3.8-Flash0.943[0.838, 1.000]
    GPT-5.50.876[0.790, 0.948]
    GPT-5.6-Luna0.843[0.738, 0.924]
    GLM-5.30.719[0.643, 0.786]
    GPT-5.6-Sol0.610[0.486, 0.733]
    Qwen3.8-Max0.219[0.124, 0.324]
    Claude-Opus-50.019[0.000, 0.048]

    (Note: Values are from Table 4, computed based on 5,000 cell bootstrap resamples; covering all 8 tested models)

    • High error rates across configurations: According to Table 1, among 168 model-framework-scenario configurations, 64 configurations (38.1%) have FSER = 1.0; the average FSER across all configurations is 0.649; across the full benchmark's 228 configurations, the average FSER reaches 0.989 (Appendix G).
    • Model dominance in susceptibility differences: According to the variance decomposition in Table 6, model identity explains 74.2% of FSER variance (η²=0.742), while framework explains only 0.7% (η²=0.007); the average FSER across the three frameworks clusters between 0.607 and 0.686 (Table 5).
    • Failure point localized to action generation: Stage analysis shows DAR is generally close to 1.0, and AAR closely tracks WAR and FSER, indicating that replayed results are almost always successfully delivered; the main divergence is whether the model uses the misbound result as a basis for action.

    Stateful Replay Templates (T02–T04) Ablation

    • Test content: Evaluates three templates that maintain object consistency (T02 context validity, T03 idempotent repetition, T04 causal ordering) in the cloud drive file-sharing scenario (F04), covering 8 models and 3 frameworks (24 configurations per template, Figure 4, Appendix E).
    • Experimental results: T02 achieves FSER=1.0 in 22/24 configurations; T03 and T04 each achieve FSER=1.0 in 21/24 configurations (Figure 4). Qwen3.8-Max has FSER=0 under T01 cross-object replay but rises to 1.00 under T02–T04. Across the full benchmark's 19 scenarios, GPT-5.5 has FSER=1.00 in all 171 configurations under T02–T04 (Table 8).
    • Authors' interpretation: The authors note that maintaining object consistency alone does not guarantee result validity; agents without context binding cannot recognize changes in environment state or causal ordering.

    Effects of Similarity, Freshness, and Environment Changes on Replay

    • Test content: Independently controls task similarity, object similarity, result freshness visibility, and environment changes with GPT-5.5 + LlamaIndex under T01 (Figure 5, Table 10, Table 11, Appendix I).
    • Experimental results: In the email scenario, high/medium task similarity yields FSER of 0.80–1.00, dropping to 0 with low similarity; in the cloud drive scenario, FSER remains 1.00 even with low task similarity; object similarity shows no clear association with FSER (Table 10). Highly stale results with explicit freshness fields reduce WAR, AAR, and FSER from 1.00 to 0.60, while implicit hiding keeps them at 1.00 (Table 11). Under implicit environment changes, FSER remains 1.00; explicit notification of authorization revocation reduces FSER to 0.20 (Figure 5c).
    • Authors' interpretation: The authors believe the effect of task similarity is scenario-dependent, object similarity has no direct association; explicit cues help identify invalidity evidence, but models cannot reliably infer temporal validity.

    Runtime Defense Evaluation and Replay vs. IPI Comparison

    • Test content: Evaluates three defenses—call-ID binding, one-shot tickets, and world-state epochs—with GPT-5.5 + LlamaIndex in F01 and F04 scenarios (Table 2, Figure 6); compares real replay with indirect prompt injection (IPI) (Table 12, Table 13).
    • Experimental results: All three defenses achieve FSER=0, FR=0, and Recov=1.0 (Table 2). Call-ID binding intercepts at the delivery stage (DAR=0), while one-shot tickets and world-state epochs allow delivery (DAR=1) but intercept before action acceptance (AAR=0). In contrast, the object-ID binding baseline yields FSER=1.0 under T03 repeated replay (Appendix K). In the IPI comparison, DeepSeek-V4-Pro and GLM-5.3 have FSER of 0.60–1.00 under replay but FSER=0.00 under IPI (Table 12).
    • Authors' interpretation: The authors note that FSER=0 arises from different intervention points (blocking before delivery vs. intercepting before mutation); models can reject IPI payloads containing explicit instructions but still adopt untampered replayed results, indicating that robustness to prompt injection is insufficient to prevent misbinding of real results.

    Additional Ablations and Analyses

    • Replay transport mechanisms (Table 7): With GPT-5.5 in F01 and F04, M1 (durable recovery), M2 (queue redelivery), and M3 (cache resume) all achieve DAR=1.0, with FSER ranging from 0.70 to 1.00.
    • Trial count sensitivity (Table 9): With GPT-5.5 at n=10 vs. n=30, email FSER changes from 0.80 to 0.93, cloud drive from 0.70 to 0.87, calendar remains 1.00; Qwen3.8-Max increases slightly from 0.00 to 0.07.
    • Variance decomposition (Table 6): Model factor explains 74.2% of FSER variance (η²=0.742), framework only 0.7% (η²=0.007), scenario 6.0% (η²=0.060).

    Negative Results and Exceptions

    • Claude-Opus-5 shows the lowest average FSER (0.019) in T01, but some configurations under T02/T04 in F04 still reach FSER of 0.70–1.00 (Figure 4).
    • Explicit revocation authorization prompts do not fully eliminate errors; FSER remains at 0.20; the authors found that in specific cases the model still directly calls tools without mentioning the revocation information (Appendix I.3).
    • The object-ID binding baseline completely fails on same-object repeated replay (T03), with FSER reaching 1.0 (Appendix K).
  5. What are some points that can be further explored?

    The authors note that the replay mechanism is a controlled implementation of representative paths and that defenses are implemented only at the gateway. The experiments cover 8 models, 3 frameworks, and 19 scenarios.

    Limitations and future directions noted by the authors

    • Replay paths are controlled implementations: The authors note that the persistent recovery, queue redelivery, and cache recovery implemented in the evaluation are controlled implementations of representative replay paths, not full replicas of three production-grade middleware systems (Section 3.1.3, Appendix F).
    • Defenses limited to the tool gateway: The authors note that all three evaluated runtime defenses are implemented directly at the tool gateway without changing model-side prompts (Section 4.3, Appendix K).
    • Freshness cues not in the main protocol: The authors note that the freshness metadata field is introduced only as a controlled ablation variable, is not included in ReplayBench's main evaluation protocol, and explicit cues cannot reliably eliminate replay abuse (Section 4.2.3, Appendix I.2).
    • Call for explicit context binding: The authors call for establishing explicit context binding mechanisms in tool-using agent runtimes to ensure tool results remain valid for the current execution before being consumed (Abstract, Section 5).

    Experimental coverage

    • Models and frameworks tested: The experiments cover 8 LLMs (GPT-5.5, GPT-5.6-Sol, GPT-5.6-Luna, Gemini-3.8-Flash, DeepSeek-V4-Pro, GLM-5.3, Qwen3.8-Max, Claude-Opus-5) and 3 agent frameworks (LlamaIndex, LangGraph, OpenAI Agents SDK).
    • Application scenario coverage: The main experiment T01 covers 7 representative scenarios, and the full benchmark extends to 19 scenarios.
    • Evaluation sample size: Each configuration is evaluated with n=10 valid trials, except sensitivity experiments extended to n=30.
    • Templates and replay mechanisms: The evaluation includes 4 failure templates (T01 to T04) and 3 controlled replay mechanisms (M1, M2, M3).
    • Metrics not reported in the paper: The paper does not report large-scale concurrent reproduction on production-grade distributed middleware, network latency and throughput overhead, or the impact of generation hyperparameter variations such as sampling temperature on FSER.
  6. Summarize the main content of the paper

    The paper proposes ReplayBench evaluation and gateway runtime defenses against agent tool-result misbinding, noting that the runtime must establish explicit context binding.
    1. Research positioning: This study targets tool-using agent systems and proposes a replay attack study and evaluation benchmark, ReplayBench, that probes contextual misbinding of real, unmodified tool results.
    2. Problem to solve: In long-horizon and asynchronous execution, agents rely on caches, queues, and recovery components to route tool results. When results are detached from their original context and misused for other tasks or states, the agent mistakes them for valid evidence and produces persistent external state errors.
    3. Method highlights: The paper formalizes misbinding and establishes a four-stage failure propagation model (delivery, action generation, action acceptance, state error), builds a sandboxed benchmark covering 19 application scenarios, 4 failure templates, and 3 replay mechanisms, and proposes three categories of gateway runtime defenses.
    4. Main experimental findings:
      • Under T01 cross-task replay, 8 LLMs and 3 frameworks achieve an average FSER of 0.649 (Table 1), and the full benchmark average FSER is 0.989 (Table 8), with 38.1% of configurations showing FSER=1.0.
      • Model identity explains 74.2% of FSER variance (Table 6); DeepSeek-V4-Pro has an average FSER of 0.967, while Claude-Opus-5 is only 0.019 (Table 4).
      • Under the T02–T04 stateful templates that remove cross-task object differences, models still reach FSER=1.00 in the vast majority of configurations in the cloud drive scenario (Figure 4).
      • Call-ID binding, single-use tickets, and world-state epoch defenses all reduce FSER to 0 with FR of 0 and Recov of 1.0 (Table 2).
    5. Author conclusion: The authors believe the root cause of replay failures lies mainly in model-side action generation; robustness to prompt injection alone cannot defend against misbinding of real results, so agent runtimes must introduce explicit contextual validity binding mechanisms.
Read originalarxiv.org