[论文解读] AgentDojo: A Dynamic Environment to Evaluate Prompt Injection Attacks and Defenses for LLM Agents
AgentDojo 是一个动态基准环境,用于评估基于 LLM 的代理对抗提示注入攻击及防御,涵盖四个具状态环境中的 97 项任务和 629 个安全测试用例。
AI agents aim to solve complex tasks by combining text-based reasoning with external tool calls. Unfortunately, AI agents are vulnerable to prompt injection attacks where data returned by external tools hijacks the agent to execute malicious tasks. To measure the adversarial robustness of AI agents, we introduce AgentDojo, an evaluation framework for agents that execute tools over untrusted data. To capture the evolving nature of attacks and defenses, AgentDojo is not a static test suite, but rather an extensible environment for designing and evaluating new agent tasks, defenses, and adaptive attacks. We populate the environment with 97 realistic tasks (e.g., managing an email client, navigating an e-banking website, or making travel bookings), 629 security test cases, and various attack and defense paradigms from the literature. We find that AgentDojo poses a challenge for both attacks and defenses: state-of-the-art LLMs fail at many tasks (even in the absence of attacks), and existing prompt injection attacks break some security properties but not all. We hope that AgentDojo can foster research on new design principles for AI agents that solve common tasks in a reliable and robust manner.. We release the code for AgentDojo at https://github.com/ethz-spylab/agentdojo.
研究动机与目标
- 提供一个动态、可扩展的框架,用来评估使用工具的 AI 代理在处理不可信数据时的表现。
- 用现实任务和安全测试填充框架,以衡量攻击者成功率和代理鲁棒性。
- 使现有与新防御措施在面对有状态工具使用代理中的提示注入时能够被评估。
- 提供基于效用的正式评估,关注环境状态而非 LLM 仿真器。
提出的方法
- 建模一个具多应用的有状态环境(例如电子邮件、日历、云存储)。
- 定义用户任务和注入任务,使用正式效用检查来判断成功。
- 实现 74 种工具和 97 个现实用户任务,跨四个环境。
- 通过用户任务与注入任务的笛卡尔积来创建 629 个安全测试用例。
- 使用多种提示注入攻击和防御来评估代理与攻击者。
- 提供可扩展接口,以添加新任务、工具、攻击与防御。
实验结果
研究问题
- RQ1在存在提示注入的情况下,当前的 LLM 代理完成现实任务有多困难?
- RQ2现有防御在不削弱代理效用的前提下,减少攻击者成功率有多有效?
- RQ3AgentDojo 能否引导更强健的代理设计与防御机制的发展?
- RQ4攻击者对用户和模型的知识如何影响跨任务的攻击成功率?
主要发现
- 最新的 LLM 在良性设置下能解决 AgentDojo 任务的比例不到 66%。
- 针对表现最好的代理,攻击在不到 25% 的情况下成功。
- 如二次攻击检测等防御可将攻击成功率降至约 8%,但伴随效用权衡。
- 提示注入的有效性受注入位于工具输出中的位置影响,输出末尾的注入最有效。
- 工具隔离防御(工具筛选)可将攻击成功率降至 7.5%,但在任务需要灵活使用工具时可能失效。
- GPT-4o 在良性效用方面表现最佳,但在自适应提示下存在显著鲁棒性挑战;Claude Opus 提供竞争性的效用-鲁棒性权衡。
阅读本论文
在 Nubint 阅读器中打开原文,边读边就任意段落提问。
在 Nubint 中阅读本论文本解读由 AI 根据论文原文生成,引用前请核对原文。