InjecAgent: Benchmarking Indirect Prompt Injections in Tool-Integrated Large Language Model Agents
作者: Qiusi Zhan, Zhixiang Liang, Zifan Ying, Daniel Kang
分类: cs.CL, cs.CR
发布日期: 2024-03-05 (更新: 2024-08-04)
备注: 36 pages, 6 figures, 13 tables (ACL 2024 Findings)
🔗 代码/项目: GITHUB
💡 一句话要点
提出InjecAgent以评估工具集成LLM代理的间接提示注入攻击风险
🎯 匹配领域: 支柱九:具身大模型 (Embodied Foundation Models)
关键词: 间接提示注入 大型语言模型 安全评估 工具集成 对抗性攻击
📋 核心要点
- 现有的工具集成LLM代理在处理外部内容时面临间接提示注入攻击的风险,可能导致用户受到伤害。
- 论文提出InjecAgent基准,通过1054个测试案例评估LLM代理对IPI攻击的脆弱性,涵盖多种用户和攻击者工具。
- 实验结果显示,ReAct提示的GPT-4在24%的情况下受到攻击,结合黑客提示后成功率几乎翻倍,揭示了LLM代理的安全隐患。
📝 摘要(中文)
近年来,研究将大型语言模型(LLM)作为代理,使其能够访问工具、执行操作并与外部内容(如电子邮件或网站)互动。然而,外部内容引入了间接提示注入(IPI)攻击的风险,恶意指令可能嵌入LLM处理的内容中,旨在操控这些代理执行对用户有害的操作。鉴于此类攻击可能带来的严重后果,建立评估和缓解这些风险的基准显得尤为重要。本研究提出了InjecAgent,一个旨在评估工具集成LLM代理对IPI攻击脆弱性的基准,涵盖1054个测试案例,涉及17种用户工具和62种攻击者工具。我们将攻击意图分为两类:对用户的直接伤害和私密数据的外泄。评估结果显示,30种不同的LLM代理对IPI攻击存在脆弱性,ReAct提示的GPT-4在24%的情况下受到攻击。进一步的研究表明,攻击者指令与黑客提示结合使用时,成功率几乎翻倍。
🔬 方法详解
问题定义:本论文旨在解决工具集成LLM代理在处理外部内容时的间接提示注入(IPI)攻击脆弱性。现有方法未能有效评估和缓解此类攻击的风险,导致潜在的安全隐患。
核心思路:论文提出InjecAgent基准,通过系统化的测试案例评估LLM代理的安全性,特别关注攻击者如何利用外部内容进行间接提示注入。设计此基准的目的是为了提供一个标准化的评估框架,以便研究者和开发者能够识别和修复安全漏洞。
技术框架:InjecAgent基准包含1054个测试案例,涵盖17种用户工具和62种攻击者工具。攻击意图被分类为直接伤害用户和外泄私密数据。评估过程中,针对30种不同的LLM代理进行测试,以量化其对IPI攻击的脆弱性。
关键创新:本研究的主要创新在于提出了一个全面的基准,专门针对工具集成LLM代理的间接提示注入攻击进行评估。这一基准不仅提供了攻击者工具的多样性,还系统化了攻击意图的分类,为后续研究提供了重要参考。
关键设计:在实验中,采用了多种攻击者工具和用户工具的组合,确保测试的全面性。特别是在ReAct提示的GPT-4中,结合黑客提示的攻击策略显著提高了攻击成功率,展示了设计的有效性。实验中还考虑了不同工具和提示的交互影响,以优化评估结果。
🖼️ 关键图片
📊 实验亮点
实验结果表明,ReAct提示的GPT-4在24%的情况下受到间接提示注入攻击,结合黑客提示后成功率几乎翻倍。这一发现强调了LLM代理在实际应用中的安全隐患,呼吁对其进行更严格的安全评估和防护措施。
🎯 应用场景
该研究的潜在应用领域包括安全性评估、LLM代理的开发和部署、以及对抗性攻击的防护策略制定。通过建立InjecAgent基准,开发者可以更好地识别和修复LLM代理中的安全漏洞,从而提升用户的安全体验。未来,该基准可能推动更安全的LLM应用和更强的防护机制的研发。
📄 摘要(原文)
Recent work has embodied LLMs as agents, allowing them to access tools, perform actions, and interact with external content (e.g., emails or websites). However, external content introduces the risk of indirect prompt injection (IPI) attacks, where malicious instructions are embedded within the content processed by LLMs, aiming to manipulate these agents into executing detrimental actions against users. Given the potentially severe consequences of such attacks, establishing benchmarks to assess and mitigate these risks is imperative. In this work, we introduce InjecAgent, a benchmark designed to assess the vulnerability of tool-integrated LLM agents to IPI attacks. InjecAgent comprises 1,054 test cases covering 17 different user tools and 62 attacker tools. We categorize attack intentions into two primary types: direct harm to users and exfiltration of private data. We evaluate 30 different LLM agents and show that agents are vulnerable to IPI attacks, with ReAct-prompted GPT-4 vulnerable to attacks 24% of the time. Further investigation into an enhanced setting, where the attacker instructions are reinforced with a hacking prompt, shows additional increases in success rates, nearly doubling the attack success rate on the ReAct-prompted GPT-4. Our findings raise questions about the widespread deployment of LLM Agents. Our benchmark is available at https://github.com/uiuc-kang-lab/InjecAgent.