google-research/camel-prompt-injection
关于
论文《Defeating Prompt Injections by Design》的代码。
其他项目实测星标增长
- 24小时
- +2
- 7天
- +8
- 15天
- +12
- 1个月
- 正在收集历史
各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。
README.md
原文CaMeL: Defeating Prompt Injections by Design
Edoardo Debenedetti1,3, Ilia Shumailov2, Tianqi Fan1, Jamie Hayes2, Nicholas Carlini2, Daniel Fabian1, Christoph Kern1, Chongyang Shi2, Florian Tramèr3
1Google, 2Google DeepMind, and 3ETH Zurich
[!WARNING] This is a research artifact released to reproduce the results in our paper. The interpreter implementation likely contains bugs (e.g., it might throw uncaught exceptions and crash) and the implementation might not be fully secure.
This is not a Google product, and we are not planning to provide support for and/or maintain this codebase.
Pre-requisites
- Install
uvvia the official instructions. - Rename
.env.exampleto.envand populate it with your API keys. uvwill install all dependencies as soon as you runuv run ....
Running running the defense against AgentDojo
uv run --env-file .env main.py MODEL_NAME [--use-original] [--ad_defense] [--reasoning-effort] [--thinking_budget_tokens] [--run-attack] [--replay-with-policies] [--eval_mode]
More details on the various CLI arguments can be found by running uv run main.py --help
FAQ
How do I try a new/different model?
You can add it to the models.py file, in the _supported_model_names variable. The keys are the model names with the given provider (check the provider's API) and the values is what the model says when asked "what model are you?". Keep in mind that OpenAI reasoning models are stored in the _oai_thinking_models variable instead.
If I have questions on the codebase how can I reach out?
Please open an issue in this repository. Please note that we are not planning to fix bugs as this codebase is just meant as a research artifact.
Running tests and linters
uv run ruff check --fix
uv run format
uv run pyright
uv run pytest
This is not an officially supported Google product. This project is not eligible for the Google Open Source Software Vulnerability Rewards Program.
探索相关项目
加载中…