Summary (Overview)
- HarnessEvolve is a self-evolving agent framework that optimizes the entire agent harness (prompts, skills, tools, and execution logic) by learning from reference trajectories—execution paths produced when the agent is given ground-truth answers.
- The framework addresses three core challenges in self-evolution: credit assignment failure (identifying which step caused an error), shortcut learning (agents memorizing task-specific patterns), and catastrophic forgetting (degrading previously acquired capabilities).
- HarnessEvolve uses a decoupled multi-agent architecture with four independent modules: execution, evaluation, optimization, and gating, ensuring that optimization decisions are auditable and cannot be gamed by the execution agent.
- It consistently outperforms state-of-the-art baselines (GEPA, ACE, SkillOpt) across all five benchmarks, including a 21.6 percentage point improvement over the strongest baseline on the CloudCoreNetwork-QA dataset.
- Ablation studies confirm that reference-guided error diagnosis is the most critical component, with the quality gate and error clustering also contributing significantly to performance.
Introduction and Theoretical Foundation
Background and Motivation
Large language models (LLMs) have enabled autonomous agents that tackle complex tasks across domains. At the core of such agents is their harness: the prompts, skills, tools, and execution logic that shape their capabilities. The design of harnesses has evolved through several waves:
- Handcrafted workflows: Human experts explicitly design execution logic, search topologies, and collaboration structures (e.g., ReAct, CoT). These offer high controllability but lack flexibility and remain bounded within human-designed frameworks.
- Skill-augmented agents: Humans provide skills in natural language while models operate within autonomous perception-planning-action-observation loops (e.g., Claude Code, OpenClaw). These enable dynamic trial-and-error but remain bounded by the quality of human-provided skills.
- Self-evolving agents: Systems that autonomously synthesize, refine, and iteratively improve their own harness from environmental feedback.
Three Fundamental Challenges
The paper identifies three fundamental challenges hindering reliable self-evolution:
- Credit Assignment Failure: In long-horizon tasks, agents receive only binary success/failure signals. When failure occurs, the agent cannot identify which specific action caused it because later errors are downstream consequences of earlier mistakes.
- 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.
Theoretical Foundation
The paper argues that these challenges cannot be resolved by designing yet another iterative prompt optimization algorithm; they necessitate a system-level architectural shift. HarnessEvolve decouples the execution agent from the evolutionary pipeline, assigning execution, evaluation, optimization, and gating to independent modules.
Methodology
Problem Formulation
Given a task corpus of M query-answer pairs split into training , validation , and test sets, and a base execution agent powered by a frozen LLM, the goal is to find the optimal execution agent by iteratively optimizing its harness on without human intervention, such that accuracy on is maximized.
Architecture Overview
HarnessEvolve uses four independent agent modules:
- Execution agent (): The target of optimization, runs tasks from using its harness. Also produces reference trajectories when given ground-truth answers.
- Evaluation agent (): (1) Evaluates task accuracy and identifies failed trajectories; (2) verifies that reference trajectories are genuine execution paths rather than shortcuts.
- Optimization agent (): Analyzes failed trajectories, compares them against reference trajectories to identify root causes, clusters errors into systematic patterns, and generates candidate harness modifications.
- Gate agent (): Enforces quality checks (data leakage and prompt bloat inspection) and performance checks (accuracy improvement without degradation).
Key Mechanisms
1. Reference-Guided Error Diagnosis
Prior to the optimization loop, is run on all tasks with ground-truth answers to produce reference trajectories . The evaluation agent verifies each trajectory for genuineness (checking that it follows a legitimate reasoning chain rather than trivially restating the answer). During optimization, failed trajectories are compared against reference trajectories to identify the first point of divergence —the earliest step where the action deviates—enabling fine-grained root-cause localization.
2. Error Clustering
Individual error signals (severity, error cause, fix hint) are clustered by error cause into groups , following three principles:
- Cause-Based Grouping: Groups formed by error cause rather than coarse severity labels
- Root-Cause Priority: Prioritize the first action divergence point as the root error cause
- Long-Tail Protection: Preserve single-member clusters to ensure rare but critical failure patterns are not absorbed
3. Quality Gate
The gate agent checks candidate updates for:
- Data leakage: Whether edits directly embed failed queries and ground-truth answers into harness files (LLM-as-judge with score threshold )
- Prompt bloat: Whether newly injected in-context examples exceed threshold
A candidate update passes if and only if, for every file in the update, the data leakage score does not exceed and the number of injected in-context examples does not exceed .
4. Performance Gate
A candidate agent is accepted if and only if it improves accuracy on the current batch by at least margin δ while not degrading on any recent batch beyond tolerance ε:
5. Epoch-End Selection
At epoch completion, all snapshots in the pool V are evaluated on the validation set, and the best-performing one is selected:
Implementation Details
- Models: Qwen3.6-27B (post-trained with domain-specific fine-tuning) and DeepSeek-V4-Flash (no fine-tuning)
- Frameworks: LAMAgent (in-house, for enterprise datasets) and OpenClaw (for open-source datasets)
- Hyperparameters: (max reference attempts), (batch patience), (epoch patience), (epoch limit), (batch size), (replay buffer size), (step margin), (degradation tolerance), , , (revision limit)
Empirical Validation / Results
Main Results on In-House Datasets
Table 1: Main results on in-house datasets. Accuracy (%) is reported. Best results are in bold.
| Method | CloudCoreNetwork-QA (Qwen) | CloudCoreNetwork-QA (DeepSeek) | Wireless-QA (Qwen) | Wireless-QA (DeepSeek) |
|---|---|---|---|---|
| Base | 43.4 | 47.5 | 79.0 | 85.9 |
| GEPA | 65.3 | 57.6 | 82.4 | 86.5 |
| ACE | 59.3 | 64.6 | 84.3 | 90.1 |
| SkillOpt | 61.9 | 65.3 | 89.0 | 89.3 |
| HarnessEvolve | 86.9 | 85.9 | 89.7 | 92.8 |
On CloudCoreNetwork-QA with Qwen3.6-27B, HarnessEvolve improves accuracy from 43.4% (Base) to 86.9%, outperforming the strongest baseline GEPA at 65.3% by 21.6 percentage points.
Main Results on Open-Source Datasets
Table 2: Main results on open-source datasets. Accuracy (%) is reported. Best results are in bold.
| Method | SearchQA | OfficeQA | SpreadsheetBench |
|---|---|---|---|
| Base | 86.5 | 62.8 | 44.3 |
| GEPA | 88.6 | 64.0 | 69.6 |
| ACE | 90.0 | 68.9 | 52.2 |
| SkillOpt | 89.4 | 66.9 | 74.6 |
| HarnessEvolve | 92.9 | 70.9 | 76.4 |
Cross-Framework Generalization
Table 3: Cross-framework transfer: skills optimized on OpenClaw, evaluated on four frameworks. Accuracy (%) is reported. Best results are in bold.
| Framework | SearchQA (Base) | SearchQA (HarnessEvolve) | OfficeQA (Base) | OfficeQA (HarnessEvolve) | SpreadsheetBench (Base) | SpreadsheetBench (HarnessEvolve) |
|---|---|---|---|---|---|---|
| Hermes | 95.0 | 95.0 | 77.9 | 80.8 | 72.1 | 73.2 |
| OpenCode | 90.0 | 92.7 | 75.6 | 80.3 | 57.5 | 87.9 |
| LAMAgent | 92.9 | 94.3 | 74.4 | 75.0 | 45.0 | 80.0 |
| DeepSeek Harness | 93.6 | 95.0 | 79.1 | 79.7 | 56.4 | 86.8 |
Ablation Study
Table 4: Ablation study results on CloudCoreNetwork-QA (Qwen3.6-27B). Accuracy (%) is reported. Best results are in bold.
| Variant | CloudCoreNetwork-QA |
|---|---|
| HarnessEvolve (full) | 86.9 |
| M1: w/o reference trajectory | 57.8 |
| M2: w/o error clustering | 68.6 |
| M3: w/o quality gate | 80.1 |
Key findings:
- M1 (w/o reference trajectory): Largest degradation (86.9% → 57.8%), confirming reference-guided diagnosis is the most critical component
- M2 (w/o error clustering): Significant degradation (86.9% → 68.6%), confirming error aggregation is essential for coherent modifications
- M3 (w/o quality gate): Moderate degradation (86.9% → 80.1%), indicating the quality gate helps prevent shortcut learning
Self-Evolution Curve
The evolution curves show that a substantial fraction of candidate updates are rejected by the two-tier gating mechanism, indicating effective filtering of low-quality modifications. The peak accuracy in the snapshot pool increases gradually throughout evolution, reaching its highest point at the final harness.
Theoretical and Practical Implications
Theoretical Implications
-
Credit Assignment Resolution: The reference-guided error diagnosis approach provides a principled method for isolating root causes in long-horizon tasks, addressing a fundamental limitation of sparse-reward environments.
-
Guarded Evolution: The two-tier gating mechanism (quality + performance) offers a theoretical framework for stable self-improvement, balancing exploration of new capabilities with preservation of existing ones.
-
Comprehensive Harness Optimization: Unlike prior methods optimizing only single components (e.g., SkillOpt optimizes only skill.md), HarnessEvolve demonstrates that optimizing the entire harness—including Python scripts, prompt instructions, tool-argument specifications, and execution logic—yields substantially better results.
Practical Implications
-
Enterprise Deployment: The significant gains on enterprise datasets (CloudCoreNetwork-QA: 21.6 percentage points over strongest baseline) demonstrate practical viability for complex multi-skill enterprise tasks.
-
Framework Transferability: Skills optimized by HarnessEvolve transfer across four different agent frameworks without re-optimization, indicating generalizable improvements rooted in error patterns rather than framework-specific shortcuts.
-
Reliability: The decoupled architecture ensures optimization decisions are auditable, addressing deployment concerns about uncontrolled self-modification.
Conclusion
HarnessEvolve presents a comprehensive solution for reliable agent self-evolution by:
- Overcoming credit assignment failure through reference-guided error diagnosis
- Preventing shortcut learning via the quality gate (data leakage and prompt bloat inspection)
- Mitigating catastrophic forgetting through the performance gate with epoch-end validation
The framework consistently outperforms state-of-the-art baselines across all five benchmarks spanning open-domain and enterprise scenarios, with substantial gains on complex multi-skill tasks. Future directions may include extending the framework to more diverse task domains, exploring additional gating mechanisms, and investigating the interaction between harness optimization and model fine-tuning.
Related papers
- Evolution Fine-Tuning: Learning to Discover Across 371 Optimization Tasks
Evolution Fine-Tuning converts evolutionary search trajectories into supervised training signals, teaching small open-source LLMs to discover solutions across 371 optimization tasks with 10.22% average gains on held-out problems.
- Recursive Harness Self-Improvement
Recursive Harness Self-Improvement lets a few cheap prompt-level iterations outperform maximum test-time scaling baselines, cutting inference cost by up to 60% through better inter-agent context management, not longer reasoning.
- SkillGLoW: Procedural-Family Skill Consolidation for Self-Improving Agents on Long-Horizon Task Streams
SkillGLoW organizes LLM agent skills into procedural families, compressing shared solving procedures globally while regenerating instance details locally, gaining +17.2 points over no-skill baselines with a 3.6x more compact library.