AI news and explainers at 7 AM weekdays, plus a Sunday weekly at 8Get it in your inbox

METAL LAB

DarwinX: Evolving Agent Harnesses Through Natural Selection

arXiv:2608.075452026-07-30

An AI agent got stronger by evolving only its prompts and tools, not its underlying model, through a selection process modeled on natural selection

DarwinX keeps the LLM's weights completely frozen and instead evolves the agent's 'harness' -- prompts, tools, skill documents, and control flow -- as a population of variants selected like natural selection. It only promotes variants that solve new tasks without breaking previously solved ones, and merges complementary lineages from an archive. Across four benchmarks covering terminal tasks, web automation, and code repair, it reports roughly a 17-point average gain.

METAL LAB explanatory visual

How DarwinX's selection loop works

Evidence statusMeasured results reported

  1. Frozen modelThe underlying LLM (GPT-5.5, GPT-5.6, or Opus 4.8) keeps the exact same weights throughout every evolution run
  2. Generate harness variantsFailure analysis, teacher demonstrations, and self-contrast signals produce small edits to prompts, tools, and control flow
  3. Preserve-and-extend screeningOnly variants that solve a new task without regressing previously solved ones get promoted
  4. Archive and recombinationEven non-promoted variants are kept; complementary lineages are merged to combine their distinct strengths
  5. Four-benchmark checkGains are tested for whether they hold up on Terminal-Bench 2.1, TerminalWorld, WebArena-Infinity, and transfer to SWE-bench Verified
An explanatory diagram made by METAL LAB, not a figure supplied by the paper's authors.

What they did

  1. Prior self-improving agents that edit along a single lineage tend to get stuck on early choices or silently regress one task family while fixing another.
  2. DarwinX keeps a population of harness variants in an archive and only promotes a child under a 'preserve-and-extend contract': it must solve something new without losing what the parent already solved.
  3. Three learning signals -- failure analysis, teacher demonstrations, and contrasting the agent's own passing/failing rollouts -- feed into one shared edit interface.
  4. There are no gold-label answers or hand-picked winners; fitness comes purely from each benchmark's own verifier measuring solve rate (avg@k).
  5. On Terminal-Bench 2.1 the evolved harness reached 83.2% (+7.7 points) on a matched base and 84.7% on a stronger base at the verified leaderboard frontier; on TerminalWorld's held-out split it reached 68.3%, ahead of every off-the-shelf agent tested.
Figure 1: With the base model frozen, evolving the harness alone matches or beats the strongest prior agent on four benchmarks. Left: variants survive on measured fitness (avg@k, no gold solutions) and complementary survivors are merged. Right: bars within a panel share one frozen model; the hatched bar is zero-shot transfer of the Terminal-Bench 2.1 harness. y-ranges are truncated and differ per panel.
Figure 1: With the base model frozen, evolving the harness alone matches or beats the strongest prior agent on four benchmarks. Left: variants survive on measured fitness (avg@k, no gold solutions) and complementary survivors are merged. Right: bars within a panel share one frozen model; the hatched bar is zero-shot transfer of the Terminal-Bench 2.1 harness. y-ranges are truncated and differ per panel.
Table 1: Positioning among self-improving-agent methods (✓ present, ∼ restricted, ✗ absent). All share the same inner loop and differ in the selection wrapped around it: Search and Selection group the two failure modes we target, path dependence and cross-task interference. Appendix Table 7 gives the mechanism behind each mark.
EditsSearchSelectionSignal
Methodtools & control flowtools &control flowpopulation archivepopulationarchivecross-lineage mergecross-lineagemergebounded regressionboundedregressionnoise-aware avg@knoise-awareavg@kteacher & self signalsteacher &self signals
tools &
control flow
population
archive
cross-lineage
merge
bounded
regression
noise-aware
avg@k
teacher &
self signals
Optimizers over one designated artifact
OPRO/PromptBreeder/TextGrad∼†
ADAS/AFlow/GPTSwarm
SkillOpt
Agents that edit their own scaffold
SICA
DGM
HarnessX
DarwinX (ours)
Figure 2: DarwinX’s selection loop with the model frozen. Left: the preserve-and-extend contract. Middle: the archive of alternative lineages. Right: shared memory carried across generations.
Figure 2: DarwinX’s selection loop with the model frozen. Left: the preserve-and-extend contract. Middle: the archive of alternative lineages. Right: shared memory carried across generations.
Table 4: WebArena-Infinity per-application audit-clean pass@1 on the official 10-application, 1,260-task real suite; Δ is Monet (DarwinX)’s gain over base Monet. Baseline provenance and raw pre-audit scores are in Appendix D.3.
ApplicationKimiQwenGemini+BUGPT-5.5+BUMonet (base)Monet (DarwinX)Δ
Elation clinical records50.054.281.792.595.896.7+0.9
Elation prescriptions23.341.780.890.820.095.0+75.0
GitLab plan and track39.337.163.677.963.697.9+34.3
Gmail70.056.775.085.025.098.3+73.3
Gmail accounts and contacts40.033.361.787.521.791.7+70.0
Handshake career exploration50.050.550.583.536.584.0+47.5
Linear account settings54.265.873.381.743.394.2+50.9
PayPal wallet70.771.488.690.049.395.7+46.4
Superhuman general15.025.850.080.831.787.5+55.8
Xero invoicing52.555.880.893.339.296.7+57.5
Overall43.348.369.386.143.593.0+49.5
Figure 3: DarwinX’s per-generation operators. Left: the mutation loop and the three learning signals that drive it. Middle: variants classified by how their solved set changes, where those preserving inherited solves stay eligible for recombination while the rest contribute only distilled lessons. Right: the merge operator and its acceptance criterion.
Figure 3: DarwinX’s per-generation operators. Left: the mutation loop and the three learning signals that drive it. Middle: variants classified by how their solved set changes, where those preserving inherited solves stay eligible for recombination while the rest contribute only distilled lessons. Right: the merge operator and its acceptance criterion.
Table 6: TB2.1 skill-bundle diff: the seven skills the evolved lineage adds over base Monet, all in one verification / artifact-contract family. Skills are co-selected, so this attributes composition, not per-skill effect.
Evolved skillsRole
verifier-contract contract-candidateDerive the task’s acceptance contract and check the solution against it before finalizing.
graded-artifact-final-check artifact-verification-loopVerify the graded artifact (output file, format, and values) and iterate a fix-and-recheck loop.
real-tool-artifact tool-grounded-artifactGround outputs in real tool execution rather than asserted or simulated results.
security-contract-repairRepair the solution against security and contract checks.
Figure 7: WebArena-Infinity evolution as optimization. (b) shows the same run as a lineage tree: accepted (blue) and reverted (grey) variants, the primary lineage (gold, base → evolved), and recombination edges (dashed).
Figure 7: WebArena-Infinity evolution as optimization. (b) shows the same run as a lineage tree: accepted (blue) and reverted (grey) variants, the primary lineage (gold, base → evolved), and recombination edges (dashed).
Table 7: Mechanism-level comparison with the closest self-improving-agent systems, expanding Table 1. “Promotion rule” is the evidence a candidate must produce before it is kept; “cross-task interference” is how each method prevents an edit that helps one task family from silently regressing another.
MethodEditable surfaceSearch structurePromotion ruleCross-task interference
Optimizers over one designated artifact
OPRO, PromptBreeder, TextGradInstruction text; tools and control flow stay fixed.Iterative keep-best, or a genetic population with prompt crossover.Scalar score on a fixed development set, or a textual gradient from failures.Not addressed; the search targets a single task or few-shot pool.
ADAS, AFlow, GPTSwarmThe composition graph over otherwise-fixed components.Archive of past workflows, or MCTS over graph edits.Mean accuracy on the target benchmark.One benchmark per search; no per-task preservation check.
SkillOptAn external skill document.Single-lineage keep-best, framed as a gradient-descent analogy.A held-out validation point estimate gates each edit.One domain at a time.
Agents that edit their own scaffold
SICAThe agent’s own source code.A single lineage of self-modification.Benchmark reward on the current coding suite.One coding domain; the authors report an early-edit plateau.
DGMAgent source code.Open-ended archive, stochastic single-parent mutation, no merge operator.Score against the parent on a task subset that grows with confidence.Staged subsets, but no explicit preservation contract.
HarnessX‡A typed harness: prompts, tools, and control flow.Staged single-lineage pipeline; variants are kept isolated from each other.Per-edit gate on the average score plus a seesaw test.Isolation keeps task families apart, so sub-threshold regressions still accumulate.
DarwinX (ours)The full harness: a skill layer (prompts, memory, distilled knowledge) and a code layer (tools, control flow, agent loop).Population archive of typed nodes; parents sampled by cumulative lineage gain; complementary specialists merged into inherited children.Fitness enabler (g>0, R≤δ) adjudicated by a verifier, then avg@k confirmation and a preservation probe before a node may steer search.Specialists are retained and recombined rather than isolated, and the preservation probe bounds what any promotion may cost.
(b) Archive lineage tree (node size ∝ screening score).
(b) Archive lineage tree (node size ∝ screening score).
Table 8: Benchmark-specific base models, evolution and reporting protocols. The base model is frozen throughout every matched comparison, so the harness is the only thing DarwinX changes.
BenchmarkFrozen baseEvolution dataReport dataSelection signalReport metric
TB2.1GPT-5.5∘89 verifier taskssame 89 tasksavg@3 screen, avg@5 confirmavg@5
TerminalWorldOpus 4.8*94 train tasks41 held-out tasksadaptive avg@k subsetspass@1
WAIGPT-5.5300 synthetic intents1,260 real tasksLLM judge, avg@3/avg@5deterministic pass@1
SWE-V (transfer)Opus 4.8none (transfer target)500 issuesn/a (frozen)official pass@1
Figure 8: Invalid trajectories before vs. after evolution, by application (left) and mechanism (right). Evolution cuts invalid trajectories from 293 to 17, leaving only raw-state mutations.
Figure 8: Invalid trajectories before vs. after evolution, by application (left) and mechanism (right). Evolution cuts invalid trajectories from 293 to 17, leaving only raw-state mutations.
Table 10: Construction of the 300-intent WAI evolution split. The benchmark’s own task suites are never read at any stage, so deduplication is intra-pool only.
StageIntentsOperation
Seeds1,080Two models propose intents from each application’s description document
Raw synthesis11,279Dual-model expansion of the seeds under per-application quotas (18 applications)
Filtered8,013Quality heuristics, Jaccard near-duplicate removal, TF–IDF uniqueness pruning
Served apps5,332Restricted to the 12 applications with a served instance
Evolution split300Balanced draw of 25 intents per served application
Figure 9: Per-application success on the real WAI suite, raw pre-audit (left) vs. audit-clean (right). The audit collapses the base’s inflated successes (→43.5%) while leaving Monet (DarwinX) nearly unchanged (→93.0%).
Figure 9: Per-application success on the real WAI suite, raw pre-audit (left) vs. audit-clean (right). The audit collapses the base’s inflated successes (→43.5%) while leaving Monet (DarwinX) nearly unchanged (→93.0%).
Table 11: Regex patterns used to detect invalid state access or mutation.
#Regex (paraphrased)Catches
1/apistate/Any read or write of the /api/state scoring endpoint
2_pushStateToServer | getSerializableState | resetToSeedData | __APP_STATE__ | window.state=State-sync internals
3localStorage/sessionStorage setItem/removeItem/clearDirect storage writes
Table 12: Examples of valid and invalid agent operations.
OperationClassificationReason
Admissible
Click through the UI to add a patient tagVALID_UINormal product operation
Inspect /js/state.js after the app loads or references itVALIDClient-exposed app knowledge
Read AppState.patients in the browser runtimeVALIDRuntime application observation
POST /patients/123/tags with the current user’s sessionVALID_PRODUCT_APIDomain-level app API
AppState.addPatientTag(123, "Flu-Season")VALID_INTERNAL_APP_COMMANDApp-defined semantic mutator
AppState.currentSection = "patients" to navigateVALIDInternal navigation; no scored-state fabrication
Inadmissible
cat <apps>/.../js/state.js via the filesystemINVALID_PRIVILEGED_KNOWLEDGELearns from the co-located source tree
Read .../server.py to discover hidden endpointsINVALID_PRIVILEGED_KNOWLEDGEHost-only server details
Fetch server source through path traversal or unintended static exposureINVALID_EXPLOIT_OR_PRIVILEGE_ESCALATIONBrowser use does not legitimize an unintended disclosure
patient.tags.push("Flu-Season"); AppState.notify()INVALID_RAW_STATE_MUTATIONDirectly edits the scored representation
Replace local storage with hand-edited serialized stateINVALID_RAW_STATE_MUTATIONBypasses application semantics
Send a fabricated full state to /api/stateINVALID_EVALUATION_PLANE_ACCESSUses benchmark synchronization as a control channel
sqlite3 app.db ’UPDATE patients ...’INVALID_DIRECT_DATABASE_MANIPULATIONHost access plus a direct database edit
Inject SQL through a request to bypass authorization or alter rowsINVALID_EXPLOIT_OR_PRIVILEGE_ESCALATIONExploit rather than authorized semantics
Forge an admin token and call an otherwise valid APIINVALID_EXPLOIT_OR_PRIVILEGE_ESCALATIONExceeds the current user’s authority
Table 13: Contract-oriented browser skills added by evolution.
SkillWhen to useCore procedure
web_task_contractGeneral browser/web-UI tasks; durable state change or exact filtered/sorted/read answerDerive an explicit acceptance contract (target, operation, exact final observable state, forbidden substitutions, persistence) → find a valid path, UI first → execute the smallest change → verify both rendered UI and backing state, and reload to confirm persistence → if a target seems missing, prove “not found” from ≥2 independent app surfaces before declaring a no-op.
filtered_list_report_contractCount / latest / oldest / value questions over lists and tablesPreserve the active collection scope (tab, status, search, project, date range) while applying the requested filter; count across the whole scoped set (not just the rendered page); answer with only the requested value.
browser_spa_state_contractDurable state changes where visible controls are missing/ambiguousDerive the exact field-level contract; inspect app-owned stores/reducers/action helpers; mutate through the app’s own action/persistence path; then read back both state and UI.
browser_config_contractDurable configuration records (filters, rules, reminders, routing)Prove every field (condition, action, enabled, timing, channel, persistence), not a partial visible match.
Table 14: The evolved browser prompt replaces an absolute UI-only rule with a bounded semantic fallback and persistence verification.
AspectBase prompt (before)Evolved prompt (after)
Interaction policy“Interact ONLY through the UI…Do NOT write application state directly or touch /api/state.”“Prefer real UI controls first…If a bounded audit proves no visible UI path can satisfy a durable state-changing task, you may inspect app-owned stores, reducers, loaded modules, public helper methods, and readback paths, then use the app’s own exposed action/update helper for the smallest targeted mutation. Do NOT touch /api/state, write local/session storage, use seed/reset helpers, or call state-sync internals.”
Finishing (verification)“For a state-changing task, make the change in the UI, screenshot to confirm, then stop.”“For a state-changing task, verify both app-owned state/readback and the rendered UI; reload or navigate away/back to confirm persistence, then stop.”

Findings

  • On Terminal-Bench 2.1 (89 tasks), base Monet on GPT-5.5 scored 75.5%; the DarwinX-evolved harness reached 83.2% (+7.7 points), and on a stronger GPT-5.6 base it reached 84.7%, matching or exceeding the public verified leaderboard leader.
  • On TerminalWorld's 41 held-out tasks (disjoint from the 94 training tasks), Monet (DarwinX) on Opus 4.8 solved 28/41 (68.3%), ahead of every off-the-shelf agent evaluated and up from 25/41 (+7.3 points) for the unevolved base.
  • On WebArena-Infinity, evolving only on 300 synthetic intents lifted real-task pass@1 on 1,260 unseen tasks from 43.5% to 93.0% after audit-clean scoring.
  • A Terminal-Bench 2.1-evolved harness transferred unchanged to SWE-bench Verified (500 issues) and produced measured performance there.
  • A submission audit found no harness-level verifier-gaming, and invalid trajectories dropped from 293 before evolution to 17 after.

Where it can be used

  • Designing pipelines that improve coding or terminal agents by evolving prompts, tool sets, and control flow instead of retraining the base model.
  • Organizations that want to convert evaluation compute into durable agent capability without touching model weights.
  • Building agent-improvement loops in any domain that has its own automated verifier, without needing gold-label answers.

Limits and open work

  • The approach requires a benchmark with its own automated verifier, which the authors note is often unavailable in real deployment settings.
  • avg@k scoring requires multiple rollouts per candidate, which is affordable as a periodic offline job but too costly for per-request evolution.
  • Co-evolving the model and harness together, and generalizing preservation constraints to compliance requirements, are proposed as future directions but not tested here.
  • How much of a harness survives a base-model swap, and how many generations a warm archive needs for re-selection, has not been measured.
  • The Terminal-Bench 2.1 skill-bundle attribution reflects the combined effect of co-selected skills, not the isolated causal contribution of any single skill.

Why it matters

It shows that meaningful agent capability gains can come from selecting better prompts and tool configurations rather than retraining model weights, which matters for anyone trying to improve agents cheaply. It also suggests a harness can be treated as a durable asset that carries over across model generations, reducing the cost of model upgrades.

Terms in this paper

  • harness · the prompts, tools, skill documents, memory, and control flow that surround and direct an LLM in an agent
  • avg@k · a scoring method that runs the same task k times and averages the success rate
  • preserve-and-extend contract · a rule that only promotes a harness variant if it solves a new task without meaningfully losing tasks it already solved
  • recombination · combining edits from two different harness lineages into one child that inherits the strengths of both
  • pass@1 · a metric measuring whether a task was solved correctly on a single attempt

Original abstract (English)

An LLM agent's capability depends not only on model weights but on its harness: prompts, tools, skills, and control flow. Self-improvement loops already edit harnesses, yet single-lineage search is path-dependent and local wins often regress other tasks. We introduce DarwinX, which treats self-evolution as selection over a population of harnesses with the model frozen: a preserve-and-extend contract admits only variants that extend coverage without regressing, an archive keeps alternative lineages for recombination, and failure-, teacher-, and self-derived evidence share one edit interface. Fitness comes from each benchmark's own verifier: no gold solutions, no hand-picked winners. Across four benchmarks that progressively separate the evolution signal from the test, one loop adds about 17 points on average: Terminal-Bench 2.1 rises +7.7 to 83.2% on a matched base and to the verified frontier at 84.7% on a stronger one; TerminalWorld's held-out split reaches 68.3%, ahead of every off-the-shelf agent; WebArena-Infinity real-task pass@1 rises from 43.5% to 93.0% audit-clean; and a Terminal-Bench 2.1 harness transfers unchanged to SWE-bench Verified. What evolves is general agent competence, not benchmark-specific patches, so it survives changes of task, verifier, and base model. A frozen model need not be a fixed agent: harness selection turns evaluation compute into durable capability.

Authors · Yifan Zhang

Read on arXiv

Latest papers

All papers →

Latest from METAL LAB

Figures: Yifan Zhang et al., arXiv:2608.07545, CC BY 4.0