Self-Evolving Coding Agents via Harness-Policy Optimization

Zhepei Wei, Wenlin Yao, Baolin Peng, Danqing Wang, Qianhui Wu, Hao Cheng, Yu Meng, Jianfeng Gao

Microsoft Research · University of Virginia · Carnegie Mellon University

Published October 16, 2026 · on the feed October 20, 2026 · ▲ 55 · arXiv 2610.22791

AgentsCode & softwareLLM training & RL Full code arXiv ↗Hugging Face ↗Weights ↗Dataset ↗

The 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.

The Brief

2:49

A short podcast summary of the paper. Written and voiced by AI.

Transcript

Self-Evolving Coding Agents via Harness-Policy Optimization. By Zhepei Wei and seven others, from Microsoft Research, the University of Virginia, and one other institution. Published on the sixteenth of October. Its code repository is worked out: about two hundred and fifty source files, with a readme and a licence.

A coding agent's performance depends jointly on two things: the policy model, and the harness that mediates its interaction with the environment. The authors argue the two are mutually reinforcing, and that evolving only one of them is suboptimal. The failure runs both ways. A harness tuned for one checkpoint may not target the failure modes of an updated policy. Policy learning, in turn, is limited to the trajectories that a fixed harness elicits. Improve either side alone and the other side holds it back.

Self-HPO is a recursive self-improving framework for coding agents that alternates between optimizing the harness and optimizing the policy. Its distinctive move is who proposes the harness: the evolving policy itself. The model being trained is also the one redesigning its own surroundings, so harness and policy are no longer tuned by separate processes on separate schedules.

Each round has two steps. In the H-step, the current policy analyzes its own failures and proposes new harness candidates. In the P-step, the policy is updated by reinforcement learning under the selected harness. Then the loop closes: hard tasks identified during training become the next harness search set. That keeps harness optimization aimed at the failure modes the policy has now, rather than the ones it had when the harness was last tuned.

Across three coding benchmarks, Self-HPO consistently outperforms both harness-only and policy-only baselines. For Qwen3.5-35B-A3B, the average resolve rate rises from fifty-seven point eight percent to sixty-four point eight percent, and the gains generalize to out-of-distribution settings.

Further analysis separates the two components. Each optimized component keeps its gains even when paired with its base counterpart. And their joint gain exceeds the sum of their individual gains, which is the evidence for the claim that they reinforce each other. Self-HPO also improves reliability, measured as pass at one, and expands the capability frontier, measured as pass at k, over the base agent. Finally, with a stronger external model, such as Opus four point eight, serving as the harness proposer, the same framework yields a further performance boost.

The structure is an alternation between two players who are the same model. Harness search is pointed at what the policy currently fails on, and the policy is trained inside the harness that search produced. A combined gain larger than the two separate gains added together is what makes this more than two methods run back to back. The external proposer result adds that the loop is not bound to the policy proposing for itself; that is simply its self-contained default.

More with an account

Listen to every day’s papers

Daily playlists, deep dives, quests for the papers, and quizzes on their key terms.

Join free
KipQuest: the day’s AI research, as podcasts and quests. All papers Android app Privacy Contact Episodes are written and voiced by AI from each paper. Summaries can contain mistakes: the paper is the source.