Skip to main content

A Dynamic Environment to Evaluate Attacks and Defenses for LLM Agents

Project description

AgentDojo: Benchmarking the Capabilities and Adversarial Robustness of LLM Agents

GitHub License GitHub Actions Workflow Status PyPI - Python Version PyPI - Downloads PyPI - Version

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

agentdojo-0.1.22.tar.gz (20.5 MB view details)

Uploaded Source

Built Distribution

agentdojo-0.1.22-py3-none-any.whl (163.5 kB view details)

Uploaded Python 3

File details

Details for the file agentdojo-0.1.22.tar.gz.

File metadata

  • Download URL: agentdojo-0.1.22.tar.gz
  • Upload date:
  • Size: 20.5 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.0.0 CPython/3.12.7

File hashes

Hashes for agentdojo-0.1.22.tar.gz
Algorithm Hash digest
SHA256 f6374d0bee72434746dd6c3af574195a50c92ddb188944ac646a7ea9453e4523
MD5 7a280b01b2fcd708ca1d3df1c48d34d5
BLAKE2b-256 135c7f740cc9aa0e18ebf512d40dfc8fe91b0db0230f6e0647e691c4a434b6a2

See more details on using hashes here.

File details

Details for the file agentdojo-0.1.22-py3-none-any.whl.

File metadata

  • Download URL: agentdojo-0.1.22-py3-none-any.whl
  • Upload date:
  • Size: 163.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.0.0 CPython/3.12.7

File hashes

Hashes for agentdojo-0.1.22-py3-none-any.whl
Algorithm Hash digest
SHA256 2153405c3345ae9d4bac85fe706df7442f6c0c5319b4d5774a14630c972b997b
MD5 359949ca5edcf0624a3c68db9eb0e175
BLAKE2b-256 699eddfc13c66cc1a0e0c3823d20796ac14ef8c3081752049a8fb6ba8de5a76c

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page