A Dynamic Environment to Evaluate Attacks and Defenses for LLM Agents
Project description
AgentDojo: Benchmarking the Capabilities and Adversarial Robustness of LLM Agents
Edoardo Debenedetti1, Jie Zhang1, Mislav Balunović1,2, Luca Beurer-Kellner1,2, Marc Fischer1,2, Florian Tramèr1
1ETH Zurich and 2Invariant Labs
Read our paper here.
Quickstart
pip install agentdojo
[!IMPORTANT] Note that the API of the package is still under development and might change in the future.
If you want to use the prompt injection detector, you need to install the transformers
extra:
pip install "agentdojo[transformers]"
Running the benchmark
The benchmark can be run with the benchmark script. Documentation on how to use the script can be obtained with the --help
flag.
For example, to run the workspace
suite on the tasks 0 and 1, with gpt-4o-2024-05-13
as the LLM, the tool filter as a defense, and the attack with tool knowlege, run the following command:
python -m agentdojo.scripts.benchmark -s workspace -ut user_task_0 \
-ut user_task_1 --model gpt-4o-2024-05-13 \
--defense tool_filter --attack tool_knowledge
To run the above, but on all suites and tasks, run the following:
python -m agentdojo.scripts.benchmark --model gpt-4o-2024-05-13 \
--defense tool_filter --attack tool_knowledge
Documentation of the Dojo
Take a look at our documentation.
Development set-up
Take a look at the development set-up docs.
Citing
If you use AgentDojo in your research, please consider citing our paper:
@misc{debenedetti2024agentdojo,
title={AgentDojo: A Dynamic Environment to Evaluate 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},
primaryClass={cs.CR}
}
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file agentdojo-0.1.17.tar.gz
.
File metadata
- Download URL: agentdojo-0.1.17.tar.gz
- Upload date:
- Size: 19.0 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.0.0 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a6e7dd87719b8a5fb440d5c0a848a6b833430ac676fabd1ba8e89b893fc4c530 |
|
MD5 | 67761e470dddf77311e6d1f022031333 |
|
BLAKE2b-256 | bf90ad90ccbe77a35c493fece168717f26a8a92515da3b1e2e8139b4882df4eb |
File details
Details for the file agentdojo-0.1.17-py3-none-any.whl
.
File metadata
- Download URL: agentdojo-0.1.17-py3-none-any.whl
- Upload date:
- Size: 154.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.0.0 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4fe354964fa5d97ea759c617b4e908f4127f7215a0ab71df594011ca67456b93 |
|
MD5 | 059c5ca76fccce60b82d0e5c320413bf |
|
BLAKE2b-256 | 145727fa87ab670aed7caf9ce84e526b483d9bade1f3c368bd682333d1aa5d1e |