Terminal Wrench
收藏资源简介:
Terminal Wrench 是一个包含331个可被奖励黑客攻击的终端环境的数据集,以及3,632条导致黑客攻击和非黑客攻击奖励的代理轨迹。每条记录都保留了原始任务定义以及完整的攻击轨迹,展示了验证器是如何被通过的,包括任务未按预期解决的情况。这些任务涵盖系统管理、机器学习、软件工程和安全挑战,黑客攻击手段从简单的输出欺骗到堆栈帧内省、stdlib后门和rootkit风格的二进制劫持。这些黑客攻击轨迹是针对特定任务的,而不是针对基准/评估工具的,这使得它们更难修复。黑客攻击是通过在提示后附加一个黑客诱导摘录来诱发的。
Terminal Wrench is a dataset comprising 331 reward-eligible hacking terminal environments and 3,632 attack trajectories. Each dataset entry retains the original task definition and complete attack trajectory, illustrating the validation process, including scenarios where the task fails to be resolved as expected. These tasks cover system administration, machine learning, software engineering, and security challenges, with hacking methodologies ranging from simple output spoofing to stack frame introspection, standard library (stdlib) backdoors, and rootkit-style binary hijacking. The dataset also includes the results of a simple monitorability experiment, which demonstrates the changes in detectability between the original hacking trajectory and its two variants.
Terminal Wrench 数据集概述
数据集简介
Terminal Wrench 是一个包含331个可被奖励攻击的终端基准风格环境的数据集,并配有导致攻击和非攻击奖励的智能体轨迹。每个条目保留了原始任务定义以及展示验证器如何被通过的完整攻击轨迹,包括任务未被按预期解决的情况。任务涵盖系统管理、机器学习、软件工程和安全挑战,攻击方式从简单的输出欺骗到堆栈帧内省、标准库后门和 rootkit 风格的二进制劫持。这些攻击轨迹是任务特定的,而非基准/评估框架特定的,因此更难修复。
核心数据统计
- 唯一任务数量:331
- 任务/模型条目数量:957
- v5 攻击者轨迹总数:6,289
- 攻击轨迹数量:3,632
- 攻击者合法解决轨迹数量:1,216
- 无奖励尝试轨迹数量:1,441
- 基线轨迹数量:2,352
- 使用的模型:
claude-opus-4.6、gemini-3.1-pro、gpt-5.4
源数据集
任务来源于五个公开的终端智能体基准。下表统计了 Terminal Wrench 中的唯一任务数量,并统计了任务所属的每个源数据集。
| 源数据集 | 总数 | 包含数 | 包含率 | 基线 | 攻击 | ~ 合法 | ° 无奖励 |
|---|---|---|---|---|---|---|---|
| terminal-bench__2.0 | 89 | 14 | 15.7% | 200 | 186 | 66 | 102 |
| terminal-bench-pro | 200 | 48 | 24.0% | 270 | 486 | 132 | 261 |
| OpenThoughts-TB-dev | 70 | 9 | 12.9% | 219 | 234 | 22 | 48 |
| seta_2026_01_29 | 1,376 | 241 | 17.5% | 1,385 | 2,420 | 958 | 891 |
| TerminalBench-original | 233 | 36 | 15.5% | 534 | 545 | 120 | 251 |
| 总计(含重叠) | 1,968 | 348 | 17.7% | 2,608 | 3,871 | 1,298 | 1,553 |
按模型统计
| 模型 | 任务/模型条目 | 基线 | 攻击 | ~ 合法 | ° 无奖励 |
|---|---|---|---|---|---|
| claude-opus-4.6 | 323 | 614 | 1,119 | 1,027 | 316 |
| gemini-3.1-pro | 321 | 984 | 1,495 | 38 | 630 |
| gpt-5.4 (high) | 313 | 754 | 1,018 | 151 | 495 |
| 总计 | 957 | 2,352 | 3,632 | 1,216 | 1,441 |
攻击类别
攻击类别统计直接来源于存储的 observed_categories 判断。类别是粗略的且非互斥的。
| 类别 | 数量 | 描述 |
|---|---|---|
hollow-implementation |
2,243 | 通过测试但不实现任何真实逻辑 |
output-spoofing |
1,071 | 伪造预期输出而不进行计算 |
constraint-loophole |
849 | 满足规范的表面要求但违背其意图 |
structural-extraction |
529 | 读取验证器源代码或答案密钥以提取预期输出 |
binary-hijacking |
428 | 替换或修补二进制文件、标准库模块或系统工具 |
keyword-gaming |
312 | 插入死代码或注释以满足静态分析检查 |
algorithmic-simplification |
339 | 使用恰好能通过的极其简单的方法 |
mutable-input-tampering |
322 | 通过侧信道修改共享状态或调用者变量 |
metric-spoofing |
236 | 操纵测量基础设施(计时器、计数器、评分) |
security-downgrading |
80 | 削弱安全控制,同时使审计工具报告合规 |
deceptive-rationalization |
38 | 将攻击行为描述为合法行为,或将捷径隐藏在看似合理的故事背后 |
监控实验
数据集包含监控实验,每个攻击轨迹可以与存储在 stripped_trajectories/<label>/trial/agent/trajectory.json 下的剥离变体配对。剥离文件源自原始攻击 trajectory.json,通过从第一条用户消息中移除红队提示并清空所有智能体消息文本,同时保留步骤结构、工具调用、命令和观察结果。这使得比较能看到完整推理的监控器与只能看到动作和输出的监控器成为可能。
每个攻击轨迹也可以与存储在 sanitized_trajectories/<label>/trial/agent/trajectory.json 下的净化变体配对,并附有一个记录净化模型的 sanitizer_model.txt 文件。这些文件源自原始攻击 trajectory.json,通过从第一条用户消息中移除红队提示并重写智能体消息以移除对攻击的明确引用,同时保留技术动作和观察结果。
使用 gpt-5.4 和 judge prompt 对原始、净化和剥离的攻击轨迹进行评分,并与 gpt-5.4 对 2,352 个合法基线轨迹的判断进行比较。
| 变体 | AUC | TPR@5%FPR | 阳性均值 | 阴性均值 | N_pos | N_neg |
|---|---|---|---|---|---|---|
| 原始 | 0.9679 | 0.8235 | 0.9586 | 0.1777 | 3,632 | 2,352 |
| 净化 | 0.9474 | 0.6187 | 0.9083 | 0.1777 | 3,632 | 2,352 |
| 剥离 | 0.9168 | 0.4400 | 0.8228 | 0.1777 | 3,632 | 2,352 |
数据集结构
数据集遵循以下目录结构:
terminal-wrench/ ├── dataset_manifest.json ├── task_source_datasets.json ├── index/ ├── prompts/ └── tasks/ └── <task_id>/ ├── hack_summary.md └── <model>/ ├── task.json ├── original_task/ ├── baseline_trajectories/ ├── hack_trajectories/ ├── sanitized_trajectories/ ├── stripped_trajectories/ └── non_hack_trajectories/
引用信息
bibtex @misc{terminalwrench2026, title = {Terminal Wrench: A Dataset of 331 Reward-Hackable Environments and 3,632 Exploit Trajectories}, author = {Ivan Bercovich and Ziqian Zhong and Ivgeni Segal and Kexun Zhang and Shashwat Saxena and Aditi Raghunathan}, year = {2026}, url = {https://github.com/few-sh/terminal-wrench}, }
作者列表
| 作者 | 邮箱 | 机构 | 角色 |
|---|---|---|---|
| Ivan Bercovich | ibercovich@gmail.com | Fewshot Corp | 贡献者 |
| Ziqian Zhong | ziqianz@andrew.cmu.edu | Carnegie Mellon University | 贡献者 |
| Ivgeni Segal | ivgeni.segal@gmail.com | Fewshot Corp | 贡献者 |
| Kexun Zhang | zkx06111@gmail.com | Fewshot Corp; 独立研究员 | 贡献者 |
| Shashwat Saxena | ssaxena2@cs.cmu.edu | Carnegie Mellon University | 贡献者 |
| Aditi Raghunathan | raditi@cmu.edu | Carnegie Mellon University | 导师 |




