MINE:基于互信息与嵌入方差的无训练提示注入防御方法
MINE: A Training-Free Defense against Indirect Prompt Injection via Mutual Information and Embedding Variance
做 RAG 和智能体的开发者应该看看这篇。现有防御要么被注入指令绕过,要么换个攻击样式就得重新训练,MINE 用互信息加嵌入方差做排序过滤,免训练还能扛自适应攻击。如果你在折腾检索增强又担心文档里藏恶意指令,这套思路可以直接借鉴。
arXiv 论文提出 MINE,一种免训练、攻击无关的间接提示注入防御方法,核心思路是通过最大化相关性而非检测攻击来防御。作者同时发布了 LC-Inj-SQuAD 基准,平均每段上下文约 4,032 词,专门用于评估长上下文场景下的注入防御。
MINE 利用互信息与嵌入方差作为信号,可作为查询条件重排器使用:它不试图识别注入指令,而是把与用户查询最相关的内容排在前面,从而让被注入的恶意指令在排序中自然被过滤。该方法无需针对新攻击样式重新训练。
论文在四个数据集上评测:短上下文的 Inj-SQuAD、Inj-TriviaQA、长上下文的 LC-Inj-SQuAD,以及智能体工具调用注入的 InjecAgent。结果显示 MINE 在所有四项上取得免训练防御中最优的准确率-安全权衡,是唯一面对完全自适应攻击者仍保持可用的防御,同时在长上下文上推理延迟最低。
MINE: A Training-Free Defense against Indirect Prompt Injection via Mutual Information and Embedding Variance
Existing defenses against indirect prompt injection in retrieval-augmented generation (RAG) are inherently reactive: prompt-engineering methods are often overridden by the injected instructions, while supervised detectors must be retrained for each new attack style. We propose a different paradigm: defend by maximizing relevance, not by detecting attacks. Our method, MINE, is training-free and attack-agnostic, and it also serves as a query-conditioned reranker. To evaluate defenses under realistic conditions, we introduce LC-Inj-SQuAD, a long-context benchmark with an average of 4,032 words per context. We evaluate on four datasets spanning short-context QA (Inj-SQuAD, Inj-TriviaQA), long-context QA (LC-Inj-SQuAD), and agent tool-call injection (InjecAgent). Across all four, MINE achieves the best accuracy--security trade-off among training-free defenses. It is also the only defense that stays usable against a fully adaptive attacker, generalizes to agent tool-call injection, and achieves the lowest inference latency on long contexts.
This report is categorized under AITOP's "Papers" desk. Within our cross-regional analytical framework, it directly maps to AI developer toolchains, coding agents, and engineering workflows. Key entities and technical topics under continuous tracking include RAG, prompt injection, LLM security, InjecAgent.
Source attribution: curated from arXiv cs.AI (@Truong Phan, Ngoc-Quan Pham, Dat Quoc Nguyen).