Building reliable Large Language Model (LLM) agents is notoriously difficult. Even the most capable models exhibit "jagged intelligence," where they excel at complex reasoning but stumble over simple, long-horizon tasks because small errors compound into total failure. While developers often build "harnesses"—the prompts, tool configurations, and control logic surrounding the model—to mitigate this, manual tuning is a slow, expensive, and non-scalable process.
Enter AutoSaddler, a new framework that treats harness optimization as an offline learning problem. By automatically diagnosing failure traces and generating structured code patches, AutoSaddler turns agent development into an iterative, data-driven evolution.
TL;DR
AutoSaddler is an iterative framework that automatically optimizes LLM agent harnesses by learning from execution failures. By combining deep trace diagnosis with structured code patching and a validation-based selection process, it achieves up to a 10-percentage-point performance boost across major benchmarks while being 10x more sample-efficient than previous automated methods.
What Problem Does This Paper Address?
The "harness" is everything that makes an LLM an agent: the system prompts, the tool definitions, and the middleware logic (like retry loops or input filtering). Currently, if an agent fails a task, a human engineer must manually inspect the logs, guess the root cause, and tweak the code or prompt.
This is problematic for three reasons:
- Search Space: The design space for prompts and tools is massive.
- Cost: Evaluating a single change requires running the agent through long-horizon tasks, which is expensive and slow.
- Overfitting: A fix for one specific failure often breaks three other things (regressions).
Methods
AutoSaddler formalizes harness optimization as an iterative loop, mirroring the structure of mini-batch machine learning but applied to textual and symbolic parameters.
The framework consists of several key stages:
- Diagnosis-Patch Session: Instead of "shallow reflection" (asking an LLM why it failed), AutoSaddler uses a specialized agent to perform "deep debugging." It explores the execution traces and the harness codebase to identify root causes.
- Structured Patching: The system doesn't just rewrite prompts. It generates structured patches categorized into Capability Patches (modifying executable code, tools, or logic) and Steering Patches (modifying prompts and descriptions).
- Phased Scheduling: Much like a learning rate schedule, AutoSaddler starts with a "Capability Phase" to fix fundamental logic gaps before moving to a "Steering Phase" for fine-tuning behavior.
- EvoDAG (Evolutionary Directed Acyclic Graph): This serves as the system's memory. It tracks every harness version, its performance, and the "lessons learned" from failures. This allows the system to merge successful branches or "rebase" to a previous stable version if a new patch causes a massive regression.
- Generalization Gate: A patch is only "durable" if it works beyond the specific failure that inspired it. AutoSaddler uses a validation set to filter out updates that don't generalize.
Datasets
The authors evaluated AutoSaddler on three diverse and challenging benchmarks:
- GAIA2: General assistant tasks in a simulated smartphone environment.
- SWE-Bench Pro: Enterprise-scale software engineering tasks.
- Terminal-Bench 2.0: Complex command-line problem-solving tasks.
Crucially, they used "out-of-distribution" splits (e.g., training on one set of software repositories and testing on entirely different ones) to ensure the optimized harnesses weren't just memorizing specific tasks.
Key Insights and Ideas
- Deep Debugging is Non-Negotiable: The authors found that "shallow reflection"—a common technique in prompt optimization—often misidentifies the root cause of long-horizon failures. Deeply inspecting tool calls and file system states is required to find the "true" bug.
- Structure Prevents "Steering Collapse": Without structured intervention, optimization systems tend to default to simple prompt edits. Forcing the system to consider tool and middleware changes (Capability Patches) leads to much more robust agents.
- The Power of Rebasing: In their search trajectory analysis, the authors observed "catastrophic regressions" where a single bad rule broke many tasks. The EvoDAG allowed the system to detect this, discard the bad branch, and re-apply only the proven fixes from that lineage.
Key Results
AutoSaddler consistently outperformed both manual baselines and state-of-the-art automated optimizers:
- Performance Gains: It improved agent performance by 9.0 pp on GAIA2, 9.6 pp on SWE-Bench Pro, and 10.0 pp on Terminal-Bench 2.0.
- Efficiency: On GAIA2, AutoSaddler reached peak performance using ~1,000 task executions, whereas baselines like Meta-Harness required nearly 3,000 to reach a lower plateau.
Limitations and Future Work
While powerful, AutoSaddler currently relies on supervised learning, meaning it needs "gold answers" to know if a task succeeded. In many real-world scenarios, these labels are expensive to get. The authors suggest moving toward unsupervised or weakly supervised signals (like trace-level inconsistencies or self-consistency) in the future. Additionally, the current framework focuses on stateless tasks; extending this to agents with long-term memory and evolving skill libraries remains an open challenge.
Summary updated