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

Sungho Park, Wonjoong Kim, Rongyuan Tan, Jue Zhang, Wook-Shin Han, Pengfei Gao, Chanyoung Park, Qingwei Lin, Saravan Rajmohan, Dongmei ZhangNeurIPS 2026

TL;DR

Large Language Models suffer from "jagged intelligence"—they can ace complex reasoning one moment and stumble over a basic step the next, which becomes catastrophic during long, multi-step tasks. Engineers normally stabilize them by manually building software "harnesses" (prompts, tools, and control loops), a tedious process of trial and error. AutoSaddler turns harness engineering into an automated, offline machine learning loop, using AI coding agents to debug failed execution traces and write durable code patches that boost agent reliability across completely unseen tasks.

What Problem Does This Paper Address?

Imagine deploying an autonomous AI agent to resolve a sprawling software bug. Because the task requires dozens of consecutive actions, a single misunderstood tool output at step four can derail the entire run by step twenty.

To keep LLM agents on the rails, developers wrap them in an external harness: everything outside the model weights that governs its behavior, including system prompts, tool definitions, and runtime middleware (like loops and pre-execution hooks). While a great harness dramatically improves performance, tuning one by hand is exhausting. Every tweak requires running expensive, multi-step evaluations and reading through massive execution logs to figure out what broke. Furthermore, the moment you swap the underlying LLM or move to a new domain, you often have to start all over again. Prior automated approaches mostly focused on tweaking prompts, leaving the actual code of the tools and control loops untouched.

Methods

AutoSaddler reframes harness design as an offline mini-batch optimization problem, remarkably similar to how we train neural networks, except the "gradients" are diagnostic insights and code diffs.

Figure 2: Overview of AutoSaddler. The iterative optimization loop: the current harness is tested on a mini-batch, diagnosed and patched across harness components, verified for improvement, and then reflected upon to extract lessons into the EvoDAG, which guides the evolution of the next harness.

In each iteration, the current harness runs on a mini-batch of training tasks. Then, three specialized agents (built on the Claude Agent SDK) take over:

  1. Diagnosis–Patch Agent: Instead of skimming a failure summary, this agent actively investigates full execution traces alongside the harness source code to find root causes. It then writes a structured patch across three layers: Prompts, Tools, or Middleware. Crucially, AutoSaddler uses Phased Patch Scheduling—much like a learning-rate schedule—starting with heavy "Capability Patches" (writing new tools, fixing code bugs, altering loop logic) before shifting to lighter "Steering Patches" (refining prompt rules and docstrings).
  2. Reflection Agent: If a patch improves mini-batch performance, it gets tested on a held-out development set. Regardless of whether the patch succeeded or failed, this agent compares pre- and post-patch traces—categorizing tasks as fixed, regressed, still-failing, or still-passing—to extract generalizable lessons.
  3. Evolution Agent & EvoDAG: All harnesses, diffs, scores, and reflection lessons are stored in a directed acyclic graph called EvoDAG. Rather than mutating only the latest harness, the Evolution Agent reviews the entire graph to recombine successful ideas from different branches, escaping local optima.

Datasets

The authors evaluate AutoSaddler across three established, long-horizon agent benchmarks (no new benchmarks are introduced), splitting tasks strictly across distinct domains or repositories to test true generalization:

  • GAIA2: General-purpose smartphone assistant tasks across distinct simulated user "Universes" (using GAIA2's default ReAct agent).
  • SWE-Bench Pro (SBP): Enterprise-scale software engineering tasks across real GitHub repositories like qutebrowser, Ansible, and Element-web (using SWE-agent).
  • Terminal-Bench 2.0 (TB2): 89 realistic command-line tasks spanning cybersecurity, ML, and system administration (using Terminus 2).

Key Insights and Ideas

  • Unconstrained AI optimizers get lazy: When the authors removed their structured patch taxonomy and let the coding agent edit whatever it wanted, 91.5% of its edits collapsed into simple text/prompt tweaks ("Steering"). Yet, deeper code changes—like adding a new tool or changing agent loop logic—had the highest acceptance rates (up to 83%) and caused roughly half as many regressions (8% vs. 17%). Structure forces the optimizer to do the hard, high-value engineering.
  • Deep debugging beats shallow reflection: Standard prompt optimizers pass a failed trace to an LLM in a single call and ask what went wrong. Giving the diagnostic agent file-system tools to actively inspect code and long traces nearly tripled the number of accepted patches in the first epoch (13 vs. 5).
  • Preventing "collateral damage" is the secret to generalization: Without validation filtering and reflection memory, an optimizer will happily write an aggressive middleware hook that fixes one failed training task while breaking ten working ones. AutoSaddler's generalization-aware selection actively drives down regression rates over time (-0.24 percentage points per iteration).

Key Results

Using Claude Opus 4.6, AutoSaddler consistently outperforms both manual base harnesses and state-of-the-art automated optimizers (GEPA and Meta-Harness) on Pass@1 accuracy:

  • Big accuracy jumps: AutoSaddler improves over base harnesses by +9.0 percentage points on GAIA2 (53.0% $\rightarrow$ 62.0%), +9.6 points on SWE-Bench Pro (37.3% $\rightarrow$ 46.9%), and +10.0 points on Terminal-Bench 2.0 (40.0% $\rightarrow$ 50.0%). On TB2, it even beats a manually expert-tuned harness (Terminus KIRA, 47.5%).
Table 3: Test-set Pass@1 results on SWE-Bench Pro and Terminal-Bench 2.0, reported as mean ± standard deviation over three runs. Parentheses indicate the number of tasks; bold denotes the best result per column.
  • 10$\times$ sample efficiency: On GAIA2, AutoSaddler hits peak dev-set accuracy (72.3%) after learning from just 147 execution traces, whereas Meta-Harness plateaus at 61.5% after consuming 1,400 traces.
  • Cross-model transfer: Harnesses optimized using Opus 4.6 still yielded a +5.6 percentage point boost when hot-swapped onto a smaller model (Claude Haiku 4.5).

Limitations and Future Work

  • Stateless task assumption: AutoSaddler assumes tasks are independent and stateless, intentionally leaving out persistent agent components like long-term memory or cross-task skill curation.
  • Optimizer overhead: Because AutoSaddler runs multi-turn diagnostic and reflection agents, it incurs a moderately higher optimizer-side monetary cost per patch—though it compensates by needing far fewer expensive task rollouts overall.
  • Future directions: The authors currently rely on general-purpose LLM reasoning over the EvoDAG to recombine patches, noting that designing specialized, LLM-driven evolutionary search algorithms is a promising next step.

Summary updated

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 and Terminal-Bench 2.0 show that AutoSaddler substantially improves agent performance over the corresponding base harnesses, achieving gains of 9.0 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.
BibTeX
@inproceedings{park2026autosaddler,
  author = {Sungho Park and Wonjoong Kim and Rongyuan Tan and Jue Zhang and Wook-Shin Han and Pengfei Gao and Chanyoung Park and Qingwei Lin and Saravan Rajmohan and Dongmei Zhang},
  title = {{AutoSaddler: Automatic Harness Optimization with Durable Updates from Agent Execution Traces}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=bkGK6zovnv},
}
Figure