arXiv:2610.05300cs.AIOct 2026Cited by 1 paper on PaperVantage

Manuscript Offprint

arXiv:2610.05300

MESH-Harness: Self-Improving Agent Harnesses via Bandit-Guided Compositional Evolution

Zhiwei Shang, Yu Huo, Mingrong Gong, An Yan, Zikun Qu, Junhao Dong, Bryan Kian Hsiang Low, Chenglin Wu, Zhongxiang Dai

ABSTRACT

An agent harness is the code that organizes context, maintains state, and coordinates tool calls for a language model. We study how to improve the harness under a limited evaluation budget while keeping model weights fixed. Our method, MESH-Harness, organizes each harness into functional modules with explicit role-specific interfaces, allowing alternative implementations of each module to be substituted and recombined. It uses shared module representations and full-covariance LinUCB to score candidate combinations based on predicted performance and exploration value. Mixed-start coordinate ascent selects complete configurations for evaluation without enumerating the combinatorial space. Validation traces then guide local code edits, and the resulting candidates are incorporated into fixed-capacity role-specific pools for subsequent recombination. On text tasks, retrieval-augmented mathematical reasoning, code generation, and interactive scientific tasks, MESH-Harness outperforms Meta-Harness by 5.70, 7.01, 2.00, and 5.00 points, respectively, under matched candidate-evaluation budgets. Iterative harness optimization improves MESH-Harness by 5.63–7.79 points over its first-round configurations. For the reported configurations, aggregate test-time cost is 44.2% lower than that of Meta-Harness, while total cost including search is 14.6% lower. These results show that combining module-level design reuse with feedback-driven compositional search can systematically improve agent harnesses while keeping overall optimization cost under control.

1 INTRODUCTION

Large language models (LLMs) can act as agents by retrieving information, calling tools, and interacting with environments (Yao et al., 2023). Their behavior also depends on the external program that controls memory, context construction, tool use, and failure recovery. This program is referred to as the agent harness. Unlike a single prompt, a harness specifies how successive model calls work together to solve a task. For example, harnesses for long-running agents support this coordination through explicit state handoffs, progress records, and execution checks (Young, 2025). Because the harness governs how model calls work together, optimizing it offers a way to improve an agent without updating model weights. AutoHarness synthesizes action validators and policy code through iterative refinement using environment feedback (Lou et al., 2026). Meta-Harness searches over task-specific Python programs, allowing a proposer agent to inspect previous candidates' code, scores, and execution traces (Lee et al., 2026). Both approaches make the surrounding program an object of optimization rather than a fixed implementation.

The difficulty is that evaluating a harness can be much more expensive than proposing it. Even a small edit may require an end-to-end validation run involving many model calls and environment interactions. Meta-Harness likewise identifies candidate evaluation as its main computational bottleneck (Lee et al., 2026). Under a limited budget, the search must therefore decide not only what to generate, but what to execute. We study how to use past evaluations to make these decisions and obtain larger improvements within a fixed number of candidate evaluations.

We introduce MESH-Harness, a bandit-guided framework for compositional harness evolution. Contextual bandits use shared features to generalize from observed rewards and balance predicted performance against uncertainty (Li et al., 2010; Chu et al., 2011). To apply this idea to harnesses, we organize each harness into functional slots with fixed interfaces, maintain a candidate pool

MESH-Harness Self-Improving Agent Harnesses via Bandit-Guided Compositional Evolution

Figure

Figure 1: Overview of MESH-Harness. (a) Each functional slot has a fixed interface and a pool of LLM-initialized implementations with cached embeddings. (b) Full-covariance LinUCB scores configurations with one implementation per slot, and mixed-start coordinate ascent selects a configuration for evaluation. (c) The selected harness is executed to obtain validation rewards and traces. (d) Trace diagnosis guides edits to implementations and fixed-capacity pool updates. Rewards update the bandit model; new implementations join their respective pools for subsequent composition.

per slot, and select one implementation per slot. Each implementation is encoded separately; concatenating the selected embeddings in slot order represents a complete harness. A shared surrogate learns from observed harness scores to predict the performance of untested combinations of module implementations.

Full-covariance LinUCB combines these predictions with an uncertainty bonus to score module combinations. We approximately maximize this criterion through mixed-start coordinate ascent, drawing one start per round from the incumbent, top-K archived configurations, or a random combination and substituting implementations within one slot at a time rather than enumerating the Cartesian product of candidate pools. Selection uses only cached representations and surrogate scores; the chosen complete harness is then executed on the validation tasks. This separates inexpensive candidate comparison from costly task evaluation.

Selection alone cannot discover implementations absent from the candidate pools. MASPOB selects prompt combinations using bandit-guided coordinate ascent but does not update its candidate pools (Hong et al., 2026). MESH-Harness instead updates the available implementations in each slot during search. Validation traces provide evidence of local failures, such as missing information or repeated unsuccessful actions, and guide an LLM in editing implementations while preserving their slot interfaces. New implementations enter their slot's fixed-capacity pool for combination with candidates in other slots. Each execution thus supplies two kinds of feedback: scores update the selection model, while traces guide module evolution. A new implementation need not trigger an immediate end-to-end evaluation.

We evaluate MESH-Harness on text tasks, retrieval-augmented mathematical reasoning, LiveCodeBench (Jain et al., 2025), and ScienceWorld (Wang et al., 2022). Under matched candidate-evaluation budgets, it improves final test scores over Meta-Harness by 5.70, 7.01, 2.00, and 5.00 points, respectively. MESH-Harness improves by 5.63–7.79 points over its first-round configurations. On ScienceWorld, it starts at 51.90, below the ReAct reference score of 55.50, and reaches 58.10. Across all four tasks, the reported configurations reduce aggregate test-time cost by 44.2% relative to Meta-Harness. Total cost, including search and testing the reported configurations, is 14.6% lower. Our contributions are:

Figure

(a) Performance comparison across tasks.

(b) Overall performance comparison.

Figure 2: Test performance across four task domains. (a) Text macro-average, overall Math pass@1, LiveCodeBench solve rate under the fixed cap-8 protocol, and ScienceWorld mean progress score. (b) Unweighted mean of the four task scores. All scores are on a 0–100 scale, with higher values indicating better performance. MESH-Harness achieves the highest score on all four aggregate metrics.

• A bandit-guided harness optimizer that allocates a limited evaluation budget using shared performance predictions and uncertainty estimates.

• A module-level representation and mixed-start coordinate ascent procedure that reuse evaluation feedback across configurations without enumerating the full combinatorial space.

• A trace-driven module evolution mechanism, evaluated on four tasks in terms of final performance, search gains, and search and test costs.

References (30)