HyperAIHyperAI

Command Palette

Search for a command to run...

SELF-EVOLVING AGENT HARNESS

Chuyang Wei Haoxiang Guan Minghang Zhu Kexin Zhou Jiyan He Xiren Zhou Huanhuan Chen Yifei Shen

Abstract

Harness self-evolution revises an agent’s software scaffolding, including prompts, memory, workflows, and executable components, while keeping model weights fixed. We formalize a feedback-driven process in which accepted revisions persist across runs. The framework separates update targets from proposal and admission mechanisms. It distinguishes changes to interpreted state from revisions to tools and code, repository-level control logic, and plugin composition. We characterize search through evolutionary optimization and examine its reliability through continual PAC-learning. Under explicit assumptions, the analysis yields an expected generalization bound, a retention bound conditional on historical regression budgets, and a high-probability admission rule using fresh, independent validation data. We examine how persistent harness revisions affect knowledge sharing and organizational workflows, with implications for scientific reliability, physical safety, and institutional accountability. Cases from prior work illustrate model–harness co-design, distributed execution, and plugin reuse. Reliable deployment requires continual validation as task distributions and evaluators change, with independent safeguards for learning, runtime privileges, and consequential actions. We provide a comprehensive 66-page discussion of related work, theory, algorithms, evaluation, applications, and the broader impact of Harness RSI, together with continuously updated code and supplementary materials, at https://github.com/zgcagi/Harness-RSI.

One-sentence Summary

Researchers from Zhongguancun Academy, Zhongguancun Institute of Artificial Intelligence, and University of Science and Technology of China propose Self-Evolving Agent Harness, which revises agent prompts, memory, workflows, and code while keeping model weights fixed, formalizes feedback-driven persistent updates through evolutionary optimization and continual PAC-learning, and derives generalization, retention, and validation-based admission guarantees for reliable scientific, physical-safety, and accountability applications.

Key Contributions

  • Formalizes harness self-evolution as a feedback-driven revision process that persists accepted changes to prompts, memory, workflows, and executable components while keeping model weights fixed, separating update targets from proposal and admission mechanisms.
  • Distinguishes interpreted-state changes from revisions to tools and code, repository-level control logic, and plugin composition, and analyzes search through evolutionary optimization and continual PAC-learning; under explicit assumptions, the analysis yields an expected generalization bound, a retention bound conditional on historical regression budgets, and a high-probability admission rule using fresh independent validation data.
  • Provides case illustrations of model-harness co-design, distributed execution, and plugin reuse, plus deployment and broader-impact analysis requiring continual validation under distribution and evaluator drift and independent safeguards for learning, runtime privileges, and consequential actions; includes a 66-page treatment with continuously updated code and supplementary materials.

Introduction

The authors address continued adaptation of deployed agents by studying harness self-evolution, where execution feedback revises the software and configuration around a fixed model, including prompts, memory, workflows, and tools. This matters because harness-level adaptation reuses existing model deployments, avoids retraining or weight access, works with proprietary APIs, and supports direct inspection, versioning, and change tracking. Prior work varies in what is modified, how candidates are generated, and how revisions are admitted, while empirical selection alone does not establish generalization or retention. The authors’ main contribution is a formal framework that defines a persistent feedback-driven lifecycle, classifies interpreted-state updates and executable revisions by mutation boundaries, derives conditional generalization and bounded-regression results from stability and concentration arguments, and analyzes systems implications such as propagation, repair burdens, continual validation, and safety controls.

Method

The authors organize harness self-evolution into distinct executable targets, categorizing them by component implementations, repository-level control logic, and plugin composition. Component-level revision confines mutation to callable procedures or designated modules while keeping surrounding orchestration outside the editable surface. Repository-level search exposes context construction, orchestration loops, execution hooks, recovery, and termination to revision, focusing on control over interactions among harness components. Plugin architectures organize mutation through declared interfaces, dependency constraints, and lifecycle operations, allowing the editable object to be a component implementation or a binding that determines which implementation supplies a runtime service.

To characterize the search structure of these updates, the authors apply an evolutionary algorithm perspective that separates four aspects: the representation of mutable state, the variation that generates edits, the assessment of their fitness, and the selection of state to retain. Local elitism concentrates search around an incumbent, archive-based diversity preserves alternative lineages, and Pareto selection balances competing objectives.

As shown in the figure below:

Because these mechanisms select on empirical fitness, accepted revisions can overfit or forget. To address this, the authors establish a theoretical framework for generalization and retention using a continual PAC-learning perspective. Let XkX _ { k }Xk​ record the harness, skills, archive, and feedback memory after round kkk, with Hk=Deploy(Xk)H _ { k } = \mathrm { { D e p l o y } } ( X _ { k } )Hk​=Deploy(Xk​) and Xk=Ak(Xk−1,Dk;Uk)X _ { k } = \mathcal { A } _ { k } ( X _ { k - 1 }, D _ { k }; U _ { k } )Xk​=Ak​(Xk−1​,Dk​;Uk​). For stability, assume DkD _ { k }Dk​ contains nkn _ { k }nk​ tasks drawn from an exogenous distribution Dk\mathcal { D } _ { k }Dk​. The loss averaged over execution randomness is defined as:

Rs(H)=Ez∼Dsℓ(H,z),R^s(H)=1ns∑i=1nsℓ(H,zs,i).R _ {s} (H) = \mathbb {E} _ {z \sim \mathcal {D} _ {s}} \ell (H, z), \quad \widehat {R} _ {s} (H) = \frac {1}{n _ {s}} \sum_ {i = 1} ^ {n _ {s}} \ell (H, z _ {s, i}).Rs​(H)=Ez∼Ds​​ℓ(H,z),Rs​(H)=ns​1​i=1∑ns​​ℓ(H,zs,i​).

Algorithmic stability links task sensitivity to generalization. By replacing a task with an independent draw and rerunning downstream updates, the bound controls the magnitude of the expected generalization gap:

∣E[Rs(Hk)−R^s(Hk)]∣≤βs,k.\left| \mathbb {E} [ R _ {s} (H _ {k}) - \widehat {R} _ {s} (H _ {k}) ] \right| \leq \beta_ {s, k}.​E[Rs​(Hk​)−Rs​(Hk​)]​≤βs,k​.

To manage retention and accumulated regressions, the authors define Fs,k=Rs(Hk)−Rs(Hs)F _ { s, k } = R _ { s } ( H _ { k } ) - R _ { s } ( H _ { s } )Fs,k​=Rs​(Hk​)−Rs​(Hs​). Assuming each later transition satisfies a regression budget, telescoping yields:

ERs(Hk)≤ER^s(Hs)+βs,s+∑u=s+1kεs,u.\mathbb {E} R _ {s} (H _ {k}) \leq \mathbb {E} \widehat {R} _ {s} (H _ {s}) + \beta_ {s, s} + \sum_ {u = s + 1} ^ {k} \varepsilon_ {s, u}.ERs​(Hk​)≤ERs​(Hs​)+βs,s​+u=s+1∑k​εs,u​.

Admission of new candidates requires fresh validation. Let Rˉk(H)=k−1∑s=1kRs(H)\bar { R } _ { k } ( H ) = k ^ { - 1 } \sum _ { s = 1 } ^ { k } R _ { s } ( H )Rˉk​(H)=k−1∑s=1k​Rs​(H) denote risk on the uniform historical mixture. For a candidate H′H ^ {\prime}H′, the paired difference is bounded using Hoeffding bounds:

Δk(H′)≤Δ^k(H′)+2ln⁡(KT/δ)m.\Delta_ {k} (H ^ {\prime}) \leq \widehat { \Delta } _ { k } (H ^ {\prime}) + \sqrt { \frac { 2 \ln (K T / \delta)}{m} }.Δk​(H′)≤Δk​(H′)+m2ln(KT/δ)​​.

Only candidates with negative upper bounds are accepted. If the evaluator and target risk differ by at most η\etaη, a sufficient condition for target-risk improvement is:

Δ^k(H′)+2ln⁡(KT/δ)m+2η<0.\widehat { \Delta } _ { k } (H ^ {\prime}) + \sqrt { \frac { 2 \ln (K T / \delta)}{m} } + 2 \eta < 0.Δk​(H′)+m2ln(KT/δ)​​+2η<0.

Runtime revision can change both execution cost and where components are best placed, motivating distributed execution strategies. A fixed-deployment study illustrates communication trade-offs by comparing a client, an edge server, and a cloud environment under a mixed workload. Client-edge execution partitions expert networks and compresses task-relevant features, while the edge-only baseline transmits losslessly compressed input images.

As shown in the figure below:

Client-edge co-inference minimizes latency across varying network rates. Future system designs must incorporate harness synthesis, validation, and distribution costs when comparing deployment choices across network conditions and update frequencies.

Experiment

The experiments evaluate two forms of harness self-evolution: runtime revision through HarnessOpt and dynamic tool generation through a Codex plugin under DSH Everything. HarnessOpt is assessed on spreadsheet benchmarks, where an evolved harness enables a smaller model to surpass a larger model with an earlier skill optimizer, suggesting model-harness pairing rather than cost-matched superiority. The plugin experiments simulate an office workload and a live browsing benchmark, showing that generated tools reduce tool calls and can yield cumulative reuse savings after initial overhead, though cost trajectories and causal gains remain unresolved without repeated matched-budget comparisons.

A harness is decomposed into seven runtime functions that govern model execution in a task environment, spanning execution control, tool and skill orchestration, context preparation and compaction, memory and state management, scheduling and coordination, and execution infrastructure. These functions collectively control calls, context, memory, delegation, and sandboxed execution, and an implementation may combine them rather than assign each to a separate module. Agent loop and execution control manages model and tool calls along with continuation, stopping, cancellation, and recovery. Execution infrastructure enforces boundaries and records activity through sandboxes, permissions, approvals, storage, model adapters, logs, and replay.

SpreadsheetBench accuracy rises across all four models from initial baselines through SkillOpt, SkillOpt-Lite, HarnessOpt-only, and HarnessOpt-with-skill. HarnessOpt with skill produces the highest accuracy for every model, improving on SkillOpt-Lite by about 5.7 to 11.4 percentage points. The smallest model with HarnessOpt and skill outperforms the largest model with SkillOpt alone, indicating a model-harness pairing benefit rather than cost-matched superiority. HarnessOpt with skill is the most accurate configuration across all four models, with gains over SkillOpt-Lite ranging from 5.69 to 11.39 percentage points. GPT-5.4-nano with HarnessOpt and skill reaches 77.58%, exceeding GPT-5.5 with SkillOpt at 76.20%, showing that harness revision can offset model-scale differences on this benchmark.

The EIP configuration sharply reduces first-task tool calls compared with baseline, but it increases first-task token use and wall time. Cumulative results suggest possible reuse savings after the first task, although an unresolved discrepancy in first-task cumulative values prevents combining the two reports into a single cost trajectory. First-task tool calls drop sharply, while token and wall-time costs rise under EIP. Cumulative figures indicate savings from the second task onward, but first-task accounting differences remain unresolved.

The cumulative comparison shows an initial token and wall time increase for the first task, followed by negative cumulative differences from the second task onward. Savings grow across tasks, with the largest cumulative reduction reached after five tasks. A discrepancy between first-task totals and the reported cumulative first-row values prevents treating the two reports as one consistent cost trajectory. The first task carries a cumulative overhead in tokens and wall time relative to baseline. From task 2 onward, cumulative differences turn negative and savings increase through task 5. The first-task totals imply larger initial increases than the cumulative row reports, so the two reports cannot be combined into a single uninterrupted trajectory.

The LiveBrowseComp results place XYZ + dsh-everything at the top of the listed sub-40B systems, narrowly ahead of XYZ-Aquila-mini. Scores decline steadily among the remaining mini-scale entries, with the lowest listed system far behind the leaders. The score unit is unspecified, so the comparison is best read as a relative ranking. XYZ + dsh-everything leads the displayed sub-40B group by a small margin over XYZ-Aquila-mini. The remaining systems show a clear downward score trend, with the lowest-ranked entry well below the top two. The source notes that the score unit is unspecified and that this system ranks second among all eleven reported systems.

The evaluation studies a harness decomposed into runtime functions for execution control, tool and skill orchestration, context preparation, memory, scheduling, and infrastructure, then tests optimized configurations across tasks. SpreadsheetBench results show that HarnessOpt with skill improves accuracy for all four models and that a smaller model with this harness can outperform a larger model with SkillOpt alone, indicating a model-harness pairing benefit rather than a scale effect. Cost experiments find that EIP reduces first-task tool calls but raises token and wall time, with cumulative savings appearing from the second task onward, although reporting discrepancies prevent a single consistent cost trajectory. LiveBrowseComp places XYZ with dsh-everything slightly ahead of XYZ-Aquila-mini among sub-40B systems, with lower-ranked systems trailing and the score unit left unspecified.


Build AI with AI

From idea to launch — accelerate your AI development with free AI co-coding, out-of-the-box environment and best price of GPUs.

AI Co-coding
Ready-to-use GPUs
Best Pricing

HyperAI Newsletters

Subscribe to our latest updates
We will deliver the latest updates of the week to your inbox at nine o'clock every Monday morning
Powered by MailChimp