Research deep dive · 20 August 2026
01 / 22

Self-Harness

Harnesses that improve themselves.

The idea is simple: let an agent study its own execution failures, propose small changes to the scaffolding around it, and keep only edits that survive regression tests.

Paper explainer
Mineweaknesses Proposesmall edits Validateregressions samemodel
A plain-English guide to the paper’s mechanism, evidence and practical implementation.
Zhang et al., “Self-Harness: Harnesses That Improve Themselves” · arXiv:2606.09498v3
The short version
02 / 22

An agent can improve its operating system without changing its brain.

Self-Harness keeps the model weights fixed. It evolves the surrounding protocol: prompts, tools, runtime controls, verification and recovery.

1

Mine

Run tasks. Use verifier-grounded traces to cluster recurring failure mechanisms.

2

Propose

Ask the same model for diverse, minimal edits tied to those mechanisms.

3

Validate

Regression-test each candidate on held-in and held-out tasks. Promote only non-regressive gains.

9/9model–benchmark combinations improved
+40.6pplargest absolute gain: GLM-5 on AppWorld
+132%largest relative gain: Qwen3.5 on AppWorld
Beginner lens: think “test-driven self-tuning for the agent scaffold”.
Source: abstract; §§1 and 5; Table 1.
The problem
03 / 22

Agent performance is more than model capability.

The harness is the layer that decides what the model sees, what it can do, when it checks its work and how it recovers.

Same model ≠ same agent.

Two harnesses can produce different outcomes because execution protocol changes behaviour over long horizons.

HARNESS AHARNESS B MODEL MODEL loops · late artefactchecks · recovery · stop FAILPASS
Harness = prompts + tools + memory/state + verification + policies + runtime control.
Source: §§1–2.
Section break · the shift
04 / 22

Who gets to improve the harness?

Self-Harness moves improvement inside the evaluated agent, while keeping the model and evaluator fixed.

Human engineering

Experts inspect failures and manually revise the scaffold.

Meta-Harness

A stronger external agent guides improvement of a weaker target.

Self-Harness

The evaluated agent improves the very harness it runs through.

The paper studies a bounded middle ground, not open-ended recursive self-improvement.
Source: Figure 1; §1.
Deep dive · mechanism
05 / 22

Evidence becomes a harness state transition.

Every round starts with a current harness hₜ and ends with either a tested update hₜ₊₁ or no change.

01 · observeWeakness mining

Run the fixed model. Collect traces and verifier outcomes. Cluster recurring failure signatures.

→
02 · hypothesiseHarness proposal

Generate several diverse but minimal edits, each tied to one mechanism and one editable surface.

→
03 · gateProposal validation

Regression-test held-in and held-out tasks. Reject trade-offs; merge compatible winners.

Fixed throughout: model weights, evaluator, task protocol, non-editable runtime settings. Allowed to change: the surrounding harness.

This separation is the paper’s causal story: if only the harness changes, measured gains are attributable to that layer within the protocol.
Source: Figure 2; §§3.1–3.4.
Deep dive · stage 1
06 / 22

Don’t cluster symptoms. Cluster mechanisms.

A timeout, missing file or assertion failure is only the verifier’s surface-level verdict.

The evaluation system attributes the relevant agent behaviour and groups failures only when the verifier cause, causal status and reusable mechanism agree.

trace record

task · messages · tool calls · output · verifier outcome

“missing output”
“timeout”
“bad state”
→
failure signature φ(rᵢ)
cause · causal status · mechanism
evidence bundle

Recurring patterns, representative tasks, shared symptoms, verifier evidence and an actionable mechanism.

Design implication: failure mining must preserve enough trace provenance to justify a harness edit.
Source: §3.2.
Deep dive · stage 2
07 / 22

The proposer explores, but it doesn’t get a blank cheque.

The same fixed model is invoked in a proposer role with a bounded context.

Distinct branchesSeveral candidates should test different mechanisms or surfaces.

Minimal editsChange only what is needed; preserve unrelated behaviour.

Audit recordEach proposal names its target, surface, expected effect and risks.

Editable surfaces

prompt

bootstrap, execution, verification

tools

availability, adapters, schemas

runtime

loops, budgets, middleware

state

memory, recovery, persistence

The proposal stage is deliberately narrower than “redesign the agent”.

Practical test: if you can’t name the failure mechanism and the exact surface to edit, don’t propose the patch.
Source: §3.3.
Deep dive · stage 3
08 / 22

Promotion is conservative by design.

A candidate must improve at least one split without degrading the other.

Δin ≥ 0   and   Δho ≥ 0
and max(Δin, Δho) > 0

When evaluation is stochastic, the paper repeats candidate evaluation and applies the rule to aggregate pass counts.

accept

Better on held-in, no worse held-out.

Or better on held-out, no worse held-in. Compatible winners can be merged.

reject

Trade-off, invalid surface or failed evaluation.

Rejected candidates stay logged. The active harness does not change.

Why it matters: the gate is the paper’s defence against overfitting the proposer to the failures it has seen.

This is a promotion rule, not a guarantee of safety outside the measured protocol.
Source: §3.4; Algorithm 1.
Evidence · experimental design
09 / 22

Three models. Three agentic environments. One controlled comparison.

The model backend, tool set, budget, benchmark environment and evaluator stay fixed within each comparison.

terminal

Terminal-Bench 2.0

64-case fixed subset of containerised terminal tasks: artefacts, commands, verification and recovery.

software repair

SWE-bench Verified

100 cases: repository inspection, patch implementation and repository tests.

multi-app

AppWorld

180 examples: application APIs and state-based grading across workflows.

Models: MiniMax M2.5 · Qwen3.5-35B-A3B · GLM-5   |   Splits: held-in evidence + held-out regression gate   |   Metric: Pass (%) across two repeated attempts unless otherwise specified.

The paper reports within-model comparisons, not a ranking of model capability.
Source: §4.1; Appendix A.2.
Evidence · results
10 / 22

Every final harness improved both splits.

Across all nine model–benchmark combinations, the promoted harness beat or matched the starting harness on held-in and held-out performance.

9 / 9combinations improved overall
85.0%GLM-5 + AppWorld final overall pass
+40.6pplargest absolute overall gain
Qwen · AppWorld
+132%
GLM-5 · AppWorld
+40.6pp
Qwen · SWE-bench
+113%
MiniMax · Terminal
+28%
initial harness   Self-Harness final. Bars are pass rates; labels show the paper’s reported relative or absolute gain.
The headline result is broad within this test protocol, not universal proof of transfer.
Source: Table 1; §4.2.
Evidence · exact values
11 / 22

The gains show up on held-out tasks too.

Use the table as a calibration point: the largest improvements are concentrated in weaker starting harness/model combinations.

Benchmark · modelInitial inInitial outInitial overallFinal inFinal outFinal overall
Terminal-Bench 2.0
MiniMax M2.543.040.542.250.061.953.9
Qwen3.5-35B-A3B15.123.818.036.038.136.7
GLM-547.742.946.157.057.157.0
SWE-bench Verified
MiniMax M2.551.534.846.058.240.952.5
Qwen3.5-35B-A3B20.118.219.542.539.441.5
GLM-553.748.552.058.250.055.5
AppWorld
MiniMax M2.551.745.648.662.855.058.9
Qwen3.5-35B-A3B25.020.022.560.044.452.2
GLM-547.841.144.492.277.885.0
Pass rates are percentages. “In” = held-in; “out” = held-out.
Source: Table 1.
Evidence · mechanism, not magic
12 / 22

The retained edits are workflow interventions.

The paper reports targeted changes, not simply longer prompts.

MiniMax M2.5

Create earlier. Handle schemas. Stop loops.

Edits target missing required artefacts, structured tool content and stalled tool-use loops.

Qwen3.5

Precheck. Retry with discipline. Recover.

Edits target dependencies, repeated failed commands, exploration cycles and artefact recovery.

GLM-5

Persist state. Move to implementation.

Edits target environment persistence and the transition from exploration to testing.

Interpretation: the same base model family can benefit from different harness mechanisms because its failure patterns differ in context.

Evidence level: quantitative benchmark results plus qualitative trace/code analysis; no claim of general-purpose autonomy.
Source: §§4.3; Figures 4–9.
Evidence · what the controls buy you
13 / 22

Held-out regression is the difference between a patch and a reusable mechanism.

The proposer sees failure evidence from held-in tasks. Held-out tasks are kept behind the promotion gate.

visible to proposer

Held-in split

Trajectories, verifier outcomes and clustered failure evidence motivate the candidate.

↓
hidden from proposer

Held-out split

Regression gate checks whether the edit transfers without degrading unseen cases.

Still a bounded claim.

The paper says accepted edits may remain benchmark-specific. Higher-stakes changes need stronger gates than pass-rate non-regression.

This is the paper’s strongest practical lesson: self-improvement needs an externalised test boundary.
Source: §§3.4, 4.1–4.2; conclusion.
Section break · implementation
14 / 22

Build the smallest safe self-improvement loop.

You don’t need a frontier benchmark to borrow the pattern. You do need observable failures, declared edit surfaces and a promotion gate.

harnessversion OBSERVEPROPOSEGATE
Practical adaptation: the steps that follow are an implementation guide, not a reproduction claim.
Recommendation derived from the paper’s §§3–4.
How-to · step 1
15 / 22

Start with an evaluation substrate you can trust.

Before self-improvement, make agent behaviour measurable and replayable.

Task setFreeze representative tasks and a separate regression split.

VerifierReturn structured pass/fail reasons, not only a score.

Trace schemaStore task, messages, tool calls, outputs, state and verifier evidence.

RepeatabilityFix non-editable budgets, tools, environments and evaluator versions.

minimum record
{
  "task_id": "...",
  "harness_version": "h_003",
  "trace": { "messages": [], "tools": [] },
  "output": "...",
  "verifier": {
    "status": "fail",
    "cause": "missing_artifact",
    "evidence": "..."
  }
}
If you can’t explain why a task failed from the record, don’t let the model optimise from it.
Recommendation based on §§3.1–3.2 and §4.1.
How-to · step 2
16 / 22

Make the harness editable, bounded and reversible.

Put configuration points behind a versioned interface. The proposer edits declarations, not arbitrary production infrastructure.

promptInstructions

bootstrap, execution, verification, recovery

+
runtimeControl policies

loop breakers, message budgets, middleware

+
stateMemory + tools

sources, adapters, schemas, persistence

=
versionHarness hₜ

diffable, testable, rollback-ready

Promotion boundary: candidate edits are applied in an isolated branch, evaluated, then merged only after the gate passes. Keep every proposal and decision in an append-only lineage.

Paper analogue: a minimal DeepAgent-based harness with declared configuration points.
Source: Figure 3; §4.1. Implementation framing is adapted.
How-to · step 3
17 / 22

Turn traces into an evidence bundle.

Ask an analysis pass to find repeated, actionable mechanisms across failed runs.

Good pattern: “The agent repeatedly deletes or never creates the verifier-required artefact after a tool error.”

Weak pattern: “The agent timed out.”

1 · filter

Select failed records with verifier evidence.

2 · attribute

Separate terminal cause from agent-side behaviour.

3 · cluster

Group only when cause + causal status + mechanism agree.

4 · rank

Order by support and likely actionability.

Keep the evidence bundle separate from the edit: diagnosis should not silently prescribe the fix.
Source: §3.2; implementation framing is adapted.
How-to · step 4
18 / 22

Generate candidates in parallel. Promote them like code.

A proposal is a hypothesis about behaviour. Evaluation decides whether it becomes part of the harness.

proposeCandidate Δ₁

Target: missing artefact
Surface: bootstrap instruction

proposeCandidate Δ₂

Target: tool loop
Surface: runtime middleware

proposeCandidate Δ₃

Target: bad recovery
Surface: error policy

Evaluate each branch

Run current and candidate harnesses on the same held-in and held-out tasks. Record split-wise deltas, repeats, changed surfaces and decision.

Merge only compatible winners

If all candidates fail, keep hₜ. If several pass and don’t conflict, merge into hₜ₊₁. Log rejected branches for future analysis.

Treat the harness lineage as a testable artefact, not a hidden prompt file.
Source: §§3.3–3.4; Algorithm 1.
How-to · reference pseudocode
19 / 22

One implementation shape.

Keep the orchestration boring. The intelligence belongs in the evidence, proposal and verifier interfaces.

Important: this is a practical adaptation of the paper’s algorithm, not a drop-in library.

for round in rounds:
  baseline = evaluate(model, harness, tasks, verifier)
  evidence = mine_failures(baseline.failures)

  proposals = propose_parallel(
      model, harness, evidence,
      editable_surfaces, width=K)

  accepted = []
  for proposal in proposals:
    candidate = apply(harness, proposal.edit)
    result = evaluate(model, candidate, tasks, verifier)
    if non_regressive(result, baseline):
      accepted.append(proposal)
    else:
      log_rejection(proposal, result)

  harness = merge(harness, accepted)
  save_lineage(harness, accepted)
Implementation advice: make every function emit structured logs and versioned artefacts.
Source: Algorithm 1; adaptation for teaching.
How-to · where it fits
20 / 22

Where this pattern is useful.

Choose environments with repeatable tasks, meaningful verifiers and a harness you actually control.

coding agents

Repository repair and local tooling

Detect loops, missing patches, skipped tests or broken recovery. Promote narrow verification and runtime changes.

Example: a coding harness that learns to run the targeted test before declaring success.

research agents

Evidence and provenance workflows

Detect unsupported claims, missing citations or incomplete extraction. Promote provenance checks and source-of-truth retrieval.

Example: an agent that learns to attach a source note before finalising a literature brief.

ops agents

Tool-driven product operations

Detect stale state, repeated failed actions or partial writes. Promote confirmation, recovery and bounded retry policies.

Example: an agent that learns to re-read state after a write and stop after a fixed retry budget.

Not a fit yet: open-ended creative work without reliable verifiers, high-stakes changes without strong approval gates, or environments where traces contain sensitive data you can’t safely process.

Use-case examples are recommendations, not experiments reported by the paper.
Practical adaptation based on the paper’s mechanism and limitations.
Boundaries
21 / 22

Self-improvement is only as good as its boundary conditions.

The paper’s acceptance rule is useful, but it is not a complete safety case.

Benchmark overfitting

Accepted edits may encode benchmark-specific failure patterns. Add cross-domain, temporal or adversarial regression tasks.

Verifier weakness

A weak or gameable verifier can reward the wrong behaviour. Validate the evaluator independently.

Trace contamination

Proposer context can leak held-out information or sensitive data. Enforce split isolation and redaction.

Reversible promotion

Version every harness, keep rejected candidates, require approvals for high-impact surfaces and make rollback cheap.

Stronger gates

For consequential workflows, add invariants, human review, canary runs, policy checks and failure budgets.

Auditability

Store the evidence, proposal rationale, diff, evaluation repeats and accept/reject decision for every transition.

The paper itself says higher-stakes harness changes need stronger acceptance gates than pass-rate non-regression.
Source: conclusion; §§3.4 and 4.1.
Takeaways
22 / 22

Build agents that can learn from their own execution, with receipts.

The useful unit of progress is not a clever prompt. It’s a reversible, evidence-backed harness transition.

1

Observe behaviour

Record traces and verifier-grounded failure mechanisms.

2

Change the scaffold

Propose diverse, minimal edits to declared surfaces.

3

Earn promotion

Regress on what the proposer didn’t see. Keep the diff, evidence and decision.

Paper: arXiv:2606.09498v3 · Hangfan Zhang et al., Shanghai Artificial Intelligence Laboratory · PDF supplied for this deck.
A practical starting point: add a held-out regression gate to one agent harness you already own.
End of deck · use overview or arrow controls to revisit any slide.
← → navigate · O overview · F full screen