AutoSaddler: Automatic Harness Optimization with Durable Updates from Agent Execution Traces

*Work done during internship at Microsoft., Corresponding author.

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

Demo of AutoSaddler.

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.

Baseline
Baseline47.7%
The starting point: the default GAIA2 agent harness with a standard system prompt, basic tool set, and no middleware hooks. It scores 47.7% on the dev set.
Best Dev Acc
AutoSaddler (Ours)72.3%
GEPA64.6%
Meta-Harness61.5%
Default Agent47.7%

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.

AutoSaddler framework overview: iterative optimization loop with Diagnosis-Patch, Reflection, and Evolution sessions
Overview of AutoSaddler. The framework iterates through three sessions: (1) Diagnosis-Patch analyzes failed execution traces and generates structured patches; (2) Reflection compares pre- and post-patch outcomes to extract lessons; (3) Evolution consults the full EvoDAG to synthesize the next harness candidate.

Three Key Ingredients

AutoSaddler’s design is grounded in three requirements for effective harness optimization:

  1. 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).

  2. 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.

  3. 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:

CategoryPatch TypeKindDescription
PromptRule AdditionSAdd behavioral rules to system prompt
Rule ModificationSRevise existing prompt rules
ToolNew ToolCAdd new tool for unsupported action
Argument ModificationCAdd or fix tool parameters
Implementation FixCFix bugs or extend tool functionality
Description FixSModify docstrings to prevent misuse
MiddlewarePreToolUse HookSInject just-in-time reminder before tool call
Infrastructure ChangeCModify agent config or environment settings
Agent Loop LogicCAdd 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.

Compute efficiency: dev accuracy vs. number of task executions on GAIA2
Compute Efficiency. AutoSaddler reaches 72.3% dev accuracy with ~1,000 task executions. GEPA and Meta-Harness saturate at 64.6% and 61.5% with ~2,800 executions.
Learning efficiency: dev accuracy vs. number of traces consumed on GAIA2
Learning Efficiency. AutoSaddler achieves its best dev performance consuming only 147 traces — roughly 10× fewer than Meta-Harness (1,400 traces).

GAIA2 Test Results

HarnessTypeUniv. 21 (107)Univ. 22 (112)Univ. 27 (81)Avg.
Default AgentManual54.8±4.851.5±4.952.7±4.353.0±1.5
GEPAAuto60.1±3.947.9±3.456.4±0.754.6±2.5
Meta-HarnessAuto53.0±1.151.5±5.256.0±0.753.2±2.2
AutoSaddlerAuto61.4±2.460.7±2.464.6±3.162.0±1.2

SWE-Bench Pro Test Results

HarnessTypeAnsible (96)Flipt (85)Element-web (56)Avg.
SWE-agentManual40.6±1.931.0±3.541.1±1.737.3±4.8
GEPAAuto50.0±1.332.2±1.445.2±0.642.5±1.2
Meta-HarnessAuto36.9±2.931.3±1.738.7±0.835.3±2.0
AutoSaddlerAuto58.0±1.836.5±1.843.5±1.646.9±1.8

Terminal-Bench 2.0 Test Results

HarnessTypePass@1
Terminus 2Manual40.0±0.0
Terminus KIRAManual47.5±2.5
GEPAAuto42.5±2.5
Meta-HarnessAuto43.3±5.8
AutoSaddlerAuto50.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.

Patch diversity: Capability vs Steering distribution
Capability vs. Steering patch distribution across iterations.
Patch acceptance rate by subtype
Acceptance rate by patch subtype. Capability patches (New Tool, Loop Change) have the highest acceptance rates.

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).

Regression rate on dev set across iterations
Regression rate on dev set. AutoSaddler (blue) trends downward; without generalization-aware selection (orange) it trends upward.
Net gain on dev set across iterations
Net gain (fix rate − regression rate) on dev set. AutoSaddler maintains positive net gain throughout optimization.

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},
}