Indirect prompt injection detection based on attention classificationAttention-based Classification for Indirect Prompt Injection
Translation in progress — untranslated text is omitted.
The paper's authors evaluate on the AgentDojo benchmark and find that the white-box prompt injection detection method Attention Tracker performs close to random on most model families, and propose an improved method, AttnDA. Attention Tracker was proposed by Hung et al. in 2025; it identifies injection attacks by monitoring the distribution of model attention between user task tokens and data tokens, and claims to be dataset-agnostic; the evaluation shows that long structured tool outputs break the attention assumption the method relies on, and that this claim does not hold in agent environments. AttnDA replaces the scalar threshold with a Fisher linear discriminant analysis classifier based on per-head focus score vectors, improving detection performance in agent and tool-integration scenarios in a cross-dataset evaluation covering four benchmarks, but transfer to AgentDojo remains difficult. Covariance ablations show that removing inter-head correlation structure contributes significantly to performance, and that complex covariance assumptions cause notable degradation on cross-domain data.
- Indirect prompt injection hides malicious instructions in external data that the agent reads. The existing white-box detection method Attention Tracker claims to be dataset-agnostic, but whether it is effective in real agent scenarios (such as AgentDojo) has never been evaluated.
- The authors evaluate Attention Tracker on four benchmarks including AgentDojo and propose AttnDA: replacing the original scalar threshold with Fisher linear discriminant analysis (diagonal covariance) to weightedly classify the focus score vector of all attention heads.
- Attention Tracker's "dataset-agnostic" claim does not hold in agent scenarios: average AUROC on AgentDojo† is only 0.57. AttnDA trained in-domain rises to 0.94, and its cross-domain average of 0.79 beats AT's 0.75, but transfer to AgentDojo† remains difficult.
- The authors note: AgentDojo† has only two suites, banking and slack, totaling 51 samples; the covariance ablation and weight analysis use only the single Qwen model; the variety of agent datasets is limited; and the benign samples of LLMail-Inject are synthetic and should not be treated as real agent data.
Related events and news
1 events · 1 news mentions
News that mentions this paper
大模型安全周报:防线开始溃于组合,智能体授权与审计系统性缺口
- 公众号 大模型安全研究cites the paper's id or link大模型安全周报:防线开始溃于组合,智能体授权与审计的系统性缺口
Attention-based Classification for Indirect Prompt Injection(https://arxiv.org/abs/2610.28988)
Related papers
- Deletion, Substitution, Repair and Transplant: Component Attribution in BARBICAN, a Layered Prompt-Injection Gateway for MCPAnalysis / interpretabilityarXiv