Self-Evolving Coding Agents via Harness-Policy Optimization
Organizations: Microsoft Research · University of Virginia · Carnegie Mellon University
Abstract
Large language model (LLM) agents have shown promising potential in coding tasks, and their performance is jointly determined by the policy model and the harness that mediates their interaction with the environment. Indeed, harness and policy are mutually reinforcing and evolving only one component is suboptimal---a harness tuned for one checkpoint may not target the failure modes of an updated policy, while policy learning remains limited to the trajectories elicited by a fixed harness. In light of this, we propose Self-HPO, a recursive self-improving framework for coding agents that alternates harness and policy optimization, using the evolving policy as its own harness proposer. Specifically, in each round, the current policy first analyzes its own failures and proposes new harness candidates (H-step). The policy is then updated through reinforcement learning (RL) under the selected harness (P-step), and hard tasks identified during training form the next harness search set, keeping harness optimization targeted to the policy's evolving failure modes. Across three coding benchmarks, Self-HPO consistently outperforms harness-only and policy-only baselines, improving Qwen3.5-35B-A3B's average resolve rate from 57.8% to 64.8%, with gains generalizing to out-of-distribution settings. Further analysis shows that both optimized components retain gains even when paired with their base counterparts, while their joint gain exceeds the sum of their individual gains. Self-HPO also improves reliability (Pass@1) and expands the capability frontier (Pass@k) over the base agent. Additionally, we show that with a stronger external model (e.g., Opus 4.8) as the harness proposer, the same framework yields a further performance boost.
Figures & tables
| Method | Harness Opt | Policy Opt | SWE-Verified | SWE-Multi | SWE-Pro | Avg. |
| Base | ✘ | ✘ | ||||
| Setting 1: External-model setup (Opus 4.8) | ||||||
| SFT | ✘ | ✓ | ||||
| Meta-Harness ( Lee et al., 2026 ) | ✓ | ✘ | ||||
| HPO (ours) | ✓ | ✓ | ||||
| Setting 2: Self-improving setup | ||||||
| Configuration | Resolve rate (%) |
|---|---|
| HPO | 71.6 |
| w/ SFT in P-step | 67.2 ( 4.4) |
| w/ RFT in P-step | 70.5 ( 1.1) |
| w/ Fixed search set in H-step | 70.1 ( 1.5) |
| w/ Self-proposer in H-step | 69.5 ( 2.1) |
Appendix figures & tables3 assets
Supplementary material from the paper’s appendix.
Appendix
| Model | Harness | Total Params | Active Params | Resolve Rate |
|---|---|---|---|---|
| Frontier models | ||||
| Gemini 3 Flash | mini-SWE-agent | – | – | 75.8 |
| MiniMax-M2.5 | mini-SWE-agent | – | – | 75.8 |
| Claude Opus 4.6 | mini-SWE-agent | – | – | 75.6 |
| GLM-5 | mini-SWE-agent | 744B | 40B | 72.8 |
| GPT-5.2 | mini-SWE-agent | – | – | 72.8 |
| Method | Coding | Policy update | Harness proposer | Harness search set |
|---|---|---|---|---|
| Meta-Harness | ✓ | Frozen | Frozen external model | Fixed |
| Self-Harness | ✓ | Frozen | Frozen self-proposer | Fixed |
| Task-CoEvolve | ✓ | Frozen | Frozen external model | Evolving (high-variance tasks) |
| Evo 2 | ✓ | Frozen | Evolving separate proposer | Fixed |
| WHALE | ✘ | SFT | Frozen external model | Fixed |
| HASE | ✘ | RL | Evolving self-proposer | Fixed |
AI Coding Agents
AI coding agents use language models and software tools to plan, edit, test, and maintain code with varying levels of autonomy.
See all 327 papers