TransHarness: From Benchmark Overfitting to Transferable Harness Evolution
Organizations: Huazhong University of Science and Technology, Wuhan, China · Unicom Data Intelligence, China Unicom, Beijing, China · Xiamen University, Xiamen, China · Beijing Jiaotong University, Beijing, China
Abstract
Harness evolution offers a path to improving coding agents without updating model weights. However, existing methods can overfit their evolution benchmarks, producing gains that fail to carry over to new tasks. To address this challenge, we introduce Transferable Harness Evolution (TransHarness), which evolves harness intervention policies from same-task success-failure contrasts. These policies couple execution-context triggers with diagnostic guidance, enabling task-dependent checks and corrections beyond the source executions. Cross-task replay and independent semantic selection retain policies that intervene selectively and ground corrections in current-task evidence rather than source-specific solutions. We further curate an independent evolution set for cross-distribution transfer and conduct a cross-benchmark evaluation covering multiple strong models and a range of lightweight and mature harnesses. Experiments show that, with only 300 source trajectories from outside the test distribution, TransHarness further improves strong agents across distinct target benchmarks, demonstrating transferable harness evolution beyond benchmark overfitting. Specifically, TransHarness achieves state-of-the-art scores of 76.4% on DeepSWE v1.1 and 95.5% on Terminal-Bench 2.1, surpassing the strongest baseline model, GPT-6 Astra, by 2.4 and 5.6 percentage points, respectively.
Figures & tables
| Method | Score | Rec. | Reg. |
|---|---|---|---|
| TransHarness (Ours) | 76.4 | +13.0 | −9.7 |
| w/o learned triggers | 72.6 (−3.8) | +12.7 | −13.3 |
| w/o reassessment | 65.5 (−10.9) | +8.8 | −16.5 |
| w/o triggers & reassessment | 66.4 (−10.0) | +10.9 | −17.7 |
| w/o construction review | 67.3 (−9.1) | +9.4 | −15.3 |
Appendix figures & tables7 assets
Supplementary material from the paper’s appendix.
Appendix
| Initial guidance | Reviewed guidance | |
|---|---|---|
| Verification | Run existing tests. | Run existing tests. |
| Repair scope | Fix any failures. | Repair failures caused by the current change. |
| Unrelated failures | The instruction also obligates repair. | Report the failure without expanding the repair obligation. |
| Decision criterion | A failing test is enough to demand repair. | The failure’s relation to the current change determines the response. |
| Policy | Activation | Guidance |
|---|---|---|
| Requirement contract | Once at session start. | Treat observable requirements as the contract. Act on gaps exposed by checks and ground verification in visible evidence. |
| Read truncated output | Once before the next model step after a truncation marker. | Page through the result or narrow the query before deciding an item is absent. |
| Interpret passing baseline checks | Once after a passing check before production code is edited. | Identify existing behavior that should remain and verify the new requirement separately. |
| Reconcile old checks with new requirements | At session start and after the first passing pre-edit check. | Check whether an old assertion encodes a contract superseded by the new requirement. |
| Verify with real project objects | After a self-authored file runs successfully, up to twice. | Exercise actual project objects and helpers, including cases where the relevant member is missing. |
| Audit requirement coverage | After a self-authored check passes following an edit to another file, up to twice. | Exercise valid and alternative forms, missing inputs, and malformed inputs required by the task. |
| Application domain | Evolution set (TransHarness) | DeepSWE v1.1 | Terminal-Bench 2.1 |
|---|---|---|---|
| Product workflows | 59.0 | 2.7 | 1.1 |
| Programming and development | 11.0 | 67.3 | 22.5 |
| Systems and services | 15.0 | 10.6 | 12.4 |
| Data and content processing | 3.0 | 13.3 | 19.1 |
| Scientific and ML computing | 1.0 | 4.4 | 34.8 |
| Security and cryptography | 11.0 | 1.8 | 10.1 |
Agent Harness Optimization
Agent harness optimization improves the prompts, tools, memory, workflows, and control code that shape how AI agents act.
See all 220 papers