TRACER: Trace-Regularized Training Against Indirect Prompt Injection

Kshitij Mishra, Salem Lahlou, Nils Lukas
10/13/2026
cs.LG

No confident code implementation found for this paper.

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.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{mishra2026tracer,
  title  = {TRACER: Trace-Regularized Training Against Indirect Prompt Injection},
  author = {Kshitij Mishra and Salem Lahlou and Nils Lukas},
  year   = {2026},
  eprint = {2610.19133},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2610.19133v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2610.19133.svg)](https://codeofpaper.com/paper/2610.19133)

Discussion