Technical Summary: Co-Harness: Co-Evolving Harnesses and Model Weights for LLM Agents
1. Problem Statement
Post-training agents for automated AI research traditionally involves optimizing model parameters while treating the runtime system—the "Harness"—as a fixed, static scaffold. The Harness encompasses prompts, tools, skills, middleware, memory policies, and retry logic. Current pipelines create a fundamental mismatch: the model is updated via supervised fine-tuning (SFT) or reinforcement learning based on trajectories generated by a static Harness, yet the Harness itself is never optimized based on the failures observed during training.
This asymmetry leads to a bottleneck where suboptimal scaffolding (e.g., ambiguous prompts, incorrect tool schemas, missing retry hooks, or memory overflow) prevents the generation of high-quality training trajectories. Consequently, the model cannot learn to overcome these environmental limitations, and the fixed Harness becomes a ceiling for agent performance, particularly in complex Tool-Integrated Reasoning (TIR) settings where a single schema error can abort an entire multi-turn session.
2. Methodology: Co-Harness Framework
The authors propose Co-Harness, a dual-loop framework that jointly optimizes the agent Harness (ϕ) and model parameters (θ) through an alternating process. The core hypothesis is that a better Harness produces cleaner, more informative trajectories, which train a stronger model; this stronger model, in turn, exposes higher-order Harness bottlenecks that were previously invisible, enabling further scaffolding improvements.
The framework operates in two alternating loops per round t:
A. The Co-Harness Loop (Harness Optimization)
In this phase, the model θt is held fixed while the Harness ϕt is evolved.
- Failure Collection: The agent executes tasks under (θt,ϕt), collecting a set of failed trajectories Ft−.
- HarnessCritic Analysis: An LLM-based component, HarnessCritic (C), analyzes these failures. It attributes each failure to a structured root cause within the Harness configuration (e.g., prompt ambiguity, tool schema error, missing skill, middleware mismatch, or memory overflow).
- Diff Generation & Validation: HarnessCritic proposes local patches (differences) to the Harness. These patches are validated by running "rollout" tests to ensure they improve the targeted failure mode without causing regression in held-out behaviors.
- Registry Update: Validated patches are committed to a versioned Harness registry, updating the active configuration to ϕt∗.
B. The Model Alignment Loop (Model Optimization)
In this phase, the evolved Harness ϕt∗ is held fixed while the model is updated.
- High-Quality Trajectory Collection: The current model θt is run under the improved Harness ϕt∗ to generate a new dataset Dt of high-quality trajectories.
- Supervised Fine-Tuning (SFT): The model is fine-tuned on Dt to internalize the behaviors enabled by the improved scaffolding, resulting in an updated model θt+1.
- Iteration: The new model θt+1 and the evolved Harness ϕt∗ become the starting point for the next round, where the stronger model may reveal new, more complex Harness limitations.
Failure Attribution Taxonomy
HarnessCritic classifies failures into five actionable Harness dimensions and one abstention label:
- Prompt Ambiguity (P): Instruction underspecification or conflicting goals.
- Tool Schema Error (T): Invalid tool calls, bad argument schemas, or backend mismatches.
- Skill Missing (S): Absence of reusable routines or decomposition primitives.
- Middleware Mismatch ($Mid$): Flawed loop protocols, hook behaviors, or context management logic.
- Memory Overflow (M): Persistent state overflow, stale memory, or retrieval failures.
- Agent Error: Cases where the failure is intrinsic to the model's reasoning rather than the Harness.
3. Key Contributions
- Joint Optimization Formulation: The paper formulates agent post-training as a joint optimization problem over model weights and the runtime Harness, moving beyond the paradigm of treating prompts and tools as fixed infrastructure.
- HarnessCritic: The introduction of a failure-driven procedure that performs structured attribution of errors to specific Harness components and proposes validated, local diffs for repair.
- Compounding Gains Mechanism: The demonstration that alternating Harness evolution and Model Alignment creates a positive feedback loop, where improvements in scaffolding lead to better training data, which yields stronger models capable of leveraging even more sophisticated scaffolding.
4. Experimental Results
The framework was evaluated on Tool-Integrated Reasoning (TIR) tasks using mathematical benchmarks (AIME 2024, AIME 2025, HMMT 2025) and two model scales (Qwen3-8B and Qwen3-32B).
- Performance Gains: Two rounds of Co-Harness co-evolution resulted in an average accuracy improvement of +20.4 percentage points (pp) across benchmarks and model scales compared to the baseline (a Harness evolved once without model SFT).
- The largest gain was observed on the most difficult benchmark (HMMT 2025) for the Qwen3-32B model, with an improvement of +27.2 pp.
- The system surpassed carefully hand-designed, static Harness configurations by an average of +24.7 pp.
- Autonomous Case Study: In a 200+ hour autonomous run on AIME 2024, the system:
- Recovered from an initial system crash (vllm KV cache error).
- Improved inference efficiency by 8.7× (reducing wall-clock time from 3.78h to 1.11h) through global-batched inference.
- Discovered an ensemble strategy (majority voting of diverse seeds) that achieved the best accuracy (63.3%) within the time budget, all without human intervention.
- Robustness: The system successfully detected and rolled back regressions (e.g., domain-specific prompts that conflicted with the model's internal reasoning) using its version-controlled registry.
5. Significance and Claims
The paper argues that Co-Harness addresses a critical limitation in current agent development: the decoupling of model training from the environment that generates training data. By treating the Harness as a learnable variable rather than a static scaffold, Co-Harness enables compounding self-improvement.
The authors claim that this approach realizes a "positive feedback spiral" where:
- A better Harness produces cleaner tool use and fewer avoidable crashes.
- These cleaner trajectories train a stronger model.
- The stronger model can exploit richer, more complex Harness configurations that were previously unusable.
This contrasts with prior work that either optimizes the model for a fixed Harness (standard SFT/RL) or optimizes the Harness for a fixed model (inference-time search). Co-Harness is presented as the first framework to co-evolve both, suggesting that the interdependence of scaffolding and model weights is a primary axis for improving agent capabilities beyond fixed-harness post-training.
Limitations noted by the authors: The approach requires a capable critic LLM, a sufficient volume of failure trajectories for cold-start, and significant compute for multi-round SFT. Additionally, attribution accuracy can degrade for failure modes requiring complex counterfactual reasoning, and structural redesigns of the Harness remain a human responsibility.