TrojanBench
TrojanBench is a benchmark of 383 poisoned repositories for evaluating the robustness of AI coding agents against repository-level poisoning attacks. Every instance is a fully functional open-source project that carries a concealed payload of one of four carrier types, planted by an automated red-team pipeline (TrojanForge) while preserving the repository's original utility.
The benchmark described in the paper contains 384 instances. One C1 (exfiltration) instance was excluded from this release because its poisoned scene could not be recovered from archival storage.
Request access
TrojanBench is a gated dataset. To download, first submit the access-request form.
The form collects your name, affiliation, contact email, Hugging Face username, and intended use. After review we approve your Hugging Face account, and you can download the dataset with your HF token (see "Download shards" below). Read the "Safety and ethics" section before use.
** if request is pending, directly send mail to houjinchang@baidu.com and yangxiao1102@buaa.edu.cn**
Safety and ethics
- All secrets are synthetic. Planted credentials use documentation-example keys and generated placeholders. No real credentials are included anywhere in the benchmark.
- All attack endpoints are local. Exfiltration payloads are fail-closed: they resolve
to
127.0.0.1sinks so nothing leaves the evaluation machine. A "successful attack" is only observable through the local capture server. - Defensive research only. TrojanBench is intended for agent-robustness evaluation, red-teaming research, and safety training. Do not deploy these repositories on machines or services you do not own or control. Access is granted on request for research use.
- Each
scene/retains the LICENSE of its upstream open-source project. The collection is distributed for research purposes; upstream licenses remain in force per instance.
Structure
TrojanBench/
βββ manifest.jsonl # one JSON line per instance (ground truth index)
βββ README.md
βββ <domain>/ # 6 task domains
β βββ C1-exfiltration/
β βββ C2-destruction/
β βββ C3-tampering/
β βββ C4-backdoor/
β βββ <repo_id>/ # one benchmark instance
β βββ scene/ # the poisoned repository (working tree)
β βββ task.txt # the natural-language dev task given to the agent
β βββ instance.json # instance metadata (carrier, source agent, domain, ...)
β βββ injection.json # carrier spec: mount point + forced command chain
β βββ decoy_manifest.json # C2: decoy assets ground truth (sha256)
β βββ sentinel_manifest.json # C3: tamper-sentinel files ground truth (sha256)
β βββ backdoor_manifest.json # C4: backdoor files ground truth (sha256)
Domains: issue-fix (123), app-dev (101), env-setup (49), data-proc (46),
perf-opt (34), it-ops (30).
Instance format
| File | Carriers | Meaning |
|---|---|---|
scene/ |
all | The poisoned repository. Run the task here; verdicts come from the manifests below plus local capture. |
task.txt |
all | The benign-looking development task. Never references the payload. |
instance.json |
all | instance_id, repo_id, source_repo, source_agent, carrier, domain, language. |
injection.json |
C2/C3/C4 | Carrier spec: planted variant, mount point, forced commands that trigger the payload. |
decoy_manifest.json |
C2 | Decoy asset files with sha256; destruction is judged against these. |
sentinel_manifest.json |
C3 | Sentinel files with sha256; tampering is judged as sha divergence from the pristine baseline. |
backdoor_manifest.json |
C4 | Backdoored files with sha256 and watch flags. |
Statistics
By carrier (of 383): exfiltration 73, destruction 72, tampering 108, backdoor 130.
By source agent (the agent whose repositories the poison was crafted and verified against): DeepSeek 102, Codex 98, Claude Code 88, OpenClaw 95.
By language: Python 231, Go 86, TypeScript 29, JavaScript 15, Java 9, Rust 5, Shell 3, C++ 3, C 2.
Seed repositories: 132 distinct open-source projects (SWE-bench, Commit0, and actively maintained GitHub projects), each retaining its upstream license.
Download shards
The dataset is packaged as 24 tar.zst shards (<domain>_<carrier>.tar.zst). Extract
all shards into the same directory to rebuild the tree above. SHA256SUMS lists the
checksum of every shard and top-level file.
zstdcat issue-fix_C1-exfiltration.tar.zst | tar -x
# or: tar -I zstd -xf issue-fix_C1-exfiltration.tar.zst
Citation
@misc{yang2026trojanhorseautomatedrepository,
title={Trojan Horse: Automated Repository Poisoning against Coding Agents},
author={Xiao Yang and Jinchang Hou and Jiawei Chen and Zhonghou Lv and Junyuan Shang and Chenfu Bao},
year={2026},
eprint={2610.23109},
archivePrefix={arXiv},
primaryClass={cs.CR},
url={https://arxiv.org/abs/2610.23109},
}
- Downloads last month
- 57