arXiv(opens in a new tab)cs.LGSep 2026Cited by 9 papers on PaperVantage

Manuscript Offprint

arXiv:2609.00829

HarnessEvolve: Learning from Reference Trajectories for Reliable Agent Self-Evolution

Wen Jiang, Mingmin Chu, Yimeng Tian, Qianxin Zhang, Haofei Yang, Rui Yang, Yang Liu, Tao Lv, Fangming Li

Abstract

Self-evolving agents advance toward autonomy by optimizing their harness—prompts, skills, tools, and execution logic—based on environmental feedback. This paradigm, however, is hampered by three challenges: credit assignment failure, where terminal success/failure feedback makes it ambiguous which step caused the error; shortcut learning, where agents memorize task-specific patterns rather than acquire generalizable capabilities; and catastrophic forgetting, where unguarded updates degrade previously acquired competence. In this paper, we introduce HarnessEvolve, a self-evolving framework that learns from reference trajectories to achieve reliable agent self-evolution. HarnessEvolve decouples the execution agent from the evolutionary pipeline, assigning execution, evaluation, optimization, and gating to independent agent modules, enabling generalizable and stable harness improvements. Specifically, HarnessEvolve overcomes credit assignment failure by generating reference trajectories (execution paths produced when given the ground-truth answers) and aligning failed executions against them to extract error signals, which are clustered to reveal systematic failure patterns. To prevent shortcut learning and catastrophic forgetting, candidate harness updates must pass two gates: a quality gate that filters data leakage and prompt bloat, and a performance gate that accepts each update if it improves on the current batch without degrading recent batches, with epoch-end validation on a held-out set selecting the best-performing accepted agent snapshot. We conduct extensive experiments on several benchmarks spanning open-domain and enterprise scenarios, using different models and agent frameworks. Results demonstrate that HarnessEvolve consistently outperforms state-of-the-art baselines across all benchmarks and settings, confirming reliability across task domains.

1 Introduction

Large language models (LLMs) have demonstrated remarkable capabilities in reasoning, planning, and tool use, enabling the development of autonomous agents that tackle complex tasks across domains ranging from software engineering to enterprise data analysis. At the core of such agents is their harness: the prompts, skills, tools, and execution logic that collectively shape their capabilities and execution behavior.

The design of such harnesses has evolved through several waves of decreasing reliance on human priors. Early systems relied on handcrafted workflows [Wei et al., 2022, Yao et al., 2023b], where human experts explicitly design execution logic, search topologies, and collaboration structures, while LLMs serve as execution nodes within predefined boundaries. While this paradigm offers high controllability, it lacks flexibility: deviations from anticipated workflows can cause the entire pipeline to fail, and agents remain bounded within human-designed frameworks, unable to expand without

Preprint.

human intervention [Sumers et al., 2024]. Skill-augmented agents relax this rigidity: humans provide skills (described in natural language) and models operate within autonomous perception-planning-action-observation loops, exemplified by systems such as Claude Code and OpenClaw. This paradigm enables dynamic trial-and-error and self-healing through iterative reasoning, but it remains bounded by the quality of human-provided skills and can become stuck in iterative retry loops when initial planning decisions are incorrect. These limitations motivate the pursuit of self-evolving agents that can autonomously synthesize, refine, and iteratively improve their own harness from environmental feedback, progressively reducing reliance on human priors.

Despite recent progress, self-evolving agents remain difficult to deploy in real-world settings. Existing frameworks typically provide only sparse, terminal rewards (i.e., a binary success/failure signal at the end of execution), without mechanisms for fine-grained trajectory analysis to indicate which intermediate actions were correct or incorrect. Under such sparse signals, models tend to take shortcuts and overfit to specific evaluation instances, while unverified updates compound over iterations, gradually degrading prior capabilities. We identify three fundamental challenges that hinder reliable self-evolution:

  • Credit Assignment Failure: In long-horizon tasks, agents receive only binary success/failure signals at the end. When a failure occurs, the agent cannot identify which specific action caused it, because later errors are downstream consequences of earlier mistakes. Solely reflecting on the whole trajectory may misidentify the root cause, leaving optimization directionless.

  • Shortcut Learning: Without safeguards, agents tend to hardcode answers or inject excessive task-specific in-context examples into the harness, causing data leakage and prompt bloat that inflate training accuracy without genuine capability gain.

  • Catastrophic Forgetting: Since each harness update is optimized on a subset of trajectory data, it may conflict with previously acquired competence, gradually degrading existing capabilities over multiple iterations.

These challenges cannot be resolved by designing yet another iterative prompt optimization algorithm; they necessitate a system-level architectural shift. To this end, we introduce HarnessEvolve, a self-evolving framework that learns from reference trajectories to achieve reliable agent self-evolution. Rather than entangling execution and optimization in a single reasoning loop, HarnessEvolve decouples the execution agent from the evolutionary pipeline, assigning execution, evaluation, optimization, and gating to independent modules, ensuring that optimization decisions are auditable and cannot be gamed by the execution agent.

Concretely, the execution agent runs tasks using its harness, which serves as the target of optimization. An evaluation agent assesses both the accuracy of the execution agent and the reliability of reference trajectories, the latter produced by the execution agent given the question and its ground-truth answer. Based on these assessments, an optimization agent analyzes failed executions by comparing them against reference trajectories to identify the first point of divergence, isolating the root-cause action from downstream cascading errors; these error signals are aggregated via error clustering to identify systematic failure patterns. A gate agent then inspects candidate updates for data leakage (by comparing content against failed training instances) and prompt bloat (by counting injected in-context examples), rejecting updates that exhibit either. Finally, the performance gate accepts each candidate only if it improves on the current batch without degrading recent batches, with epoch-end validation on a held-out set selecting the best-performing accepted agent snapshot.

We evaluate HarnessEvolve against several self-evolving baselines (GEPA [Agrawal et al., 2025], ACE [Zhang et al., 2026b], and SkillOpt [Yang et al., 2026]), each optimizing only a single component of the harness (e.g., SkillOpt optimizes solely skill.md), on five benchmarks spanning open-domain tasks (SearchQA [Dunn et al., 2017], OfficeQA [Opsahl-Ong et al., 2026], SpreadsheetBench [Ma et al., 2024b]) and specialized enterprise QA and text-to-SQL tasks (CloudCoreNetwork-QA and Wireless-QA, two in-house datasets from cloud core network and wireless network domains). HarnessEvolve consistently outperforms all baselines on all five benchmarks in terms of accuracy. Notably, on CloudCoreNetwork-QA, HarnessEvolve outperforms the strongest baseline by 21.6 percentage points, demonstrating substantial gains on complex multi-skill enterprise tasks. In summary, the main contributions of HarnessEvolve are fourfold:

  • Reference-Guided Error Diagnosis: A diagnostic method that overcomes credit assignment failure by comparing failed executions against reference trajectories. The resulting error signals are aggregated via error clustering to identify systematic failure patterns.

  • Quality Gate against Shortcut Learning: A filtering mechanism that inspects candidate updates for data leakage and prompt bloat. Only harness updates that pass both checks are retained for downstream validation.

  • Performance Gate for Stable Evolution: A validation-gated update protocol that mitigates catastrophic forgetting. Each harness candidate is accepted into an agent snapshot pool only if it improves on the current batch without degrading recent batches, with epoch-end validation on a held-out set selecting the best-performing snapshot.

  • Comprehensive and Reliable Harness Self-Evolution: Built on a decoupled multi-agent architecture, HarnessEvolve constitutes a comprehensive and reliable harness self-evolution framework that optimizes the entire harness rather than a single component, achieving state-of-the-art accuracy on both in-house enterprise and open-source benchmarks.

References (35)