[Paper Review] AgentDojo: A Dynamic Environment to Evaluate Prompt Injection Attacks and Defenses for LLM Agents
AgentDojo is a dynamic benchmarking environment for evaluating LLM-based agents against prompt-injection attacks and defenses, featuring 97 tasks and 629 security test cases across four stateful environments.
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.
Motivation & Objective
- Provide a dynamic, extensible framework to assess how AI agents using tools handle untrusted data.
- Populate the framework with realistic tasks and security tests to measure attacker success and agent robustness.
- Enable evaluation of existing and new defenses against prompt injection in stateful tool-using agents.
- Offer a formal utility-based evaluation over environment state rather than LLM simulators.
Proposed method
- Model a stateful environment with multiple applications (e.g., emails, calendars, cloud storage).
- Define user tasks and injection tasks with formal utility checks to judge success.
- Implement 74 tools and 97 realistic user tasks across four environments.
- Use a cross-product of user tasks and injection tasks to create 629 security test cases.
- Evaluate agents and attackers using a variety of prompt injection attacks and defenses.
- Provide extensible interfaces to add new tasks, tools, attacks, and defenses.
Experimental results
Research questions
- RQ1How hard is it for current LLM agents to complete realistic tasks in the presence of prompt injections?
- RQ2How effective are existing defenses at reducing attacker success without destroying agent utility?
- RQ3Can AgentDojo guide the development of more robust agent designs and defense mechanisms?
- RQ4How does attacker knowledge about users and models affect attack success across tasks?
Key findings
- State-of-the-art LLMs solve less than 66% of AgentDojo tasks in benign settings.
- Attacks succeed against top-performing agents in less than 25% of cases.
- Defenses like a secondary attack detector reduce attack success to about 8%, though with utility trade-offs.
- Prompt injection effectiveness is influenced by where in the tool output the injection is placed, with end-of-output injections being most effective.
- Tool isolation defenses (tool filtering) can lower attack success to 7.5% but may fail when tasks require flexible tool use.
- GPT-4o shows the best benign utility but faces notable robustness challenges under adaptive prompts; Claude Opus offers competitive utility-robustness tradeoffs.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.