RevengeBench: reverse-engineering code-space policies from behavioral experiments
Project description
RevengeBench
Reverse Engineering Code-Space Policies from Behavioral Experiments
Babak Rahmani* · Sebastian Dziadzio* · Joschka Strüber* · Sergio Hernández-Gutiérrez · Matthias Bethge
Tübingen AI Center
(*) Equal contribution.
RevengeBench poses an inverse problem in code-space: given only behavioral traces of an opaque target agent acting in a programming-game arena, can a learner reconstruct a runnable program that reproduces the target's behavior? The benchmark is built on 75 LLM-generated, Elo-calibrated target policies across five arenas: BattleSnake, Halite, HuskyBench, RoboCode, and RobotRumble.
The protocol pairs passive observation with constrained active intervention. The learner watches the hidden target play sampled opponents and may author probe opponents: runnable policies whose interaction with the target induces new trajectories. A probe acts only through the normal gameplay channel and has no privileged access to target source or internal state. The learner submits one executable hypothesis, which is scored by action-distance on held-out target states and by downstream player-versus-player tournaments.
This public release keeps upstream CodeClash as a git submodule and places the
RevengeBench-specific package in src/revenge_bench.
News
2026-07: RevengeBench was accepted to the Second Workshop on Agents in the Wild: Safety, Security, and Beyond (AIWILD) at ICML 2026. See the OpenReview page.
Installation
git clone --recurse-submodules <repo-url> revenge-bench
cd revenge-bench
uv venv .venv --python 3.11
source .venv/bin/activate
uv pip install -e .
If you cloned without submodules:
git submodule update --init --recursive
You also need Docker, or Singularity/Apptainer with CODECLASH_RUNTIME set.
Copy .env.example to .env and fill in the API keys for the LLM providers
you plan to use.
Running The Benchmark
Main pool run:
bash scripts/run_pool.sh --seeds "42"
This iterates over configs/benchmark/<model>/<model>_<game>.yaml.
Useful runner flags include --dry-run, --resume, --parallel N,
--configs "name_a name_b", and --config-dir <dir>.
Public optional conditions and baselines use the same runner:
bash scripts/run_no_probe.sh --seeds "42"
bash scripts/run_nl_observation.sh --seeds "42"
bash scripts/run_bpi.sh --seeds "42"
Forward-PvP runs use the curated configs under configs/forward_pvp/:
bash scripts/run_forward_pvp.sh \
--challengers "gpt5 gpt5-mini gpt-oss-120b grok-4.1-fast kimi-k2.6 deepseek-v3.2"
Optional Tracks
The main benchmark condition is active inverse-strategy recovery with probes. The public release also includes:
configs/conditions/no_probe/: trace-only recovery with active probes disabled.configs/conditions/nl_observation/: recovery from LLM-generated natural-language summaries of traces.configs/baselines/bpi/: Bayesian Program Inference baseline configs.configs/forward_pvp/: downstream PvP configs comparing blind, recovered, and oracle opponent intelligence.
Paper-only plotting, history-compaction sweeps, reset-memory sweeps, and probe prompt ablation suites are intentionally not part of this release package.
Adding Target Policies
Create a directory under data/targets/<arena>/<policy_name>/ with a
main.py implementing the arena's player API. See the existing target pools
for examples.
Optional CodeClash target-pool generation helpers live under
scripts/codeclash_strategies/. They can download CodeClash viewer artifacts,
extract runnable strategies, validate them, and run Elo selection:
bash scripts/codeclash_strategies/build_pool.sh --game BattleSnake --count 40
Relationship To CodeClash
RevengeBench started from CodeClash and still relies on CodeClash's arena and
execution abstractions. The upstream CodeClash source is preserved as a
submodule in vendor/codeclash; RevengeBench-specific code lives in
src/revenge_bench so the benchmark can evolve without modifying the vendored
upstream tree.
Layout
revenge-bench/
├── vendor/codeclash/ # Upstream CodeClash submodule
├── src/revenge_bench/ # RevengeBench package
│ ├── arenas/ # Release arena wrappers/extensions
│ ├── tournaments/ # Inverse-strategy, Forward-PvP, and BPI tournaments
│ ├── agents/ # LLM agent wrappers
│ ├── traces/ # Per-arena trace parsers
│ └── scripts/ # Importable pipeline utilities
├── configs/
│ ├── benchmark/ # Main model x arena configs
│ ├── conditions/ # Public optional conditions: no-probe, NL observation
│ ├── baselines/ # Public baselines, including BPI
│ ├── prompts/ # Runtime prompt templates
│ └── forward_pvp/ # Forward-PvP configs
├── data/targets/ # Target policy pools
├── scripts/ # Runtime and evaluation entry points
│ └── codeclash_strategies/ # Optional target-pool generation tooling
├── tests/
└── main.py # Compatibility entry point
Citation
@article{rahmani2026revengebench,
title={RevengeBench: Reverse Engineering Code-Space Policies from Behavioral Experiments},
author={Rahmani, Babak and Dziadzio, Sebastian and Str{\"u}ber, Joschka and Hern{\'a}ndez-Guti{\'e}rrez, Sergio and Bethge, Matthias},
journal={arXiv preprint arXiv:2606.26094},
year={2026}
}
License
This repository is released under the MIT License. See LICENSE for details.
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 revenge_bench-0.1.0.tar.gz.
File metadata
- Download URL: revenge_bench-0.1.0.tar.gz
- Upload date:
- Size: 1.7 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2f7a389739cc88500ad9ba4b19204e46cae73c9dece40771898007590cc46f84
|
|
| MD5 |
829c8dac778990937f723c20a3dcff4e
|
|
| BLAKE2b-256 |
90e72ade4b63271e6a8eed31ffb01e3eb6ebd1f3b2e2e08eb0b7fc93c2b384c4
|
Provenance
The following attestation bundles were made for revenge_bench-0.1.0.tar.gz:
Publisher:
publish.yml on bethgelab/revenge-bench
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
revenge_bench-0.1.0.tar.gz -
Subject digest:
2f7a389739cc88500ad9ba4b19204e46cae73c9dece40771898007590cc46f84 - Sigstore transparency entry: 2115720086
- Sigstore integration time:
-
Permalink:
bethgelab/revenge-bench@e306d11e81cc5a62f62c4ea1ab259b67c924536b -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/bethgelab
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@e306d11e81cc5a62f62c4ea1ab259b67c924536b -
Trigger Event:
push
-
Statement type:
File details
Details for the file revenge_bench-0.1.0-py3-none-any.whl.
File metadata
- Download URL: revenge_bench-0.1.0-py3-none-any.whl
- Upload date:
- Size: 618.9 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 |
5c9779502edd3bcd396b3d4f18556f019ffb46385cfd864f0e7cb275f4063b2e
|
|
| MD5 |
0ffbf8e775f7d03a9586078449fa9063
|
|
| BLAKE2b-256 |
0efaf1333b722c63c18d463b2381185f758fc7e032381b4d7bc12879f04b42c5
|
Provenance
The following attestation bundles were made for revenge_bench-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on bethgelab/revenge-bench
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
revenge_bench-0.1.0-py3-none-any.whl -
Subject digest:
5c9779502edd3bcd396b3d4f18556f019ffb46385cfd864f0e7cb275f4063b2e - Sigstore transparency entry: 2115720144
- Sigstore integration time:
-
Permalink:
bethgelab/revenge-bench@e306d11e81cc5a62f62c4ea1ab259b67c924536b -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/bethgelab
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@e306d11e81cc5a62f62c4ea1ab259b67c924536b -
Trigger Event:
push
-
Statement type: