TL;DR
Coding agents rely on "harnesses"—the software scaffolding that orchestrates their tool use and feedback loops—to solve engineering problems. While automatically evolving these harnesses is a great way to upgrade agents without retraining model weights, existing methods often memorize the quirks of their training benchmarks and fail on new tasks. TransHarness solves this by learning when to gently tap an agent on the shoulder and how to ask it to double-check its work based on current evidence, boosting already-strong coding agents to new state-of-the-art heights on unseen benchmarks.
What Problem Does This Paper Address?
If an AI model is the "brain" of a coding agent, the harness is its workbench and checklist—organizing how it edits files, runs tests, and reads error logs. Recently, researchers started using AI to automatically optimize these harnesses based on past trial-and-error ("harness evolution").
However, two nasty traps emerge when you try to take an evolved harness out into the real world:
- Benchmark Overfitting: Harnesses evolved on a specific set of tasks tend to bake in rigid rules tailored to those exact tasks. When moved to a new benchmark, source gains often turn into target losses.
- The Strong-Baseline Trap: Much of the prior work starts with bare-bones, minimal harnesses that still trail behind mature, human-engineered systems even after evolution. When you try to evolve a strong model inside an already mature harness, most runs already succeed. That leaves very few failed tasks left to "rescue," and a massive pool of successful runs that a clumsy, over-eager new rule can accidentally break (regressions).
Methods
Instead of rewriting core agent architecture or hardcoding specific fixes, TransHarness evolves a set of modular intervention policies—essentially smart, context-aware nudges—frozen before deployment:
- Same-Task Contrasts: The system runs a base agent multiple times on source tasks and pairs up a successful trajectory with a failed one on the exact same task to diagnose the diverging decision (e.g., fixing a bug vs. weakening a test to make it pass).
- Triggers + Diagnostic Guidance: Rather than prescribing a fixed answer, each policy pairs an executable trigger (watching observable events, like proposing a test edit or passing a test suite) with diagnostic guidance (prompting the agent to re-read requirements or verify evidence). The agent still figures out the task-specific fix itself.
- Authoring Review: A review step refines the candidate policy. For instance, changing an overly broad rule like "run tests and fix any failures" to "fix failures caused by your change and report unrelated ones," preventing wild goose chases.
- Two-Stage Filtering (Replay & Semantic Selection): First, cross-task replay runs the trigger over archived histories from other tasks—requiring zero fresh LLM calls—to reject policies that fire indiscriminately (e.g., on >90% of task pairs) or bother successful runs more than failed ones. Surviving policies face independent semantic selection, which checks that the guidance is grounded in task evidence and doesn't leak source-specific solutions.
Datasets
To prove true out-of-distribution transfer, the authors strictly separated evolution from testing:
- Independent Evolution Set (Curated): 100 hard tasks spanning 11 repositories drawn from SWE-bench Pro, selected for low historical solve rates and multi-language coverage. Running the base agent 3 times per task yielded just 300 trajectories for evolution. Crucially, this set shares zero repositories with DeepSWE and focuses heavily on product-workflow repairs/extensions.
- Target Evaluation Benchmarks: Frozen harnesses were tested on DeepSWE v1.1 (113 long-horizon software development tasks) and Terminal-Bench 2.1 (89 tasks spanning builds, data, and system operations).
Key Insights and Ideas
- Math favors caution on strong agents: The authors derive a clean mathematical bound showing that as an agent's baseline success rate rises, the allowable ratio of regressions-to-rescues plummets. On a top-tier agent, preserving working behavior is just as important as fixing failures.
- Nudge the process, don't dictate the fix: In ablations, replacing TransHarness's open-ended diagnostic reassessment with a prescribed, direct correction caused scores on DeepSWE to plunge by 10.9 percentage points. Similarly, firing guidance at the very start of a session instead of waiting for learned context triggers spiked regressions.
- Cheaper and better validation via replay: Prior methods like Meta-Harness and Self-Harness spend over 99% of their evolution tokens running fresh, expensive agent executions to validate candidates. By replaying archived trajectories offline, TransHarness used the fewest evolution tokens (132.7M vs. billions) while achieving the highest target score.
Key Results
TransHarness consistently improved three frontier models (DeepSeek V4.1 Flash, GLM-5.3 Flash, and Qwen3.8-Flash-Next) across both lightweight harnesses (Mini-SWE, Terminus 2) and mature native harnesses (DeepSeek Harness, ZCode, Qwen Code):
- New State-of-the-Art: Paired with DeepSeek V4.1 Flash, TransHarness hit 76.4% on DeepSWE v1.1 (with Mini-SWE) and 95.5% on Terminal-Bench 2.1 (with DeepSeek Harness), beating the strongest public baseline, GPT-6 Astra, by 2.4 and 5.6 percentage points, respectively.
- Winning the Regression Battle: When evolving Mini-SWE on the exact same source data, Meta-Harness lost 4.1 points on DeepSWE, while Self-Harness and RRSI eked out +0.3 points because their regressions nearly canceled out their recoveries. TransHarness achieved a +3.2 point net gain by maintaining high failure recovery (+13.0%) while keeping regressions down to the lowest level (-9.7%).
Limitations and Future Work
- Minimum Evidence Threshold: In budget ablations, evolving on too few tasks (25 or 50 source tasks, i.e., 75–150 trajectories) actually hurt target performance below the baseline due to high regression rates; positive transfer only emerged at 75–100 source tasks.
- Safety and Maintainability Beyond Tests: In their impact statement, the authors note that because evolved harness interventions actively shape how agents write code and run verifications, real-world deployments shouldn't rely solely on functional pass/fail tests—they must also pair these harnesses with dedicated checks for software security and code maintainability.
Summary updated