A Dynamic Environment to Evaluate Attacks and Defenses for LLM Agents
Project description
AgentDojo: A Dynamic Environment to Evaluate Prompt Injection Attacks and Defenses for 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
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
Inspect the results
To inspect the results, go to the dedicated results page of the documentation. AgentDojo results are also listed in the Invariant Benchmark Registry.Agent
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:
@inproceedings{
debenedetti2024agentdojo,
title={AgentDojo: A Dynamic Environment to Evaluate Prompt Injection Attacks and Defenses for {LLM} Agents},
author={Edoardo Debenedetti and Jie Zhang and Mislav Balunovic and Luca Beurer-Kellner and Marc Fischer and Florian Tram{\`e}r},
booktitle={The Thirty-eight Conference on Neural Information Processing Systems Datasets and Benchmarks Track},
year={2024},
url={https://openreview.net/forum?id=m1YYAQjO3w}
}
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file agentdojo-0.1.35.tar.gz.
File metadata
- Download URL: agentdojo-0.1.35.tar.gz
- Upload date:
- Size: 720.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9eacbc89d996f8656b235ad7b626bcf840b1ace7101174ca62d790c7c6d62956
|
|
| MD5 |
14c7f307e75d8b14eefab7ae193cfee5
|
|
| BLAKE2b-256 |
8adc2cc783d46c73297c15127d3b7971d7ba7b5cb782bf36a8b240079f7df61d
|
Provenance
The following attestation bundles were made for agentdojo-0.1.35.tar.gz:
Publisher:
publish.yaml on ethz-spylab/agentdojo
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
agentdojo-0.1.35.tar.gz -
Subject digest:
9eacbc89d996f8656b235ad7b626bcf840b1ace7101174ca62d790c7c6d62956 - Sigstore transparency entry: 645682355
- Sigstore integration time:
-
Permalink:
ethz-spylab/agentdojo@a75aba7631d3ca5fb7ab938965c97ead2f9ff84b -
Branch / Tag:
refs/tags/v0.1.35 - Owner: https://github.com/ethz-spylab
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yaml@a75aba7631d3ca5fb7ab938965c97ead2f9ff84b -
Trigger Event:
release
-
Statement type:
File details
Details for the file agentdojo-0.1.35-py3-none-any.whl.
File metadata
- Download URL: agentdojo-0.1.35-py3-none-any.whl
- Upload date:
- Size: 192.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
364bea4219716b716bf639f504d195943f7f6a5535d312ca41d7098704a2affd
|
|
| MD5 |
856cafbbff743c1d83b06b83ad1b70a7
|
|
| BLAKE2b-256 |
caa0371be72fdd08bbae0c3c5cd22e6b35390f35c9cbe189d14b72e49058bd4b
|
Provenance
The following attestation bundles were made for agentdojo-0.1.35-py3-none-any.whl:
Publisher:
publish.yaml on ethz-spylab/agentdojo
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
agentdojo-0.1.35-py3-none-any.whl -
Subject digest:
364bea4219716b716bf639f504d195943f7f6a5535d312ca41d7098704a2affd - Sigstore transparency entry: 645682386
- Sigstore integration time:
-
Permalink:
ethz-spylab/agentdojo@a75aba7631d3ca5fb7ab938965c97ead2f9ff84b -
Branch / Tag:
refs/tags/v0.1.35 - Owner: https://github.com/ethz-spylab
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yaml@a75aba7631d3ca5fb7ab938965c97ead2f9ff84b -
Trigger Event:
release
-
Statement type: