Abstract
LLM agents remain unreliable on long-horizon tasks, where small local failures can compound over extended interactions and lead to overall task failure. Although external harnesses can substantially improve robustness, harness design remains a manual and expensive process that requires searching over a large space of prompts, tool configurations, and control logic. We propose AutoSaddler, an automatic harness optimization framework that formulates harness improvement as an offline learning problem and iteratively updates the harness using failure signals from mini-batches. AutoSaddler combines failure-trace diagnosis, structured patch generation that treats the harness as code, and validation-based update selection. Experiments on GAIA2, SWE-Bench Pro, and Terminal-Bench 2.0 show that AutoSaddler substantially improves agent performance over the corresponding base harnesses, achieving gains of 9.0, 9.6, and 10.0 percentage points, respectively. Ablation studies further suggest that effective harness optimization benefits from three ingredients: deep debugging rather than shallow reflection, targeted modifications rather than unconstrained editing, and generalization-aware selection rather than trajectory-specific repair. Together, these results suggest that automatic harness optimization is a promising path toward more performant and reliable agent systems.
Video
Harness Optimization on GAIA2
Step through AutoSaddler’s optimization process on GAIA2. Starting from the default agent harness (47.7%), AutoSaddler discovers prompt rules, new tools, and agent loop fixes that push dev-set accuracy to 72.3% over two epochs. Each dot is one iteration. Click any dot or use the arrow keys to inspect its patch details and code changes.
Method Overview
AutoSaddler formulates automatic harness optimization as an offline learning problem with a mini-batch training paradigm. Each iteration consists of three sessions — Diagnosis-Patch, Reflection, and Evolution — that together produce durable harness updates rather than trajectory-specific fixes.
Three Key Ingredients
AutoSaddler’s design is grounded in three requirements for effective harness optimization:
-
In-depth Diagnosis — Deep debugging of execution traces, not shallow reflection. The diagnosis agent makes an average of 6.2 additional tool calls and 5.8 file accesses per iteration to understand root causes, resulting in 13 accepted patches by Iter 25 (vs. 5 without).
-
Structured Intervention — Targeted modifications guided by a patch taxonomy across prompts, tools, and middleware. Without structure, 91.5% of patches are trivial text edits; with AutoSaddler, high-impact types like New Tools (83% acceptance) and Loop Changes (71%) are actively explored.
-
Generalization-Aware Selection — Retain broadly useful updates, not single-trajectory fixes. This is the largest ablation factor: removing it drops performance from 62.0% to 50.6%. The key mechanism is regression prevention — AutoSaddler’s regression rate trends downward (−0.24 pp/iter) vs. upward (+0.16 pp/iter) without it.
Patch Taxonomy
AutoSaddler categorizes harness modifications into a structured taxonomy:
| Category | Patch Type | Kind | Description |
|---|---|---|---|
| Prompt | Rule Addition | S | Add behavioral rules to system prompt |
| Rule Modification | S | Revise existing prompt rules | |
| Tool | New Tool | C | Add new tool for unsupported action |
| Argument Modification | C | Add or fix tool parameters | |
| Implementation Fix | C | Fix bugs or extend tool functionality | |
| Description Fix | S | Modify docstrings to prevent misuse | |
| Middleware | PreToolUse Hook | S | Inject just-in-time reminder before tool call |
| Infrastructure Change | C | Modify agent config or environment settings | |
| Agent Loop Logic | C | Add preprocessing steps or budget reminders |
C = Capability (modifies code/logic), S = Steering (modifies text only). AutoSaddler schedules Capability patches first, then Steering — analogous to learning-rate scheduling.
Key Results
AutoSaddler achieves state-of-the-art automatic harness optimization on three challenging agent benchmarks, outperforming both manually tuned and automated baselines.
GAIA2 Test Results
| Harness | Type | Univ. 21 (107) | Univ. 22 (112) | Univ. 27 (81) | Avg. |
|---|---|---|---|---|---|
| Default Agent | Manual | 54.8±4.8 | 51.5±4.9 | 52.7±4.3 | 53.0±1.5 |
| GEPA | Auto | 60.1±3.9 | 47.9±3.4 | 56.4±0.7 | 54.6±2.5 |
| Meta-Harness | Auto | 53.0±1.1 | 51.5±5.2 | 56.0±0.7 | 53.2±2.2 |
| AutoSaddler | Auto | 61.4±2.4 | 60.7±2.4 | 64.6±3.1 | 62.0±1.2 |
SWE-Bench Pro Test Results
| Harness | Type | Ansible (96) | Flipt (85) | Element-web (56) | Avg. |
|---|---|---|---|---|---|
| SWE-agent | Manual | 40.6±1.9 | 31.0±3.5 | 41.1±1.7 | 37.3±4.8 |
| GEPA | Auto | 50.0±1.3 | 32.2±1.4 | 45.2±0.6 | 42.5±1.2 |
| Meta-Harness | Auto | 36.9±2.9 | 31.3±1.7 | 38.7±0.8 | 35.3±2.0 |
| AutoSaddler | Auto | 58.0±1.8 | 36.5±1.8 | 43.5±1.6 | 46.9±1.8 |
Terminal-Bench 2.0 Test Results
| Harness | Type | Pass@1 |
|---|---|---|
| Terminus 2 | Manual | 40.0±0.0 |
| Terminus KIRA | Manual | 47.5±2.5 |
| GEPA | Auto | 42.5±2.5 |
| Meta-Harness | Auto | 43.3±5.8 |
| AutoSaddler | Auto | 50.0±0.0 |
Ablation Studies
RQ1: Does In-depth Diagnosis Matter?
Removing in-depth diagnosis drops Pass@1 from 62.0% → 57.8% (−4.2 pp). Full diagnosis uses on average 6.2 additional tool calls and 5.8 additional file accesses per step, allowing the agent to inspect execution traces, read source code, and verify hypotheses before generating patches.
RQ2: Does Structured Intervention Matter?
Removing structured intervention drops Pass@1 from 62.0% → 56.9% (−5.1 pp). Without it, the patch distribution collapses — 91.5% of patches are Steering-only (trivial text edits). With AutoSaddler’s taxonomy, Capability patches like New Tool (83% acceptance), Loop Change (71%), and Infrastructure Change (67%) are actively discovered.
RQ3: Does Generalization-Aware Selection Matter?
This is the largest ablation factor: removing generalization-aware selection drops Pass@1 from 62.0% → 50.6% (−11.4 pp). The fix rates are comparable between the two settings — the critical difference is regression prevention. Without validation-based selection, the regression rate trends upward (+0.16 pp/iter), while AutoSaddler’s regression rate trends downward (−0.24 pp/iter).
Conclusion
In this work, we introduced AutoSaddler, an automatic harness optimization framework that formulates harness improvement for LLM agents as an offline learning problem over execution traces. AutoSaddler combines in-depth failure diagnosis, structured patch generation across prompts, tools, and middleware, and generalization-aware update selection via validation and EvoDAG-based evolution. As a result, it produces durable harness updates rather than trajectory-specific fixes. On GAIA2, SWE-Bench Pro, and Terminal-Bench 2.0, AutoSaddler consistently improves over the corresponding base harnesses by 9.0, 9.6, and 10.0 percentage points, respectively, and outperforms the strongest automated baseline on each benchmark by 7.4, 4.4, and 6.7 points. These results show that effective harness optimization requires deep debugging, targeted interventions, and explicit selection for generalization, positioning automatic harness optimization as a promising direction for building more performant and reliable long-horizon agent systems.
BibTeX
@misc{park2026autosaddlerautomaticharnessoptimization, title={AutoSaddler: Automatic Harness Optimization with Durable Updates from Agent Execution Traces}, author={Sungho Park and Wonjoong Kim and Rongyuan Tan and Jue Zhang and Wook-Shin Han and Pengfei Gao and Chanyoung Park and Yongqiang Yao and Rao Fu and Elsie Nallipogu and Qingwei Lin and Saravan Rajmohan and Dongmei Zhang}, year={2026}, eprint={2608.23041}, archivePrefix={arXiv}, primaryClass={cs.AI}, url={https://arxiv.org/abs/2608.23041},}