Views
No views yet
🚧 Actively developed. This is a living package — the API, CLI flags, and internals may change as we extend it. Runpython -m harden --helpfor the authoritative flag list.
| Role | Goal |
|---|---|
| 🔴 Hacker | Earn full reward without solving the task (exploit the verifier). |
| 🔵 Fixer | Given the hack trajectory + verifier source, patch the verifier to block the exploit. |
| 🟢 Solver | Pre-check the task is solvable, and confirm each patch still admits a legitimate solution. |

--hacker-privileged) — lets the hacker see the evaluation environment (tests/, environment/) to better anticipate and counter exploits.--pool-enabled) — fixes found in one task are shared with all others via a git repo, so improvements automatically spread across the dataset.--no-journal to disable) — records each round’s exploit and patch, letting all tasks (in pooled mode) benefit from what’s already been tried.--pool-enabled; it relies on
host.docker.internal:host-gateway, which is Linux-only)litellm; e.g. Gemini, Anthropic)1git clone https://github.com/few-sh/harden-v0.git
2cd harden-v0
3
4# Recommended: a virtual environment
5python -m venv .venv && source .venv/bin/activate
6
7# Dependencies
8pip install -r requirements.txt.env.tests/, solution/, and a reference). Point --tasks-dir at your task pool.1# Generic task (pass/fail reward, agent solver)
2python -m harden --task-id <task-id> \
3 --tasks-dir ./tasks \
4 --solver-model gemini/gemini-3.1-pro-preview \
5 --solver-privileged \
6 --max-iterations 5
7
8# Batch over many tasks
9python -m harden --task-ids task1,task2,task3 --max-concurrent 4
10python -m harden --all --tasks-dir ./tasks
11
12# KernelBench task
13python -m harden --kernelbench-mode --task-id matmul \
14 --hack-threshold 10 --solver-threshold 0.5 \
15 --max-iterations 5python -m harden --help for the full list.| Flag | Effect |
|---|---|
--hacker-model / --fixer-model / --solver-model | per-role model (litellm id, e.g. gemini/gemini-3.1-pro-preview) |
--summary-model | model used for hack / trajectory / journal summaries (default: derived) |
--max-iterations | loop budget (default 10) |
--hacker-retries | hacker attempts per iteration before declaring the task robust (default 3) |
--hacker-privileged | verifier access — mount tests//environment/ read-only at /eval_env/ |
--hacker-privileged-enable-iteration / --hacker-privileged-disable-iteration | turn verifier access on/off at a given iteration |
--hacker-feedback | let the hacker read its previous failed attempts |
--pool-enabled + --pool-bootstrap-dir | shared defense pool (jumper mode) |
--replay-enabled | targeted-replay post-solver gate |
--no-journal / --journal-compact-max-iters | shared hack/fix journal is on by default; disable or tune its compaction |
--fixer-prompt-file / --fixer-prompt-after-iter | inject extra fixer guidance from a file, optionally only after iteration N |
--no-legitimate-marker | disable the .legitimate sentinel (fixer can't flag a hack as legitimate) |
--image-name | tag isolation for concurrent runs (accepts a {task_id} placeholder) |
1@article{zhong2026harden,
2 title = {Hardening Agent Benchmarks with Adversarial Hacker-Fixer Loops},
3 author = {Zhong, Ziqian and Segal, Ivgeni and Bercovich, Ivan and
4 Saxena, Shashwat and Zhang, Kexun and Raghunathan, Aditi},
5 journal = {arXiv preprint arXiv:2606.08960},
6 year = {2026}
7}