TL;DR
Building great LLM coding agents requires more than just a smart base model; it requires a robust "harness" of tools, prompts, and middleware. This paper introduces Agentic Harness Engineering (AHE), an automated system that co-evolves all these components in a closed loop. By turning harness edits into verifiable, file-level contracts, AHE autonomously boosts agent performance, outperforming human-engineered designs and transferring seamlessly across different model families.
What Problem Does This Paper Address?
While LLM capabilities advance rapidly, the scaffolding around them—the system prompts, file-editing tools, and execution middleware collectively known as the agent harness—is still meticulously handcrafted by human engineers. Automating this process has proven incredibly difficult. If you let an AI agent try to optimize its own harness, it typically runs into three major roadblocks: a massive and messy action space across different files, millions of tokens of confusing execution logs that bury the actual root causes of failures, and the inability to accurately attribute whether a specific tweak actually fixed a bug or just got lucky. Consequently, previous automated attempts have been forced to stick to simple, prompt-only optimization.
Methods
The authors introduce AHE, a closed-loop framework that solves the automation bottleneck not by changing the agent's core capabilities, but by dramatically improving observability. AHE relies on three matched observability pillars to make harness evolution stable and reliable:
- Component Observability: Built on the decoupled NexAU framework, AHE splits the harness into seven distinct, file-level component types (e.g., tool implementations, middleware, long-term memory). This gives the evolution agent a clean, modular action space where changes can be tracked and reverted using standard Git commits.
- Experience Observability: Instead of forcing the agent to read through millions of raw log tokens, an Agent Debugger distills messy trajectories into structured, layered root-cause analysis reports.
- Decision Observability: Every time the Evolve Agent modifies a component, it must fill out a "change manifest" predicting exactly which tasks the edit will fix and what it might risk breaking. In the next round, these self-declared predictions are verified against actual outcomes. If an edit fails its contract, it is automatically rolled back at file granularity.
Datasets
AHE was driven and evaluated using two major benchmarks:
- Terminal-Bench 2: A dataset of 89 tasks (4 easy, 55 medium, 30 hard) requiring complex, multi-step terminal workflows. This served as the primary environment for the 10-iteration evolution loop.
- SWE-bench-verified: Consisting of 500 real-world software engineering tasks across seven large repositories, used strictly as an unseen target to test the cross-benchmark transferability of the evolved harness.
Key Insights and Ideas
- Structure Beats Prose: Ablation studies revealed that the performance gains live entirely within structural components like tools, middleware, and long-term memory. Tweaking the system prompt prose alone actually caused regressions during transfer, proving that factual engineering structure generalizes far better than prompt engineering strategy.
- Non-Additive Interactions: Stacking multiple independently successful edits doesn't yield linear gains. Components interact non-additively; for instance, adding strict verification checks across memory, middleware, and prompts simultaneously can cause the agent to waste its turn budget on redundant re-checks.
- Regression Blindness: While AI evolution agents are remarkably good at targeting and predicting what an edit will fix, they are notoriously blind to what it might break.
Key Results
- Outperforming Humans and Baselines: Over 10 autonomous iterations on Terminal-Bench 2, AHE lifted the agent's pass@1 score from a baseline of 69.7% to 77.0%. This comfortably surpassed the human-designed Codex harness (71.9%) as well as state-of-the-art self-evolving baselines like ACE and Training-Free GRPO.
- Zero-Shot Transfer: When the frozen, evolved harness was evaluated on the entirely different SWE-bench-verified benchmark, it achieved the highest aggregate success rate (75.6%) while remarkably slashing token consumption by 12% compared to the seed harness.
- Cross-Family Generalization: The evolved harness isn't overfitted to its base model (GPT-5.4). When tested across alternate model families—including DeepSeek-V4-flash, Qwen-3.6-plus, and Gemini-3.1-flash-lite—it delivered consistent performance leaps of up to +10.1 percentage points.
Limitations and Future Work
While a powerful proof-of-concept, the authors note several limitations. The system's step budgets and timeouts were tightly coupled to the primary evaluation model (GPT-5.4 high), meaning the harness might need re-tuning for vastly different operating points. Furthermore, the evaluation was limited to two benchmarks; broader programming languages and human-in-the-loop environments remain untested. Finally, the framework lacks a comprehensive self-modification guardrail stack to prevent potential long-horizon misuse or chaotic code generation. The clearest path forward for future self-evolution loops is solving "regression blindness"—teaching agents to accurately foresee what their code modifications might break.
Summary updated