AgentDojo: A Dynamic Environment to Evaluate Prompt Injection Attacks and Defenses for LLM Agents

Edoardo Debenedetti, Jie Zhang, Mislav Balunović, Luca Beurer-Kellner, Marc Fischer +1 more
6/19/2024
cs.CRcs.LG

Official code: ethz-spylab/agentdojo (939 stars, MIT, last commit 2026-03-30).

Abstract

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.

View on arXivView PDF

Code Implementations(1)

MIT

A Dynamic Environment to Evaluate Attacks and Defenses for LLM Agents.

939253Shell, PythonFeb 29, 20246 months agoMIT
benchmarklarge-language-modelsprompt-injectionsecurity

Similar Papers

Cite this paper

@article{debenedetti2024agentdojo,
  title  = {AgentDojo: A Dynamic Environment to Evaluate Prompt Injection Attacks and Defenses for LLM Agents},
  author = {Edoardo Debenedetti and Jie Zhang and Mislav Balunović and Luca Beurer-Kellner and Marc Fischer and Florian Tramèr},
  year   = {2024},
  eprint = {2406.13352},
  archivePrefix = {arXiv},
  doi    = {10.48550/arXiv.2406.13352},
  url    = {http://arxiv.org/abs/2406.13352v3},
  journal = {NEURIPS 2024 2024}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2406.13352.svg)](https://codeofpaper.com/paper/2406.13352)

Discussion