Agent harnesses govern how language models act in an environment; designing their policies by hand is difficult, while automated techniques require representative datasets and costly executions. We present Exo, an agent runtime architecture for safe learning during ongoing work that collapses the optimization loop into task execution, allowing agents to revise both their harness and their strategies for further improvement. A minimal protected mechanism layer preserves execution history and governs policy activation while the harness evolves through inspectable code changes. On long-running objectives in an open-world game, Exo reduces model cost by 12-53% relative to Codex and Pi in standalone runs and 45-82% in transfer runs, while matching task completion rates. Compared with the same starting policy without the ability to edit policy, Exo reduces held-out model cost by 35-61% on AppWorld and SREGym with comparable correctness, cutting AppWorld's mean task time by 13% and SREGym's median diagnosis time by 35%. On Continual Learning Bench coding tasks, model cost including learning falls by 14%, with both policies resolving every issue.
Figures & tables
Figure 1: Illustrative harness adaptation during a service incident. The agent builds a diagnostic tool and revises context assembly while continuing the same task. Model weights remain unchanged.
Figure 2: Collapsing an adaptive optimization loop. In (a), a separate optimizer maps execution feedback to harness updates θ . In (b), the agent chooses task and revision actions through the same action interface u .
Figure 3: Exo separates editable policy from protected mechanisms (a). Policy source is exposed for self-editing, with executor activation controlled by a guardian. Across an accepted executor replacement (b), history is retained and extended, and the sandbox can remain in place. State and replacement contracts are given in Section 3.2 .
Figure 4: Open-world outcomes in standalone and transfer runs. Combat and crafting report model cost to finish (lower is better); money-making reports coins per model dollar near eight active hours (higher is better).
Figure 5: Combat specialization and reuse. (a) First 45 active minutes, magnifying the purple box in (b). Circles in (a,b) mark Exo’s tool changes and memory updates. (b–d) Standalone cost, progress, and decision time through five active hours; A–C identify tool changes discussed in the text. (e,f) Transfer cost and progress on fresh accounts with prior agent state retained; A spike in public-server usage lengthens transfer runs. Cost in (a,b) steps at model calls. Decision time is the median time from input to the next model action in each 15-minute window, including provider and network delay.
Figure 6
Metric
Control
Exo
Table 1: Graded-task outcomes for Exo vs identical policy without policy editing (Control). Arrows indicate the preferred direction. AppWorld and CLB values are means; SREGym reports median time and rounds and mean cost. CLB costs include reflection.
An LLM agent's cost and success depend on its model, its harness, and its environment. In addition to the widely studied directions of parameter tuning and harness optimization, we propose the third direction: optimization over stationary environments. Agents are often deployed in rich environments shared by many tasks, such as a company's Slack workspace or a complex collection of data sources, documents or tickets. We call these environments stationary environments. We introduce EnvOpt, a method for automated end-to-end optimization of stationary environments for any given model and harness, using real or synthetic tasks without needing any graders or reference answers. On AutomationBench, EnvOpt reduces the cost of Claude Haiku 4.5 by 72.7% and raises its pass rate by 14.34%. The same environment transfers to Opus 5, cutting its cost by 68.1% with a 1.34% gain. Added on top of Meta-Harness's optimized harness for Haiku 4.5, it lowers cost by a further 83.4% and adds 11.17% accuracy over Meta-Harness alone. Across 5 benchmarks, EnvOpt significantly reduces the cost of agents while improving or maintaining pass rate, and is transferable to different models and different harnesses. We also discuss common successful and rejected environment optimization strategies during automated optimization. More broadly, our results show that how information is represented to an agent shapes both its cost and its success, making the environment worth optimizing in addition to the parameters and the harness.
Mingxuan Li, Huanzhi Mao, Qiuyang Mang +3
University of California, Berkeley · University of Chicago · Bespoke Labs
Agents built around large language models continually accumulate interaction trajectories during deployment, yet their behavior typically remains fixed. Beyond updating model weights, these trajectories can improve the agent harness that constructs context, mediates tools, validates actions, and recovers execution. We introduce Harness-R1, the first method, to our knowledge, that makes failure-conditioned, lifecycle-wide editing of an existing executable runtime a learned capability. It post-trains a dedicated harness engineer with online reinforcement learning so that its edits are optimized for the realized task success they produce, rather than proposed by a fixed editor. A separate 9B engineer converts batches of target-agent failures into validated executable patches; fresh same-batch reruns of the frozen target provide outcome rewards, so training updates only the engineer. Cold-start supervised fine-tuning initializes this editing policy, which is then trained online with group-relative policy optimization. Across WebShop, ALFWorld, and DBBench, Harness-R1 raises vanilla Qwen3.5-9B success from 44.3% to 53.6% (+9.3 percentage points). After direct target-agent fine-tuning, a target-specific engineer raises the average further from 59.2% to 64.2% (+5.0 points); because these gains hold both before and after fine-tuning the target, Harness-R1 points toward co-evolving the harness engineer and the target agent.
Shuai Shao, Kangning Zhang, Qingyao Li +7
Shanghai Jiao Tong University · Xiaohongshu Inc. · Southeast University
AI agent performance depends critically on the runtime harness, comprising the prompts, tools, memory, and control flow that mediate how a model observes, reasons, and acts. Yet today's harnesses remain largely hand-crafted and static: each new model or task still demands bespoke scaffolding, and the rich traces produced during execution are rarely distilled back into systematic improvement. We introduce HarnessX, a foundry for composable, adaptive, and evolvable agent harnesses. HarnessX assembles typed harness primitives via a substitution algebra, adapts them through AEGIS, a trace-driven multi-agent evolution engine grounded in an operational mirror between symbolic adaptation and reinforcement learning, and closes the harness-model loop by turning trajectories into both harness updates and model training signal. Across five benchmarks (ALFWorld, GAIA, WebShop, tau^3-Bench, and SWE-bench Verified), HarnessX yields an average gain of +14.5% (up to +44.0%), with gains largest where baselines are lowest. These results suggest that agent progress need not come from model scaling alone: composing and evolving runtime interfaces from execution feedback is an actionable and complementary lever. The complete codebase will be open-sourced in a future release.