[论文解读] Rag and Roll: An End-to-End Evaluation of Indirect Prompt Manipulations in LLM-based Application Frameworks
本文通过一种名为 Rag-n-Roll 的新型框架,评估了检索增强生成(RAG)系统中端到端的间接提示操纵攻击。研究发现,尽管攻击在提升恶意文档检索方面大多有效,但在劫持最终大语言模型(LLM)响应方面成功率仍有限——明确攻击的成功率约为 40%,若将模糊输出也纳入成功范畴,则上升至 60%。这凸显了仅优化检索环节不足以应对安全威胁,亟需对整个流水线实施全面的安全加固。
Retrieval Augmented Generation (RAG) is a technique commonly used to equip models with out of distribution knowledge. This process involves collecting, indexing, retrieving, and providing information to an LLM for generating responses. Despite its growing popularity due to its flexibility and low cost, the security implications of RAG have not been extensively studied. The data for such systems are often collected from public sources, providing an attacker a gateway for indirect prompt injections to manipulate the responses of the model. In this paper, we investigate the security of RAG systems against end-to-end indirect prompt manipulations. First, we review existing RAG framework pipelines, deriving a prototypical architecture and identifying critical parameters. We then examine prior works searching for techniques that attackers can use to perform indirect prompt manipulations. Finally, we implemented Rag 'n Roll, a framework to determine the effectiveness of attacks against end-to-end RAG applications. Our results show that existing attacks are mostly optimized to boost the ranking of malicious documents during the retrieval phase. However, a higher rank does not immediately translate into a reliable attack. Most attacks, against various configurations, settle around a 40% success rate, which could rise to 60% when considering ambiguous answers as successful attacks (those that include the expected benign one as well). Additionally, when using unoptimized documents, attackers deploying two of them (or more) for a target query can achieve similar results as those using optimized ones. Finally, exploration of the configuration space of a RAG showed limited impact in thwarting the attacks, where the most successful combination severely undermines functionality.
研究动机与目标
- 探究间接提示注入攻击在完整 RAG 应用流水线中的现实有效性。
- 识别可能影响攻击成功率或系统韧性的关键 RAG 系统配置参数。
- 评估现有攻击(虽经检索排序优化)是否能可靠地在端到端 RAG 系统中实现响应劫持。
- 探索知识库中冗余的良性数据是否可作为可行的防御机制。
- 提供一种系统化、自动化的 RAG 安全评估框架,支持攻击与防御策略的可复现评估。
提出的方法
- 作者逆向分析了常见的 RAG 框架流水线,推导出包含关键配置参数的原型架构。
- 他们实现了 Rag-n-Roll 框架,以自动化方式在攻击条件下评估端到端 RAG 系统,整合了已知的间接提示操纵技术。
- 该框架基于先前工作生成恶意文档,将其注入知识库,并在多种配置下评估其对最终 LLM 响应的影响。
- 通过改变嵌入模型、检索方法和重排序策略等参数,系统性地探索 RAG 系统的配置空间。
- 评估使用了经筛选的良性文档、用户查询及预期输出数据集,以定量测量攻击成功率。
- 攻击成功与否通过 LLM 是否生成恶意或模糊响应来衡量,若良性答案被包含在内,则模糊响应也被视为成功。
实验结果
研究问题
- RQ1在端到端 RAG 系统中,间接提示操纵攻击在劫持最终 LLM 响应方面的成功率如何?
- RQ2攻击效果在不同 RAG 流水线配置下如何变化?
- RQ3知识库中冗余的良性数据是否能降低间接提示注入攻击的成功率?
- RQ4与未优化的恶意文档相比,经优化的恶意文档在攻击有效性上表现如何?
- RQ5不同 RAG 组件(如嵌入模型、检索方法和重排序策略)的变化对攻击韧性有何影响?
主要发现
- 当仅将明确的恶意响应视为成功时,大多数间接提示注入攻击的成功率约为 40%。
- 若将包含预期良性答案的模糊响应也视为成功,则攻击成功率上升至约 60%。
- 攻击者使用未优化的恶意文档,可获得与高度优化文档相当的成功率,尤其是在针对单个查询部署两个或更多此类文档时。
- 对 RAG 配置参数的系统性探索表明,其在缓解攻击方面效果有限,最坚韧的配置甚至严重损害了系统功能。
- 知识库中存在冗余良性数据被观察到可降低攻击有效性,表明这是一种可行且轻量级的防御策略。
- 本研究证实,当前攻击主要针对检索排序进行优化,而非端到端的响应劫持,表明攻击复杂度尚有不足,未来工作应聚焦于下游组件(如 LLM 生成器)的攻击目标。
更好的研究,从现在开始
从阅读论文到最终审阅,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。