WorksComputer Science
TRACER: Trace-Regularized Training Against Indirect Prompt Injection
Abstract
Indirect prompt injection uses untrusted retrieved content, tool outputs, or agent messages to override an LLM's intended behavior. We show that defense robustness is channel-conditioned: the same attack succeeds 18% of the time as a follow-up message but 53% when placed in retrieved context. We propose TRACER (Trace-Regularized Adversarial Channel Exposure with Reward-shaping), a channel-aware adversarial training method that samples presentation wrappers and combines an answer-anchored, evidence-gated reward with ATRC, which aligns attacked reasoning with clean evidence when an injection is invalid. On GSM8K with Qwen2.5-3B-Instruct, TRACER reduces RAG-framed ASR from 65.5% to 6.1% while preserving 78-82% clean accuracy. Joint RAG+tool training achieves 13.9% average ASR across framings at 3B scale, while a single epoch at 7B reaches 9.4%. These results demonstrate that robust defenses must explicitly train and evaluate across deployment channels.
Introduction
Modern LLM systems rarely operate on trusted prompts alone. Retrieval-augmented generation (RAG) pipelines ingest documents from search or knowledge bases [23, 14]; tool-using assistants consume API outputs [31, 30]; and LLM agents act on observations from interactive environments [26] and on messages from other agents [24]. In each case, the model must act on text that it did not author and cannot fully trust. This creates the setting for indirect prompt injection: malicious instructions hidden inside external content rather than entered as direct user prompts [15].
A central but under-tested assumption in this literature is that robustness transfers across presentation channels. If the same malicious payload is tolerated as a conversational follow-up, will it also be tolerated when wrapped as a retrieved document, a tool response with provenance metadata, or a message from another agent? Existing defenses are usually trained and evaluated within a single wrapper, so this question is rarely isolated directly.
We begin by empirically testing this transfer assumption. Specifically, we ask whether a model trained to resist malicious instructions in one presentation channel remains robust when the same attack content is re-wrapped in another. The answer is no: across six intermediate model snapshots trained against follow-up-style attacks, simply re-wrapping the same attack strings as retrieved documents increases average ASR from 18% to 53%. The base model also exhibits a strong authority gradient, where the same payload is less effective as a casual follow-up than as a document, tool output, or agent message. We call this phenomenon the framing gap.
To address this gap, we propose TRACER (Trace-Regularized Adversarial Channel Exposure with Reward-shaping), a deployment-matched adversarial training framework that treats the channel of untrusted context as part of the optimization problem. TRACER combines a three-turn robustness game with two training components designed for indirect injection: an answer-anchored, evidence-gated composite reward for the post-attack response, and ATRC, a committed-span Adversarial Trace Recovery and Consistency loss that aligns attacked reasoning to clean anchor spans when injected evidence is invalid. This lets us ask not only whether a defense works in one wrapper, but whether the learned robustness transfers across wrappers with different authority cues. Our key contributions are:
Figure 1. Left: the same malicious payload is injected through different untrusted-context channels. Middle: changing only the wrapper creates a framing gap; apparent authority/provenance cues are one possible explanation for the measured effect. Right: TRACER trains on channel-sampled three-turn games using an answer-anchored, evidence-gated reward and ATRC trace alignment, and evaluates both native robustness and cross-framing transfer.
Framing gap. We identify and quantify a channel-conditioning effect in indirect prompt injection: identical adversarial content becomes substantially more successful when presented through a different untrusted-context channel.
Channel-aware training. We introduce TRACER, an adversarial training framework that combines wrapper-sampled channel exposure, an answer-anchored evidence-gated reward, and a committed-span ATRC trace-alignment loss to preserve clean reasoning under invalid injected evidence.
Cross-framing evaluation. We show that transfer across wrappers is asymmetric, revealing a depth–breadth trade-off between native robustness and generalization. Multi-framing training gives the best 3B average performance, while 7B models substantially reduce the trade-off.
Related Work
Indirect prompt injection and benchmarks. Indirect prompt injection was first highlighted as a practical threat to LLM-integrated applications by Greshake et al. [15]. Subsequent benchmarks broaden the attack surface from single applications to agents, dynamic environments, and web-native settings, including BIPIA, InjecAgent, AgentDojo, ASB, WASP, and Hidden-in-Plain-Text (Yi et al., [43]; Zhan et al., [47]; Debenedetti et al., [10]; Zhang et al., [48]; Evtimov et al., [13]; Guo and Wei, [17]). Our work is complementary to these benchmarks: rather than introducing another environment, we isolate one factor that cuts across them all, namely the wrapper through which untrusted content reaches the model.
RAG robustness, poisoning, and attack design. A related literature studies how retrieved context can be noisy, conflicting, or poisoned. ConflictQA, RGB, and PoisonedRAG evaluate failures under contradictory or corrupted retrieval (Xie et al., [42]; Chen et al., [1]; Zou et al., 2025). More recent work explores realistic indirect injections such as TopicAttack (Chen et al., [4]). These studies mainly treat robustness as a property of a fixed pipeline. By contrast, we vary the presentation channel while holding the underlying payload fixed, allowing us to ask whether learned robustness generalizes across wrappers.
Defenses. Existing defenses include prompt/data separation with structured instruction tuning (Chen et al., [2]), data marking at inference time (Hines et al., [19]), alignment-based training such as SecAlign (Chen et al., [3]), and runtime detector, re-execution, parsing, or correction defenses such as MELON, CaMeL, instruction detection, robustness-via-referencing, PromptArmor, tool-result parsing, ICON, and AttriGuard ([49, 9, 41, 5, 34, 44, 39] (He et al. 2026)). These approaches usually harden a fixed pipeline or add an auxiliary inference-time module. Our focus is complementary: we study how the base model itself can be trained to maintain correct post-attack behavior when identical malicious content arrives through different untrusted channels.
Reinforcement learning for reasoning. RL with verifiable rewards, most prominently GRPO, is now a standard way to improve LLM reasoning ([33, 16, 45]), alongside process rewards for individual steps ([25, 40]). Follow-up work encourages exploration and diversity ([8, 6, 35, 37, 28]) or lets several models reason and learn together ([12, 36, 29, 38, 27]). These methods improve reasoning on clean inputs; TRACER instead uses the clean reasoning trace as an anchor that attacked reasoning must stay consistent with when injected evidence is invalid.
How prompt-injection defenses should be evaluated. Recent evaluations argue that prompt-injection defenses should be assessed jointly on security and utility, and against adaptive attacks rather than only static strings ([21, 46]). Our framing-gap analysis fits that agenda: a defense that appears robust in one wrapper may fail badly in another even when the adversarial payload is unchanged. We therefore emphasize cross-framing transfer, final-checkpoint comparisons, and conditional ASR rather than only a single in-channel score.
TRACER
Problem setup. Let denote a task dataset, where is the user task and is the gold answer. Let denote adversarial content, and let denote the channel through which this content is presented. In our experiments,
We write for the channel-specific rendering of the same adversarial payload. Thus, the malicious instruction is held fixed while only its presentation channel changes.
For a policy , let
be the answer extracted from the clean response, and let
be the answer extracted after adversarial content is introduced through channel . We report three empirical quantities:
Here measures clean task performance, measures post-attack accuracy under channel , and measures conditional attack success rate. The conditioning is important: an example counts as a successful attack only when the model solved the task before seeing the injected content and failed after seeing it. This separates genuine injection-induced failures from ordinary task errors.
For a model trained on channel set , we define the cross-channel transfer gap from a training channel to an evaluation channel as
A positive value indicates that robustness learned under does not fully transfer to . In other words, the model has learned channel-specific skepticism rather than channel-invariant robustness.
Threat model. We consider indirect prompt injection in which the attacker can modify only untrusted external context. The attacker cannot modify the original user task, hidden system or developer instructions, model weights, training procedure, or evaluation harness. The defender must therefore solve a semantic-control problem: the model should use external context as evidence when it is relevant and valid, but should not treat adversarial text inside that context as an instruction to obey. This threat model covers retrieved documents, tool outputs, and messages from other agents. These channels are especially challenging because their surface form often carries implicit authority even though their contents may be untrusted.
Three-turn robustness game. Each training episode is formulated as a three-turn robustness game. First, the model receives the clean task and produces a clean reasoning trace and clean answer . Second, the same adversarial payload is rendered through a sampled channel as . Third, the model produces a post-attack reasoning trace and answer .
The central design choice is that the channel is sampled as part of training:
This allows TRACER to instantiate both single-channel specialists, such as RAG-only training with , and multi-channel training, such as joint RAG+tool training with . The wrapper is therefore not an evaluation afterthought; it is a random variable in the training objective.
Composite post-attack reward. TRACER assigns reward only to the post-attack response. The reward is designed to encourage contextual skepticism: the model should preserve a correct answer when injected evidence is invalid, but should still be able to revise its answer when new evidence is valid. For a single training episode, the scalar reward is
The five terms correspond to answer correctness, process quality, anchor retention, evidence-gated corrigibility, and length control 1. We describe the reward terms for a single episode and omit the example index . The answer term rewards post-attack correctness:
The process term rewards local validity of the post-attack reasoning trace:
where denotes the reasoning steps extracted from the post-attack trace and scores whether step is locally valid.
The anchor-retention term measures whether propositions from the clean trace remain supported after the attack. Let be the set of anchor propositions extracted from the clean trace. We use a verifier that assigns support and contradiction scores, denoted and , respectively. The anchor-retention reward is
The corrigibility term is evidence-gated. Let and denote clean and post-attack correctness, and let indicate whether the external evidence introduced through channel is valid. We write
where assigns positive reward when the model preserves a correct answer under invalid evidence or corrects itself under valid evidence, and assigns negative reward when invalid evidence flips an otherwise correct answer. Appendix B gives the full truth table. This term is what prevents the reward from collapsing into blanket refusal: the model is rewarded for resisting invalid evidence, but not for ignoring genuinely useful evidence.
Finally, the length-control term discourages unnecessary post-attack verbosity while avoiding a penalty for incorrect answers:
This reward differs from answer-only supervision in two important ways. First, it distinguishes robustness from blanket refusal: the model should preserve its answer when external evidence is invalid, but should still revise when the evidence is valid. Second, it makes the clean reasoning trace part of the optimization target, which matters in reasoning tasks where an attack may corrupt intermediate steps rather than only the final answer.
ATRC: Adversarial Trace Recovery and Consistency. The second algorithmic ingredient is ATRC, a trace regularizer that preserves clean reasoning under invalid evidence. For example , let denote the set of committed response positions induced by anchor spans in the clean trace . Let
be the evidence gate. The gate activates ATRC only when the clean response is correct and the injected evidence is invalid. This prevents the method from forcing the model to preserve an incorrect clean trace or to ignore genuinely valid evidence.
Let and denote the clean and post-attack token distributions at response-relative position , and let be the clean target token at that position. We define the per-token ATRC loss as
The full ATRC regularizer is then
The KL term preserves the clean distribution over the vocabulary, while the token-recovery term encourages exact recovery of committed clean tokens. The stop-gradient operator treats the clean distribution as a fixed target. The implementation aligns clean and post-attack responses by response-relative position before applying ; this alignment is necessary because the attacked prompt contains additional channel-rendered context before the model response begins.
Overall training objective.
The policy is optimized with GRPO [33] and ATRC regularization. For a channel-sampling distribution over training channels , the objective is
where is the composite reward in Equation (5), computed from the post-attack response generated after rendering through channel . A training step with TRACER is given in Algorithm 1.
The optimizer itself is standard GRPO. The novelty lies in the training objective: TRACER treats the presentation channel as a sampled training variable, uses a structured post-attack reward rather than answer-only correctness, and adds a response-aligned trace loss over committed clean reasoning spans, as shown in Figure 2. This makes robustness channel-aware: the model is trained not only to answer correctly after an attack, but also to preserve valid clean reasoning when untrusted content arrives through different deployment channels.
Figure 2. TRACER: The method samples a task, payload, and channel; generates clean and post-attack traces; computes the composite reward; applies ATRC on committed clean spans when the gate is active; and updates with the post-attack objective.
Experimental Setup
We primarily train Qwen2.5-3B-Instruct with 4-bit QLoRA (Qwen Team, 2024; Dettmers et al., Algorithm 1 TRACER Training
Sample a batch , adversarial payloads , and channels
Generate clean traces and answers from
Form the clean dialogue prefix
Render each payload through its sampled channel as
Generate post-attack traces and answers from
Compute the composite reward
Extract clean anchors and build the committed-position mask
Construct the ATRC gate
Align clean and post-attack logits by response-relative position and compute over
Update with the GRPO post-attack objective, KL regularization, and ATRC
2023; Hu et al. [20]); we also report a 7B scaling study. The main training task is GSM8K (Cobbe et al. [7]), using 2,000 training examples and 200 evaluation examples per checkpoint. Evaluation wrappers are follow-up, RAG, tool-output, and agent-message.
Attacks. We evaluate three malicious attack families. Reasoning rewrite tries to replace the model’s solution path with an alternative chain of reasoning. Preemptive answer presents a supposedly verified final answer. Prompt injection issues explicit instructions to ignore prior reasoning or higher-level intent. Train and evaluation tasks are disjoint; additional tests use held-out paraphrases and defense-aware attacks. Training also includes a 15% benign ratio so that robustness is not achieved by unconditional refusal. Appendix § 8 details the split and adversarial construction.
Training protocol. The main 3B configuration uses three epochs, learning rate , batch size 1, gradient accumulation 8, group size 4, KL coefficient 0.10, ATRC weight 0.10, and vLLM-accelerated rollouts (Kwon et al. [22]). We train channel specialists for RAG, tool-output, and agent-message framing, plus a joint model that alternates between RAG and tool framings. Full hyperparameters appear in Appendix § 15. Unless otherwise stated, cross-framing comparisons use final checkpoints for every specialist model. This avoids comparing a cherry-picked best checkpoint for one channel against a final checkpoint for another. When we analyze optimization dynamics, we separately report checkpoint-level curves and the best intermediate checkpoint reached during training.
Evaluation protocol. For transfer experiments, the adversarial payload is held fixed and only the wrapper changes. This separates “learning the content of an attack” from “learning the channel through which that content arrives.” Together, the evaluation axes let us answer three distinct questions: does framing create a real failure mode, does TRACER close the deployment-matched gap, and how well does the learned robustness transfer beyond the native channel?
Terminology and metric boundary. We use channel for the source or pathway by which untrusted context enters the model, wrapper for its concrete textual rendering, and framing gap for the change in ASR when a fixed payload is re-rendered through another channel. Evidence validity is labeled by construction; training-only step and anchor verifiers do not enter reported accuracy or ASR, which depend only on final-answer correctness. Appendix § 8 documents their implementation and audit.
Results and Analysis
We organize the results around the paper’s three-part claim: a scientific diagnosis of the framing gap, an algorithmic validation of the reward and trace-regularized TRACER objective, and an empirical characterization of transfer across channels.
The framing gap is large and consistent. Figure 3 shows two complementary views of the problem. The left panel measures base-model vulnerability by framing and reveals a clear authority gradient: for prompt injection, ASR rises from 70% under casual follow-ups to roughly 92–96% under agent, tool, and RAG wrappers. The right panel isolates transfer failure directly. Across six intermediate model snapshots trained only against follow-up-style attacks, merely switching to RAG presentation raises average ASR from 18% to 53% (+35 pp).

Figure 3. The framing gap. Left: the base model is much more vulnerable when the same attack appears inside a more formal wrapper, revealing an authority gradient. Right: six checkpoints trained only on follow-up attacks fail to transfer to RAG evaluation even when the attack payload is unchanged.
This result has a direct deployment implication. A model hardened against conversational follow-up attacks should not be assumed robust in a RAG pipeline, a tool-using assistant, or a multi-agent system. Robustness learned under one wrapper is often robustness to that wrapper, not to the underlying attack content.
We use “authority” as an interpretive shorthand, not as an isolated causal conclusion. Formatting, content position, provenance markers, and instruction-tuning priors also change with the wrapper and may contribute to the measured gap. The controlled claim is that the channel-specific rendering changes ASR while payload content is held fixed.
TRACER closes the native RAG vulnerability. We next train directly in the deployment-matched RAG wrapper. Under held-out RAG evaluation, the 3B final checkpoint reduces ASR from 65.5% (base model) to 6.1%. Figure 4 shows the full checkpoint trajectory: the sharpest gains appear between the late first epoch and early second epoch, and the best intermediate checkpoint reaches 3.8% ASR while maintaining clean accuracy in the same 78–82% band as neighboring checkpoints.

Figure 4. RAG training trajectory across model snapshots. Clean accuracy stays near 78–82% while robust accuracy rises from 38% to above 80%. The best intermediate model snapshot reaches 3.8% ASR.
The gain is not merely a reduction in average failures. Figure 5 shows that prompt-injection attacks drop from 77.5% to 2.3% ASR, while preemptive-answer attacks drop from 54.5% to 3.4%. Because ASR is measured only on examples the model solved in the clean condition, this improvement cannot be explained away as capability loss alone. The model still solves the task and becomes far less willing to obey injected content.

Figure 5. Per-attack effects of RAG-framed training. Prompt injection is both the most dangerous attack and the one most reduced by TRACER.
This is the main algorithmic win of TRACER. The wrapper exposes the model to deployment-matched authority cues; the composite reward makes post-attack correctness, anchor retention, and evidence-sensitive revision directly valuable; and ATRC discourages the model from drifting away from clean anchor spans when the injected evidence is invalid.
Stress tests, mixed evidence, and component attribution. Table 1 consolidates the evaluations added to test the security boundary and isolate the method components. On held-out paraphrases, TRACER retains 10.0% ASR versus 62.7% for the base model, showing that the result is not explained by exact-template recognition. Channel-aware escalation and defense-aware attacks are stronger, raising TRACER to 18.1% and 23.8% ASR, respectively, but the corresponding baselines remain 68.8–70.0%. Thus, TRACER substantially narrows adaptive vulnerability without claiming immunity to a fully optimized white-box adversary.
| (a) Attack generalization | (b) Objective ablation | (c) Valid evidence + injection | |||||||||
| Setting | Base | TRACER | Variant | ATRC | ASR | Channel | Ev. acc. | Base flip | TRACER flip | ||
| Original | 65.5 | 6.1 | Base | no | 65.5 | RAG | 83.0 | 58.1 | 13.8 | ||
| Held-out paraphrase | 62.7 | 10.0 | Answer-only | no | 21.3 | Tool | 82.5 | 52.5 | 17.5 | ||
| Channel-aware | 68.8 | 18.1 | Composite reward | no | 13.8 | Agent | 81.0 | 46.3 | 16.3 | ||
| Defense-aware | 70.0 | 23.8 | Full TRACER | yes | 6.1 |
Table 1. Stress tests and attribution (ASR in %). (a) Generalization beyond the original RAG templates. (b) Direct objective ablations under RAG evaluation. (c) Mixed-evidence evaluation, where useful channel content also contains an injection; “flip” is conditional ASR from a correct clean-evidence response.
The direct ablation rules out channel exposure as the sole explanation: answer-only training reaches 21.3% ASR, the composite reward lowers this to 13.8%, and ATRC further lowers it to 6.1%. The mixed-evidence evaluation addresses blanket context rejection. Clean/evidence accuracy remains 81.0–83.0%, while injection-induced flip rates fall from 46.3–58.1% for the base model to 13.8–17.5% with TRACER.
The principal uncertainty estimates support the large framing-gap claim. Follow-up evaluation is 18.0% ASR (173/960; Wilson 95% CI [15.7, 20.6]), whereas RAG evaluation is 53.0% (509/960; [49.9, 56.2]). For native RAG, the base model is 65.6% (99/151; [57.7, 72.7]) and TRACER is 6.1% (10/164; [3.3, 10.9]). We do not claim that smaller differences among structured wrappers are all statistically distinct.
Cross-framing transfer reveals a depth–breadth trade-off. The full picture emerges when we evaluate trained models across multiple framings. Figure 6 shows three distinct regimes. First, the untrained 3B base model exhibits a strong authority gradient: ASR is lowest for casual follow-ups (41.4%) and highest for retrieved documents (65.5%), with tool outputs and agent messages in between. Formal wrappers make attacks more persuasive.

Figure 6. Cross-framing transfer at 3B scale. Gold boxes mark native training framing(s). RAG-specific training yields the deepest native defense, tool-output training yields the flattest profile, and multi-framing training gives the best average performance.
Second, RAG-specific training yields the deepest native defense but relatively weak transfer: the 3B RAG specialist reaches 6.1% on RAG yet remains at 25.7% and 26.5% on tool and agent framings. Tool-output training shows the opposite pattern: its native ASR is higher (15.0%), but it is nearly flat across all four framings (15.0–20.2%). In other words, RAG training learns depth, whereas tool training learns breadth.
Third, multi-framing training partially resolves this trade-off. The joint RAG+tool model achieves the best 3B average ASR (13.9%) and even slightly improves native RAG robustness over the final RAG specialist (5.2% vs. 6.1%). This suggests that broader channel coverage during training helps the model acquire a more transferable notion of “untrusted external context.” Hence, transfer asymmetry shows that robustness is not one-dimensional: strong in-channel defense can coexist with cross-channel brittleness. Single-wrapper evaluation therefore misses the depth–breadth trade-off.
Ablations, scaling, and broader transfer strengthen the story
Three additional results sharpen the main claim. First, the RAG wrapper and the RAG-specific system prompt are complementary: using both yields 5.5% ASR, compared with 10.0% for wrapper-only, 11.3% for prompt-only, and 60.5% for neither (Appendix F). This supports the view that deployment-matched robustness depends on both structural cues and the surrounding instruction context.
Second, the phenomenon persists but becomes easier to mitigate at larger scale. The 7B base model already shows a milder authority gradient than the 3B base, and a single epoch of RAG training reaches 9.4% average ASR across the four framings, outperforming the best 3B system. Evaluation-only diagnostics on Llama-3.1-8B-Instruct, Gemma-2-9B-It, and Mistral-7B-Instruct also exhibit 22.0–24.7 pp framing spreads (Appendix A). The final 7B model reaches 10.8% average ASR, indicating that most of the gain is realized early and that early stopping may be preferable when transfer, rather than only native-channel ASR, is the target.
Third, we test transfer beyond the GSM8K training domain. On RAG-framed Natural Questions and TriviaQA, framing-aware models retain relatively low ASR, but clean accuracy remains low for 3B models, indicating that robustness transfers more readily than task-specific competence. In other words, the model can learn to be skeptical of untrusted context before it becomes broadly strong at every downstream task.
These results show that indirect prompt-injection robustness is channel-conditioned: changing only the wrapper can substantially change attack success. TRACER improves robustness by training on the channel that carries untrusted context, rather than treating the wrapper as an evaluation detail. Cross-channel evaluation further reveals a depth–breadth trade-off hidden by single-wrapper reporting: specialized training is strongest in-channel, whereas multi-channel training transfers better across deployment framings.
Conclusion
We study indirect prompt injection as a channel-conditioned robustness problem. Holding payloads fixed, we find that a model trained on malicious follow-up messages remains vulnerable when the same attacks are rendered as retrieved context, increasing ASR from 18% to 53%. We introduce TRACER, which samples presentation channels during training and combines composite post-attack rewards with ATRC trace regularization. On GSM8K with Qwen2.5-3B-Instruct, TRACER reduces RAG-framed ASR from 65.5% to 6.1% while maintaining 78–82% clean accuracy; joint RAG+tool training further achieves the best 3B cross-channel average ASR of 13.9%. Held-out, adaptive, and mixed-evidence evaluations preserve substantial gains while exposing a clear residual attack surface. These results show that defenses should train on deployment-matched framings, report cross-channel transfer, and remain paired with runtime safeguards.
Limitations
Our primary attacks are template-based and designed to hold the adversarial payload fixed while varying the channel. This supports a clean measurement of the framing gap. Held-out paraphrases and a targeted defense-aware suite broaden the test, but do not cover arbitrary optimization-based or multi-turn adversaries. In addition, the framing-gap diagnostic spans several model families, whereas full TRACER training is evaluated within Qwen2.5 at 3B and 7B scale. Broader architectures, tasks, seeds, and adaptive strategies remain important next steps. Further, TRACER is a training-time defense. It is complementary to inference-time safeguards such as retrieval filtering, tool-output parsing, policy monitors, and sandboxing. We expect the strongest deployed systems to combine channel-aware robust training with such runtime protections.
Ethical Considerations
This work studies indirect prompt injection, a security-relevant failure mode in LLM systems. The research has dual-use aspects: the same attack templates used to evaluate robustness could be adapted to probe deployed systems. To reduce this risk, our experiments use controlled task settings and synthetic template-based injections rather than targeting real users, private data, or production services. The primary purpose of the attack construction is to measure and improve robustness under different presentation channels.
The proposed method is intended as a defensive training procedure. It may reduce susceptibility to malicious retrieved documents, tool outputs, and agent messages, but it should not be viewed as a complete security boundary. In deployment, channel-aware robust training should be combined with runtime safeguards such as retrieval filtering, tool-output validation, monitoring, sandboxing, and least-privilege tool access. We also note that overly aggressive defenses can harm usefulness by causing unwarranted refusal or distrust of valid evidence. Our reward design explicitly separates invalid-evidence resistance from valid-evidence correction to mitigate this risk.
Camera-ready evaluation additions
This section records the additional controls requested during author–reviewer discussion. They refine the scope of the main claim without changing the original training objective or evaluation protocol.
Attack construction and split
The train and evaluation sets use disjoint GSM8K task instances. The high-level attack families are shared intentionally so that cross-channel experiments vary the presentation pathway rather than the attack taxonomy. Held-out evaluation additionally changes the surface form through templates and paraphrases not used in training. The targeted adaptive suite strengthens wrapper provenance cues and explicitly references the defense’s expected behavior.
The original result should therefore be read as controlled robustness to known or family-matched attacks, not as robustness to arbitrary attacks. Held-out paraphrases show that the gain is not exact-string memorization. The stronger adaptive results identify the remaining attack surface and motivate combining TRACER with runtime safeguards.
Training signals and verifier audit
Evidence validity is a ground-truth construction label attached when an episode is generated; it is not inferred from the policy output. The step scorer segments the post-attack trace and applies the training verifier/rules to local reasoning steps. The anchor verifier checks whether propositions extracted from the clean trace remain supported or are contradicted in the attacked trace. These two signals affect reward computation only. Final-answer extraction compares the normalized answer with the gold label and is the only learned-output judgment used by reported clean accuracy, robust accuracy, and ASR.
The objective-ablation panel in Table 1 further separates the sources of improvement: answer-only channel exposure reaches 21.3% RAG ASR, the composite reward reaches 13.8%, and ATRC reduces the final result to 6.1%.
Statistical uncertainty and denominators
Because ASR is conditioned on clean correctness, its denominator is the number of clean-solved examples, not the full evaluation set. Table 5 reports the supplied exact counts and Wilson intervals for the headline comparisons. The large follow-up-to-RAG transfer gap remains well separated; small pairwise differences among structured wrappers should not be interpreted as a strict ordering.
| Result | ASR | Successes/denom. | Wilson 95% CI |
| Follow-up eval. average | 18.0% | 173/960 | [15.7, 20.6] |
| RAG eval. average | 53.0% | 509/960 | [49.9, 56.2] |
| Base RAG | 65.6% | 99/151 | [57.7, 72.7] |
| TRACER RAG | 6.1% | 10/164 | [3.3, 10.9] |
Table 5. Conditional-ASR denominators and uncertainty. Minor differences between aggregated and plotted percentages arise from the reporting granularity of the corresponding evaluations.
For the held-out and defense-aware TRACER evaluations, the corresponding exact outcomes are 16/160 (10.0%) and 38/160 (23.8%), respectively.
Mixed valid evidence and embedded injection
The original three-turn protocol is an isolation experiment: it starts from a clean solution and measures attack-induced correct-to-incorrect flips. A deployment system may instead receive useful evidence that also contains an injection. We therefore place task-relevant evidence and a malicious instruction in the same RAG, tool, or agent channel.
Broader-model framing diagnostics
For evidence-dependent tasks, a clean-evidence baseline is preferable to the clean-no-evidence anchor used for GSM8K. The mixed-evidence test is a deployment-facing extension rather than a change to the isolation protocol.
Table 6 shows that TRACER retains high clean/evidence accuracy while substantially reducing the contamination-induced flip rate.
| Mixed-evidence channel | Evidence acc. | Base flip ASR | TRACER flip ASR |
| RAG document | 83.0% | 58.1% | 13.8% |
| Tool output | 82.5% | 52.5% | 17.5% |
| Agent message | 81.0% | 46.3% | 16.3% |
Table 6. Valid evidence with an embedded injection. High evidence accuracy argues against blanket refusal or wholesale context ignoring.
Table 7 evaluates the framing phenomenon, without additional TRACER training, on several instruction-tuned model families. Absolute robustness varies with scale and model family, but every tested model shows a 22.0–27.1 pp spread across renderings. The evidence supports a cross-model framing-gap diagnosis; the training-time mitigation is established on Qwen2.5-3B/7B, and full cross-architecture training remains future work.
| Model | Follow-up | RAG | Tool | Agent | Spread |
| Qwen2.5-3B-Instruct | 41.4% | 65.5% | 59.4% | 46.5% | 24.1 pp |
| Qwen2.5-7B-Instruct | 9.5% | 34.3% | 36.6% | 16.8% | 27.1 pp |
| Llama-3.1-8B-Instruct | 17.8% | 42.5% | 39.0% | 24.0% | 24.7 pp |
| Gemma-2-9B-It | 12.0% | 31.5% | 34.0% | 19.0% | 22.0 pp |
| Mistral-7B-Instruct | 24.5% | 49.0% | 45.5% | 30.5% | 24.5 pp |
Table 7. Evaluation-only framing diagnostics across model families. Spread is the maximum minus minimum ASR across channels.
Additional method details
Full corrigibility truth table. The corrigibility reward implements six cases: invalid evidence with a correct clean answer is rewarded when the model stays correct and penalized when it flips; valid evidence is rewarded when the model corrects a wrong clean answer and mildly penalized when it fails to do so. This makes “good stubbornness” and “good revision” distinct behaviors rather than opposites on one axis.
Anchor spans and gating. Anchor propositions are extracted from the clean reasoning trace and filtered through a verifier gate so that ATRC applies only when the clean answer is worth preserving. In the implementation, anchor spans are aligned in response-relative coordinates before clean and attacked logits are compared.
Channel wrappers. The four wrappers correspond to realistic deployment pathways: user follow-up, retrieved document, tool response, and agent message. The wrapper changes the model’s interpretation of the same string without changing its underlying adversarial content.
Complete RAG training trajectory
Figure 7 serves as the full checkpoint-level evaluation in place of a long checkpoint table. The

Figure 7. Complete RAG training evaluation (200 samples per checkpoint). Clean accuracy, robust accuracy, and ASR across 28 checkpoints. Most of the gain appears before the end of epoch 2.
| Attack family | Goal | Train/evaluation relation |
| Reasoning rewrite | Replace the solution path with an alternative chain | Disjoint tasks + held-out paraphrases |
| Preemptive answer | Inject a false “verified” final answer | Disjoint tasks + held-out paraphrases |
| Prompt injection | Issue an explicit instruction override | Disjoint tasks + held-out paraphrases |
caption: Attack families and split. Families are shared to isolate channel transfer; task instances and held-out surface forms are disjoint.
:::
| RAG evaluation | Base | TRACER |
| Original templates | 65.5% | 6.1% |
| Held-out paraphrases | 62.7% | 10.0% |
| Channel-aware escalation | 68.8% | 18.1% |
| Defense-aware suite | 70.0% | 23.8% |
Table 3. Adaptive evaluation. The defense-aware suite explicitly targets the learned training behavior.
steepest improvement occurs once the model begins treating retrieved content as potentially adversarial rather than automatically authoritative.
Complete cross-framing results
Table 8 and Figure 8–Figure 9 provide the full appendix view behind the condensed main-paper heatmap. The important point is that robustness is not a single scalar property: each trained model has both a level of robustness (its average ASR across framings) and a shape of robustness (how unevenly that ASR is distributed across framings). The 3B base model averages 53.2% ASR across the four wrappers, with a 24.1 pp spread between follow-up and RAG presentation. This authority gradient is present before any finetuning, which means that wrapper semantics alone materially change how persuasive the exact same injected content appears to the model.

Figure 8. Full transfer matrix visualization. The heatmap includes all 3B and 7B settings considered in the paper. The base model shows an authority gradient, while trained models differ in how concentrated or broad their robustness becomes.

Figure 9. Transfer asymmetry as reduction from the base model. Specialists reduce ASR unevenly across evaluation wrappers. RAG training gives the deepest native reduction, tool training gives the flattest profile, and multi-framing plus 7B training improve the overall shape.
Depth versus breadth. The 3B RAG specialist gives the deepest native defense: 6.1% ASR in its matched RAG setting, a 59.4 pp reduction from the RAG base model. But its transfer profile remains uneven, with 25.7% ASR on tool outputs and 26.5% on agent messages. Tool-output training exhibits the opposite behavior. At the end of epoch 1 it is still weak everywhere (32.1–40.3%), but already noticeably flatter than the RAG specialist. After convergence, the final tool-trained model reaches 15.0–20.2% ASR across all four wrappers, reducing the spread to only 5.2 pp. The final multi-framing model partially combines these benefits: it retains very strong RAG performance (5.2%) while achieving the best overall 3B average ASR (13.9%). These patterns are the empirical basis for the depth–breadth trade-off described in the main text.
Interpreting the asymmetry. Figure 9 makes the asymmetry easier to see by plotting improvement relative to the corresponding base-model framing rather than raw ASR. RAG training gives its largest gain in RAG itself and smaller but still substantial reductions on follow-up, tool, and agent evaluation. Agent-message training occupies an intermediate regime: it does not match the uniformity of the final tool specialist, but it improves all four framings and achieves its best final transfer to RAG (15.7%),
| Signal | Used in | Implementation | Used by evaluation? | Audit |
| Evidence validity | Corrigibility, ATRC gate | Construction label | No | Exact |
| Step validity | Process reward | Verifier + rules | No | 90.0% agreement |
| Anchor support/contradiction | Anchor reward | Verifier | No | 91.0% agreement |
| Final-answer correctness | Accuracy, ASR | Answer extraction | Yes | 99.5% agreement |
caption: Training and evaluation signals. Verifier audits report agreement on a manually checked sample; evaluation metrics do not depend on the training-only step or anchor verifiers.
:::
suggesting that structured agent messages and retrieved documents share some authority cues. The practical implication is that cross-framing transfer is systematic rather than random: neighboring channels can share robustness, but the amount of sharing depends on the authority structure of the wrapper.
Model-size effects. The 7B rows are included explicitly to show that scale reduces, but does not eliminate, framing dependence. The 7B base model starts at a much lower average ASR than the 3B base (24.3% vs. 53.2%), yet still exhibits a pronounced spread between follow-up (9.5%) and tool/RAG framing (34–37%). After one epoch of
RAG-framed training, the 7B model reaches 9.4% average ASR with only 8.3 pp spread, outperforming every 3B configuration in the table. Additional epochs slightly worsen this cross-framing average, which is why the main paper treats early stopping as an important design choice when transfer is the target metric rather than only native-channel performance. Overall, the complete matrix reinforces the main claim: wrapper-conditioned training changes not only how much robustness is learned, but also what kind of robustness is learned.
Tool-output and agent-message training
These runs test whether the TRACER recipe is specific to RAG documents or whether the same reward- and trace-regularized training objective can adapt to other high-authority channels. The answer is yes, but the optimization dynamics differ by wrapper. Tool outputs and agent messages both present the attack as external system state rather than as a direct user request, yet the resulting robustness profiles are not identical.
Tool-output training. Table 9 and Figure 10 show that tool-output training improves more gradually than RAG training. Native tool-output ASR falls from 59.4% in the base model to 39.6% at the end of epoch 1, 28.8% by late epoch 2, and 15.0% at the final checkpoint. Clean accuracy simultaneously rises from 64.0% to 77.5%. Compared with the sharper phase transition observed in RAG training, this smoother curve suggests that tool wrappers encourage a broader but less sharply localized form of skepticism: the model becomes progressively less willing to treat tool-returned text as executable instruction, rather than learning a single document-specific counter-pattern.

Figure 10. Tool-output training curve. Tool-output training converges more gradually than RAG training but ultimately reaches 15.0% native ASR.
| State | Epoch | Clean | Robust | ASR |
| Base | – | 64.0% | 24.5% | 59.4% |
| step-250 | 1 | 66.0% | 32.5% | 57.6% |
| step-1750 | 1 | 72.0% | 52.0% | 39.6% |
| step-2500 | 2 | 73.0% | 58.5% | 32.2% |
| step-2750 | 2 | 69.5% | 60.5% | 28.8% |
| final | 3 | 77.5% | 75.5% | 15.0% |
Table 9. Tool-output training trajectory. Three epochs of tool-output training improve native tool-output robustness from 59.4% to 15.0%.
| Model | Followup | RAG | Tool-Output | Agent-Msg | Spread |
| 3B Base (no LoRA) | 41.4% | 65.5% | 59.4% | 46.5% | 24.1 pp |
| 3B RAG-trained | 14.5% | 6.1% | 25.7% | 26.5% | 20.4 pp |
| 3B Tool-trained (epoch 1) | 32.1% | 33.1% | 39.6% | 40.3% | 8.2 pp |
| 3B Tool-trained (final) | 20.0% | 20.2% | 15.0% | 15.8% | 5.2 pp |
| 3B Multi-framing (RAG+tool) | 11.3% | 5.2% | 21.7% | 17.5% | 16.5 pp |
| 3B Agent-trained | 19.6% | 15.7% | 26.3% | 18.4% | 10.6 pp |
| 7B Base (no LoRA) | 9.5% | 34.3% | 36.6% | 16.8% | 27.1 pp |
| 7B RAG-trained (epoch 1) | 5.2% | 10.4% | 13.5% | 8.5% | 8.3 pp |
| 7B RAG-trained (epoch 2) | 5.7% | 18.0% | 19.2% | 6.5% | 13.5 pp |
| 7B RAG-trained (final) | 5.1% | 13.6% | 18.2% | 6.2% | 13.1 pp |
Table 8. Complete cross-framing transfer matrix. Attack success rate (%) across training conditions and evaluation framings. Spread is the maximum minus minimum ASR across the four framings for a given trained model.
Why tool training transfers broadly. The cross-framing numbers support that interpretation in Table 10. Even before full convergence, the epoch-1 tool checkpoint is already relatively flat across follow-up, RAG, tool, and agent evaluation (32.1%, 33.1%, 39.6%, 40.3%), despite not yet being strong in any single framing. After full training, the same recipe reaches a near-uniform 15–20% ASR profile. This is qualitatively different from the RAG specialist, whose native ASR is much lower but whose transfer is less even. One plausible explanation is that tool outputs mix provenance, status, and content fields in a way that forces the model to rely less on any single authority cue and more on the underlying semantic question: is this external text evidence to reason over, or an instruction to obey?
| State | Followup | RAG | Tool | Agent | Avg |
| Base | 41.4% | 65.5% | 59.4% | 46.5% | 53.2% |
| Epoch 1 | 21.0% | 30.3% | 43.3% | 31.9% | 31.6% |
| Epoch 2 | 12.4% | 21.8% | 20.1% | 23.4% | 19.4% |
| Final | 19.6% | 15.7% | 26.3% | 18.4% | 20.0% |
Table 10. Agent-message training trajectory. Agent-message training improves average ASR, but its strongest final transfer is to RAG framing rather than native agent framing.
Agent-message training. Agent-message training also improves robustness substantially, reducing average ASR from 53.2% in the base model to 31.6% after epoch 1 and 19.4% after epoch 2. The final epoch-3 checkpoint slightly worsens the average to 20.0%, which is why we report it as a specialized final model rather than as the best checkpoint. Notably, the strongest final transfer is to RAG framing (15.7%) rather than to native agent framing (18.4%). This suggests that the model treats agent messages and retrieved documents as partially overlapping sources of delegated authority. In other words, the wrapper taxonomy is not arbitrary: some channels are closer than others in the trust geometry learned by the model.
Takeaway. These results show that TRACER is not just a RAG-specific defense. The same training game, composite reward, and ATRC regularization can be instantiated for multiple untrusted-context channels. What changes from channel to channel is the learned robustness profile: RAG training gives deep specialization, tool training gives the broadest transfer, and agent training lands between them. That pattern is exactly what the cross-framing hypothesis would predict if wrappers affect the model’s trust calibration rather than merely its formatting preferences.
Ablation and scaling
We use two compact studies to separate TRACER’s ingredients from confounds. The first ablation asks whether the RAG gain comes mainly from the wrapper, from the RAG-specific system prompt, or from their combination. The second asks how the framing gap changes with model scale and training duration.
Wrapper versus system prompt. Table 11 and Figure 12 show that both components matter. Removing the RAG-specific system prompt but keeping the document wrapper increases ASR from 5.5% to 10.0%; removing the wrapper but keeping the prompt increases ASR to 11.3%. Removing both raises ASR to 60.5%, close to the undefended baseline. Two conclusions follow. First, the gain is not reducible to prompt wording alone: the wrapper structure itself carries crucial authority cues. Second, the gain is not reducible to wrapper structure alone either: telling the model how to treat retrieved content still adds a meaningful margin. This complements the method claim in the main paper. Channel-sampled exposure matters because the model must actually see the deployment wrapper during training, while reward shaping and ATRC matter because the model must learn what behavior to preserve once that wrapper is present.
| Condition | Sys | Wrapper | ASR | |
| Full | RAG | RAG | 5.5% | — |
| Wrapper only | Default | RAG | 10.0% | +4.5 pp |
| Prompt only | RAG | None | 11.3% | +5.8 pp |
| Neither | Default | None | 60.5% | +55.0 pp |
Table 11. RAG ablation. Both the RAG wrapper and the RAG-specific system prompt matter. The wrapper contributes slightly more, but the strongest robustness appears only when both are present.

Figure 12. Wrapper vs. system prompt. The document wrapper and the RAG-specific system prompt provide complementary gains.
Scaling behavior. Table 12 and Figure 11 show a favorable scaling trend. At 7B, the base model is already substantially more robust than the 3B base,
| Model | Followup | RAG | Tool | Agent | Avg |
| 7B Base | 9.5% | 34.3% | 36.6% | 16.8% | 24.3% |
| 7B RAG ep1 | 5.2% | 10.4% | 13.5% | 8.5% | 9.4% |
| 7B RAG ep2 | 5.7% | 18.0% | 19.2% | 6.5% | 12.3% |
| 7B RAG final | 5.1% | 13.6% | 18.2% | 6.2% | 10.8% |
Table 12. 7B scaling results. Larger models are substantially more robust before training and reach even lower average ASR after framing-aware training.

Figure 11. 7B scaling. Larger models begin from a better robustness baseline and achieve their best cross-framing average after a single epoch of RAG-framed training.
especially under follow-up and agent framing. Yet the framing gap does not disappear: RAG and tool wrappers still raise ASR into the mid-30s. Training closes much of this remaining gap quickly. After a single epoch of RAG-framed training, the 7B model reaches 9.4% average ASR across the four framings, with 10.4% native RAG ASR and only 8.3 pp spread overall. Later checkpoints remain strong but do not improve this average, ending at 10.8% for the final model. This is why we interpret 7B scaling as evidence that larger models learn contextual skepticism more readily, not as evidence that scale alone solves the problem.
Implications for method design. The ablation and scaling results together support three practical recommendations. First, deployment-matched wrappers should be part of the training distribution rather than treated as cosmetic formatting. Second, when transfer across wrappers is the target, model selection should use cross-framing averages rather than only native-channel ASR; the best 7B checkpoint by that criterion appears after one epoch rather than at the end of training. Third, stronger base models reduce the amount of channel-specific training needed, but they do not remove the need for channel-aware evaluation. Even at 7B, the difference between follow-up and retrieved-document vulnerability remains large enough that a single in-channel robustness number would be misleading.

Figure 13. Cross-domain robustness transfer. Framing-aware skepticism transfers across domains more readily than task-specific clean accuracy.
Cross-domain robustness
We also evaluate framing-aware robustness outside the GSM8K training domain. On RAG-framed Natural Questions and TriviaQA, framing-aware models maintain relatively low ASR, but clean accuracy is low for 3B models, indicating that capability rather than robustness is the main bottleneck in these cross-domain settings.
Hyperparameters and reproducibility
Primary 3B configuration. We use Qwen2.5-3B-Instruct with 4-bit QLoRA (rank 64, ), three epochs of training, batch size 1, gradient accumulation 8, group size 4, warmup ratio 0.1, and learning rate . The KL coefficient is 0.10, the PPO clip parameter is 0.2, the ATRC regularization weight is 0.1, and the ATR/TCR blend parameter is 0.5.
Reward weights. The reward weights are , , , , and .
Compute notes. All models are trained with vLLM-accelerated rollouts and LoRA-style adaptation rather than full dense finetuning. We provide the configuration needed to reproduce the experiments, but do not report exact wall-clock measurements for every run; we therefore answer the checklist conservatively.
Assets and licenses
The experiments rely on public assets cited in the paper, including base models, datasets, and verifier backbones. The submission package contains only manuscript sources and figures; it does not redistribute third-party model weights or dataset contents. Subject to the licenses of the underlying assets, training wrappers, evaluation scripts, and configuration files are available through the project repository linked in the abstract.
References
- [1]Jiawei Chen, Hongyu Lin, Xianpei Han, and Le Sun. 2024. Benchmarking large language models in retrieval-augmented generation. Proceedings of the AAAI Conference on Artificial Intelligence, 38(16):17754–17762.arxiv.org/abs/2309.01431
- [2]Sizhe Chen, Julien Piet, Chawin Sitawarin, and David Wagner. 2025a. StruQ: Defending against prompt injection with structured queries. In 34th USENIX Security Symposium (USENIX Security 25), pages 2383–2400. USENIX Association.arxiv.org/abs/2402.06363
- [3]Sizhe Chen, Arman Zharmagambetov, Saeed Mahloujifar, Kamalika Chaudhuri, David Wagner, and Chuan Guo. 2025b. SecAlign: Defending against prompt injection with preference optimization. In Proceedings of the 2025 ACM SIGSAC Conference on Computer and Communications Security (CCS), pages 2833–2847. ACM.DOI
- [4]Yulin Chen, Haoran Li, Yuexin Li, Yue Liu, Yangqiu Song, and Bryan Hooi. 2025c. TopicAttack: An indirect prompt injection attack via topic transition. In Proceedings of the 2025 Conference on Empirical Methods in Natural Language Processing, pages 7327–7345.arxiv.org/abs/2507.13686
- [5]Yulin Chen, Haoran Li, Yuan Sui, Yue Liu, Yufei He, Xiaoling Bai, Chi Fei, Yabo Li, Haozhe Ma, Yangqiu Song, and Bryan Hooi. 2026. Robustness via referencing: Defending against prompt injection attacks by referencing the executed instruction. In Findings of the Association for Computational Linguistics: ACL 2026, pages 1194–1215. Association for Computational Linguistics.
- [6]Daixuan Cheng, Shaohan Huang, Xuekai Zhu, Bo Dai, Wayne Xin Zhao, Zhenliang Zhang, and Furu Wei. 2026. Reasoning with exploration: An entropy perspective. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 40, pages 30377–30385.arxiv.org/abs/2506.14758
- [7]Karl Cobbe, Vineet Kosaraju, Mohammad Bavarian, Mark Chen, Heewoo Jun, Lukasz Kaiser, Matthias Plappert, Jerry Tworek, Jacob Hilton, Reichiro Nakano, and 1 others. 2021. Training verifiers to solve math word problems. arXiv preprint arXiv:2110.14168.arxiv.org/abs/2110.14168
- [8]Gangqu Cui, Yuchen Zhang, Jiacheng Chen, Lifan Yuan, Zhi Wang, Yuxin Zuo, Haozhan Li, Yuchen Fan, Huayu Chen, Weize Chen, Zhiyuan Liu, Hao Peng, Lei Bai, Wanli Ouyang, Yu Cheng, Bowen Zhou, and Ning Ding. 2025. The entropy mechanism of reinforcement learning for reasoning language models. arXiv preprint arXiv:2505.22617.arxiv.org/abs/2505.22617
- [9]Edoardo Debenedetti, Ilia Shumailov, Tianqi Fan, Jamie Hayes, Nicholas Carlini, Daniel Fabian, Christoph Kern, Chongyang Shi, Andreas Terzis, and Florian Tramèr. 2026. Defeating prompt injections by design. In IEEE Conference on Secure and Trustworthy Machine Learning (SaTML). ArXiv:2503.18813.arxiv.org/abs/2503.18813
- [10]Edoardo Debenedetti, Jie Zhang, Mislav Balunović, Luca Beurer-Kellner, Marc Fischer, and Florian Tramèr. 2024. AgentDojo: A dynamic environment to evaluate prompt injection attacks and defenses for LLM agents. In Advances in Neural Information Processing Systems (NeurIPS), Datasets and Benchmarks Track, volume 37.arxiv.org/abs/2406.13352
- [12]Yilun Du, Shuang Li, Antonio Torralba, Joshua B. Tenenbaum, and Igor Mordatch. 2024. Improving factuality and reasoning in language models through multiagent debate. In Proceedings of the 41st International Conference on Machine Learning (ICML), volume 235 of Proceedings of Machine Learning Research, pages 11733–11763.arxiv.org/abs/2305.14325
- [13]Ivan Evtimov, Arman Zharmagambetov, Aaron Grattafiori, Chuan Guo, and Kamalika Chaudhuri. 2025. WASP: Benchmarking web agent security against prompt injection attacks. In Advances in Neural Information Processing Systems (NeurIPS), Datasets and Benchmarks Track, volume 38.
- [14]Yunfan Gao, Yun Xiong, Xinyu Gao, Kangxiang Jia, Jinliu Pan, Yuxi Bi, Yi Dai, Jiawei Sun, Meng Wang, and Haofen Wang. 2023. Retrieval-augmented generation for large language models: A survey. arXiv preprint arXiv:2312.10997.arxiv.org/abs/2312.10997
- [15]Kai Greshake, Sahar Abdelnabi, Shailesh Mishra, Christoph Endres, Thorsten Holz, and Mario Fritz. 2023. Not what you’ve signed up for: Compromising real-world LLM-integrated applications with indirect prompt injection. In Proceedings of the 16th ACM Workshop on Artificial Intelligence and Security (AISec), pages 79–90.
- [16]Daya Guo, Dejian Yang, Haowei Zhang, Junxiao Song, Peiyi Wang, Qihao Zhu, Runxin Xu, Ruoyu Zhang, Shirong Ma, Xiao Bi, and 1 others. 2025. DeepSeek-R1 incentivizes reasoning in LLMs through reinforcement learning. Nature, 645(8081):633–638.DOI
- [19]Keegan Hines, Gary Lopez, Matthew Hall, Federico Zarfati, Yonatan Zunger, and Emre Kiciman. 2024. Defending against indirect prompt injection attacks with spotlighting. In Proceedings of the Conference on Applied Machine Learning in Information Security (CAMLIS), volume 3920 of CEUR Workshop Proceedings, pages 48–62.arxiv.org/abs/2403.14720
- [20]Edward J. Hu, Yelong Shen, Phillip Wallis, Zeyuan Allen-Zhu, Yuanzhi Li, Shean Wang, Lu Wang, and Weizhu Chen. 2022. LoRA: Low-rank adaptation of large language models. In International Conference on Learning Representations (ICLR).arxiv.org/abs/2106.09685
- [21]Yuqi Jia, Zedian Shao, Yupei Liu, Jinyuan Jia, Dawn Song, and Neil Zhenqiang Gong. 2025. A critical evaluation of defenses against prompt injection attacks. arXiv preprint arXiv:2505.18333.arxiv.org/abs/2505.18333
- [22]Woosuk Kwon, Zhuohan Li, Siyuan Zhuang, Ying Sheng, Lianmin Zheng, Cody Hao Yu, Joseph E Gonzalez, Hao Zhang, and Ion Stoica. 2023. Efficient memory management for large language model serving with PagedAttention. In Proceedings of the ACM SIGOPS 29th Symposium on Operating Systems Principles, pages 611–626.arxiv.org/abs/2309.06180
- [23]Patrick Lewis, Ethan Perez, Aleksandra Piktus, Fabio Petroni, Vladimir Karpukhin, Naman Goyal, Heinrich Küttler, Mike Lewis, Wen-tau Yih, Tim Rocktäschel, and 1 others. 2020. Retrieval-augmented generation for knowledge-intensive NLP tasks. Advances in Neural Information Processing Systems, 33:9459–9474.arxiv.org/abs/2005.11401
- [24]Guohao Li, Hasan Abed Al Kader Hammoud, Hani Itani, Dmitrii Khizbullin, and Bernard Ghanem. 2023. CAMEL: Communicative agents for “mind” exploration of large language model society. In Advances in Neural Information Processing Systems (NeurIPS), volume 36.arxiv.org/abs/2303.17760
- [25]Hunter Lightman, Vineet Kosaraju, Yuri Burda, Harrison Edwards, Bowen Baker, Teddy Lee, Jan Leike, John Schulman, Ilya Sutskever, and Karl Cobbe. 2024. Let’s verify step by step. In International Conference on Learning Representations (ICLR).arxiv.org/abs/2305.20050
- [26]Xiao Liu, Hao Yu, Hanchen Zhang, Yifan Xu, Xuanyu Lei, Hanyu Lai, Yu Gu, Hangliang Ding, Kaiwen Men, Kejuان Yang, Shudan Zhang, Xiang Deng, Aohan Zeng, Zhengxiao Du, Chenhui Zhang, Sheng Shen, Tianjun Zhang, Yu Su, Huan Sun, and 3 others. 2024. AgentBench: Evaluating LLMs as agents. In International Conference on Learning Representations (ICLR).arxiv.org/abs/2308.03688
- [27]Kshitij Mishra, Mirat Aubakirov, Martin Takac, Nils Lukas, and Salem Lahlou. 2026a. CoRe: Collaborative reasoning via cross teaching. In Proceedings of the 43rd International Conference on Machine Learning (ICML). ArXiv:2601.21600.arxiv.org/abs/2601.21600
- [28]Kshitij Mishra, Nils Lukas, and Salem Lahlou. 2026b. SD-E²: Semantic exploration for reasoning under token budgets. In Findings of the Association for Computational Linguistics: EACL 2026, pages 6144–6157. Association for Computational Linguistics.DOI
- [29]Chanwoo Park, Seungju Han, Xingzhi Guo, Asuman E. Ozdaglar, Kaiqing Zhang, and Joo-Kyun Kim. 2025. MAPoRL: Multi-agent post-co-training for collaborative large language models with reinforcement learning. In Proceedings of the 63rd Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 30215–30248. Association for Computational Linguistics.arxiv.org/abs/2502.18439
- [30]Shishir G. Patil, Tianjun Zhang, Xin Wang, and Joseph E. Gonzalez. 2024. Gorilla: Large language model connected with massive APIs. In Advances in Neural Information Processing Systems (NeurIPS), volume 37.arxiv.org/abs/2305.15334
- [31]Yujia Qin, Shihao Liang, Yining Ye, Kunlun Zhu, Lan Yan, Yaxi Lu, Yankai Lin, Xin Cong, Xiangru Tang, Bill Qian, Sihan Zhao, Lauren Hong, Runchu Tian, Ruobing Xie, Jie Zhou, Mark Gerstein, Dahai Li, Zhiyuan Liu, and Maosong Sun. 2024. ToolLLM: Facilitating large language models to master 16000+ real-world APIs. In International Conference on Learning Representations (ICLR).arxiv.org/abs/2307.16789
- [33]Zhihong Shao, Peiyi Wang, Qihao Zhu, Runxin Xu, Junxiao Song, Xiao Bi, Haowei Zhang, Mingchuan Zhang, Y. K. Li, Y. Wu, and Daya Guo. 2024. DeepSeekMath: Pushing the limits of mathematical reasoning in open language models. arXiv preprint arXiv:2402.03300.arxiv.org/abs/2402.03300
- [34]Tianneng Shi, Kaijie Zhu, Zhուն Wang, Yuqi Jia, Will Cai, Weida Liang, Haonan Wang, Hend Alzahrani, Joshua Lu, Kenji Kawaguchi, Basel Alomair, Xuandong Zhao, William Yang Wang, Neil Gong, Wenbo Guo, and Dawn Song. 2025. Promptarmor: Simple yet effective prompt injection defenses. arXiv preprint arXiv:2507.15219.arxiv.org/abs/2507.15219
- [35]Yuda Song, Julia Kempe, and Rémi Munos. 2025. Outcome-based exploration for LLM reasoning. arXiv preprint arXiv:2509.06941.arxiv.org/abs/2509.06941
- [36]Vighnesh Subramaniam, Yilun Du, Joshua B. Tenenbaum, Antonio Torralba, Shuang Li, and Igor Mordatch. 2025. Multiagent finetuning: Self improvement with diverse reasoning chains. In International Conference on Learning Representations (ICLR).arxiv.org/abs/2501.05707
- [37]Christian Walder and Deep Tejas Karkhanis. 2025. Pass@K policy optimization: Solving harder reinforcement learning problems. In Advances in Neural Information Processing Systems (NeurIPS), volume 38, pages 169225–169254.arxiv.org/abs/2505.15201
- [38]Ziyu Wan, Yunxiang Li, Xiaoyu Wen, Yan Song, Hanjing Wang, Linyang Yang, Mark Schmidt, Jun Wang, Weinan Zhang, Shuyue Hu, and Ying Wen. 2025. ReMA: Learning to meta-think for LLMs with multi-agent reinforcement learning. In Advances in Neural Information Processing Systems (NeurIPS), volume 38, pages 140399–140445.arxiv.org/abs/2503.09501
- [39]Che Wang, Fuyao Zhang, Jiaming Zhang, Ziqi Zhang, Yinghui Wang, Longtao Huang, Jianbo Gao, Zhong Chen, and Wei Yang Bryan Lim. 2026. Icon: Indirect prompt injection defense for agents based on inference-time correction. arXiv preprint arXiv:2602.20708.arxiv.org/abs/2602.20708
- [40]Peiyi Wang, Lei Li, Zhihong Shao, Runxin Xu, Damai Dai, Yifei Li, Deli Chen, Yu Wu, and Zhifang Sui. 2024. Math-Shepherd: Verify and reinforce LLMs step-by-step without human annotations. In Proceedings of the 62nd Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 9426–9439. Association for Computational Linguistics.
- [41]Tongyu Wen, Chenglong Wang, Xiyuan Yang, Haoyu Tang, Yueqi Xie, Lijun Wang, Zhicheng Dou, and Fangzhao Wu. 2025. Defending against indirect prompt injection by instruction detection. In Findings of the Association for Computational Linguistics: EMNLP 2025, pages 19472–19487. Association for Computational Linguistics.DOI
- [42]Jian Xie, Kai Zhang, Jiangjie Chen, Renze Lou, and Yu Su. 2024. Adaptive chameleon or stubborn sloth: Revealing the behavior of large language models in knowledge conflicts. In International Conference on Learning Representations (ICLR).arxiv.org/abs/2305.13300
- [43]Jingwei Yi, Yueqi Xie, Bin Zhu, Emre Kiciman, Guangzhou Sun, Xing Xie, and Fangzhao Wu. 2025. Benchmarking and defending against indirect prompt injection attacks on large language models. In Proceedings of the 31st ACM SIGKDD Conference on Knowledge Discovery and Data Mining (KDD), pages 1809–1820.
- [44]Qiang Yu, Xinran Cheng, and Chuanyi Liu. 2026. Defense against indirect prompt injection via tool result parsing. arXiv preprint arXiv:2601.04795.arxiv.org/abs/2601.04795
- [45]Qiying Yu, Zheng Zhang, Ruofei Zhu, Yufeng Yuan, Xiaochen Zuo, Yu Yue, Weinan Dai, Tiantian Fan, Gaohong Liu, Juncai Liu, Lingjun Liu, Xin Liu, and 1 others. 2025. DAPO: An open-source LLM reinforcement learning system at scale. In Advances in Neural Information Processing Systems (NeurIPS), volume 38, pages 125532–125554.arxiv.org/abs/2503.14476
- [46]Qiusi Zhan, Richard Fang, Henil Shalin Panchal, and Daniel Kang. 2025. Adaptive attacks break defenses against indirect prompt injection attacks on LLM agents. In Findings of the Association for Computational Linguistics: NAACL 2025, pages 7116–7132.
- [47]Qiusi Zhan, Zhixiang Liang, Zifan Ying, and Daniel Kang. 2024. InjecAgent: Benchmarking indirect prompt injections in tool-integrated large language model agents. In Findings of the Association for Computational Linguistics: ACL 2024, pages 10471–10506.arxiv.org/abs/2403.02691
- [48]Hanrong Zhang, Jingyuan Huang, Kai Mei, Yifei Yao, Zhenting Wang, Chenlu Zhan, Hongwei Wang, and Yongfeng Zhang. 2025. Agent security bench (ASB): Formalizing and benchmarking attacks and defenses in LLM-based agents. In International Conference on Learning Representations (ICLR).arxiv.org/abs/2410.02644
- [49]Kaijie Zhu, Xianjun Yang, Jindong Wang, Wenbo Guo, and William Yang Wang. 2025. MELON: Provable defense against indirect prompt injection attacks in AI agents. In Proceedings of the 42nd International Conference on Machine Learning (ICML), volume 267 of Proceedings of Machine Learning Research, pages 80310–80329.arxiv.org/abs/2502.05174

