Attention is All You Need to Defend Against Indirect Prompt Injection Attacks in LLMs
Yinan Zhong, Qianhao Miao, Yanjiao Chen, Jiangyi Deng, Yushi Cheng, Wenyuan Xu
摘要
Large Language Models (LLMs) have been integrated into many applications (e.g., web agents) to perform more sophisticated tasks. However, LLM-empowered applications are vulnerable to Indirect Prompt Injection (IPI) attacks, where instructions are injected via untrustworthy external data sources. This paper presents Rennervate, a defense framework to detect and prevent IPI attacks. Rennervate leverages attention features to detect the covert injection at a fine-grained token level, enabling precise sanitization that neutralizes IPI attacks while maintaining LLM functionalities. Specifically, the token-level detector is materialized with a 2-step attentive pooling mechanism, which aggregates attention heads and response tokens for IPI detection and sanitization. Moreover, we establish a fine-grained IPI dataset, FIPI, to be open-sourced to support further research. Extensive experiments verify that Rennervate outperforms 15 commercial and academic IPI defense methods, achieving high precision on 5 LLMs and 6 datasets. We also demonstrate that Rennervate is transferable to unseen attacks and robust against adaptive adversaries.
问 Lune
几分钟读透这篇 Paper,不用再花一下午。
Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。
已有 4 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。
脉络
- Pythia: A Suite for Analyzing Large Language Models Across Training and Scaling 引用了 Language Models are Few-Shot Learners
- Reasoning Hijacking: The Fragility of Reasoning Alignment in Large Language Models 引用了 Training language models to follow instructions with human feedback
- HuggingGPT: Solving AI Tasks with ChatGPT and its Friends in Hugging Face 引用了 Language Models are Few-Shot Learners
- HuggingGPT: Solving AI Tasks with ChatGPT and its Friends in Hugging Face 引用了 Training language models to follow instructions with human feedback
- Training language models to follow instructions with human feedback 引用了 Language Models are Few-Shot Learners
- ContractGuard: Auditing Semantic Contracts of MCP Tools for Security Violations 引用了 Tree of Attacks: Jailbreaking Black-Box LLMs Automatically
引用它的顶会 Paper4
- IntraGuard: Committee-Side Defenses Against Review Outsourcing to Commercial ChatbotsOubo Ma, Ruixiao Lin, Jiahao Chen, Yuan Su 等CCS 2026 · 2 次引用
- Reasoning Hijacking: The Fragility of Reasoning Alignment in Large Language ModelsYuansen Liu, Yixuan Tang, Anthony Kum Hoe TungACL 2026
- A Large-scale Measurement of In-Page Prompt Injections Against LLM Web AgentsSoheil Khodayari, Xuenan Zhang, Bhupendra Acharya, Giancarlo PellegrinoCCS 2026
- ContractGuard: Auditing Semantic Contracts of MCP Tools for Security ViolationsHengkai Ye, Zhechang Zhang, Ruibo Lu, Jinyuan Jia 等CCS 2026
它引用的 Paper23
- Language Models are Few-Shot LearnersTom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah 等NeurIPS 2020 · 64,255 次引用
- Training language models to follow instructions with human feedbackLong Ouyang, Jeffrey Wu, Xu Jiang, Diogo Almeida 等NeurIPS 2022 · 24,707 次引用
- Pythia: A Suite for Analyzing Large Language Models Across Training and ScalingStella Biderman, Hailey Schoelkopf, Quentin Gregory Anthony, Herbie Bradley 等ICML 2023 · 1,822 次引用
- HuggingGPT: Solving AI Tasks with ChatGPT and its Friends in Hugging FaceYongliang Shen, Kaitao Song, Xu Tan, Dongsheng Li 等NeurIPS 2023 · 1,778 次引用
- Tree of Attacks: Jailbreaking Black-Box LLMs AutomaticallyAnay Mehrotra, Manolis Zampetakis, Paul Kassianik, Blaine Nelson 等NeurIPS 2024 · 835 次引用
相关 Paper
- Defending against Indirect Prompt Injection by Instruction DetectionTongyu Wen, Chenglong Wang, Xiyuan Yang, Haoyu Tang 等EMNLP Findings 2025 · 5 次引用
- IPIGuard: A Novel Tool Dependency Graph-Based Defense Against Indirect Prompt Injection in LLM AgentsHengyu An, Jinghuai Zhang, Tianyu Du, Chunyi Zhou 等EMNLP 2025
- Know Thy Enemy: Securing LLMs Against Prompt Injection via Diverse Data Synthesis and Instruction-Level Chain-of-Thought LearningZhiyuan Chang, Mingyang Li, Yuekai Huang, Ziyou Jiang 等ACL Findings 2026
- TopicAttack: An Indirect Prompt Injection Attack via Topic TransitionYulin Chen, Haoran Li, Yuexin Li, Yue Liu 等EMNLP 2025 · 1 次引用
- Can Indirect Prompt Injection Attacks Be Detected and Removed?Yulin Chen, Haoran Li, Yuan Sui, Yufei He 等ACL 2025
