On this page
Paper: HARNESS²: Recursive Agent Harnessing for an Open World (arXiv:2610.14224v1) · Ruiyao Xu (Northwestern University), Yanfei Chen et al. (Google Cloud AI Research) · Oct 12, 2026 ·
github.com/google-research/harness2
As LLM agents move beyond coding into multi-file financial reconciliation, office deliverables, and high-stakes legal review, engineering teams hit two walls immediately: at deployment time there is no ground-truth verifier to guide harness edits, and task-specific patches tuned on one job quickly turn into distracting noise on the next.
HARNESS² from Google Cloud AI Research solves this by cleanly decoupling the Execution Harness (which solves the task) from the Improvement Harness (which learns how to improve harnesses). Every new task resets to a clean base harness $H_0$, customizes it on the fly through controlled behavioral contrast, and—after submission—distills only evidence-backed executable components and lessons into an append-only Harness Improvement Library.
1. Background: Two Walls of the Open World
Real-world agent performance follows a deceptively simple equation: $\text{Agent} = \text{Model} + \text{Harness}$ (see our earlier Harness Engineering overview). Even with frozen model weights, the surrounding execution harness—prompts, guardrails, memory, skills, tool guidance, deterministic scripts, subagents, and middleware—can make or break performance on the exact same task.
Moving harness Recursive Self-Improvement (RSI) from closed benchmarks into an open world (a non-repeating stream of unseen tasks) runs straight into two tightly coupled walls:
- No Ground-Truth Verifiers at Test Time: Offline harness optimizers (Meta-Harness, AHE) rely on training tasks and unit tests to ship one static harness that degrades under distribution shift. Blindly editing harnesses online without execution evidence is even worse—on WorkBuddy-Bench Code, direct editing without a library drops scores from 73.4 down to 63.2 (-10.2).
- Task-Specific RSI Fails to Generalize: Stateless test-time methods (Harness Scaling) discard everything after each task and repeat the same mistakes, while methods that carry over the patched execution harness directly (TTHE) pollute future tasks with single-case patches.
| Paradigm | Representative | Optimization Timing | Needs Ground Truth | Cross-Task Transfer | Open-World Limitation |
|---|---|---|---|---|---|
| Offline Search | Meta-Harness | Offline pre-deploy | Yes | Ships one static harness | Fails under unseen task distribution shifts |
| Stateless Test-Time | Harness Scaling | Online per task | No | None (restarts every task) | Repeats pitfalls; regresses easily without contrast |
| Carry-Over Harness | TTHE | Online batched | Proxy / tests | Inherits patched execution harness | Task-specific patches turn into noise on shift |
| Two-Level Recursion | HARNESS² (Ours) | Online per task | No (behavioral contrast) | Reset to $H_0$; grow Improvement Library | Customizes per task while accumulating verified craft |
2. The Editing Surface: 8 Components & Cost Tiers
To keep harness evolution auditable and reusable, HARNESS² exposes $K = 8$ editable file-level components, making every edit a clean file diff compatible with both OpenCode and Codex.
Explore the 8 components below—filter by always-on token tax, on-demand zero-idle components, or hard runtime hooks to inspect their ablation impact and real-world usage:
In the runtime dataflow, these 8 components span Context Construction, Tool Interface, Orchestration, and Middleware Control around the frozen base model $M$:
Before any proposed harness runs, a static validator rejects the entire proposal (falling back to the base harness after one retry) if any of three rules fail:
- Explicit Skill Trigger Line: Every
SKILL.mdmust be named with its trigger condition in always-on text (systemprompt.mdorguardrails.md), otherwise the model will never invoke it. - No Jinja Delimiters in Always-On Text:
{{or statement tags are forbidden to prevent pre-run template rendering crashes. - Self-Contained Scripts: Every referenced script must ship inside the proposal, with skill-specific helpers placed under
skills/<skill-name>/scripts/.
3. Core Architecture: Two-Level Recursion
Operating over a one-pass deployment stream, HARNESS² couples an inner Task-Level Recursion (starting from a clean $H_0$ while keeping the improvement harness $R_t$ frozen) with an outer Harnessing-Level Recursion (distilling verified artifacts into $R_{t+1}$ after submission):
3.1 Task-Level Recursion: Propose → Probe → Compose
HARNESS² structures each improvement step as a controlled A/B experiment: Propose (scoped editors) → Probe (controlled execution) → Compose (evidence-gated merge). Step through the real JobBench Producers task1 case study below (jumping from 43.1 → 77.8, +34.7 pts) and test the budget calculator for $k = 1\dots 5$:
Formally, one contrastive improvement step is defined as (Equation 1):
$$(H', e', \xi) = \Phi(q_t, H, E; R_t)$$Given task $q_t$, current harness $H$ (initially $H_0$), in-task history $E$, and frozen improvement harness $R_t$, $\Phi$ outputs the composed harness $H’$, its execution record $e’ = (\tau, y)$, and the step trace $\xi$. The Composer rejects speculative edits—dropping anything that causes empty deliverables and explicitly encouraging KEEP_BASE whenever trajectory contrast is weak.
3.2 Scaling Budget (k > 1): Parallel vs. Sequential Recursion
For larger test-time budgets ($k = 5$ in main experiments), HARNESS² offers Parallel and Sequential recursion with identical compute budgets at any $k$ (e.g., at $k = 3$, both spend 12 executor rollouts, 6 editors, and 3 composers):
- Parallel (Pool-and-Aggregate): Runs $k$ baselines into a shared pool $B$ so all $2k$ editors can separate systematic flaws from sampling noise, probes all $2k$ candidates into a shared evidence pool $P$, and lets $k$ independent Composers cross-pollinate under an anti-consensus directive (“Do not aim for the consensus answer — commit to the harness you can defend”).
- Sequential (Iterative Refinement): Chains $k$ rounds ($H_0 \to H^{(1)} \to \dots \to H^{(k)}$) so later rounds see on-policy checkpoint evidence and can rescue earlier ideas or roll back regressions. All traces and diffs stay mounted under
context/for on-demand file reads rather than overflowing the context window.
3.3 Final Blind Selector & Rendering Blind Spots
For $k > 1$, a Final Selector chooses one deliverable from anonymized, shuffled Markdown renderings (context/candidates/<random_id>.md) alongside context/task.md and context/source/, with complete isolation from harnesses, traces, and rubrics. It evaluates strictly in six priority tiers: Delivery → Conformance → Fidelity → Internal Consistency → Operational Fitness → Finish, and is explicitly told that choosing the unmodified baseline is valid.
Large spreadsheets are rendered to Markdown with truncation markers, and raw binary deliverables are not attached to the selector. The paper does not specify the exact candidate pool formula or spreadsheet renderer implementation (inferred: evaluated cell values are read to expose blank formulas).
Because the selector cannot run hidden unit tests, Figure 14 documents real failure cases: picking a cleaner-looking 55-point candidate over a 95-point one on WB-code, and selecting a 70-point WB-web candidate out of a pool where four others scored 100.
3.4 Harnessing-Level Recursion: Reflection & Safe Reuse
After submission, the Experience Reflector audits the full record $D_t$ under a strict anti-pollution rule: “The candidate selected by the blind judge is not the only evidence.” It outputs per-component <edits> attributions (helped, hurt, no observed effect, or confounded whenever simultaneous edits prevent clean attribution) and distills at most one transferable <experience> only when solid contrast exists (otherwise NO_ENTRY).
The library is domain-scoped and append-only, storing real executable harness trees (H*ₜ) plus EXPERIENCE.md and an index rather than prose summaries. On task $t+1$, editors must physically copy reused files into the workspace and treat any domain thresholds or column mappings inside them as hypotheses to be re-verified against the new baseline trace.
4. Key Experimental Results & Engineering Trade-Offs
Evaluated across three random task orderings on WorkBuddy-Bench (Code / Web / Office), JobBench (long-horizon multi-file projects), and LAB (Harvey legal benchmark, Partial pass rate) using frozen Gemini 3.5 Flash and GLM-5 executors under OpenCode and Codex:
4.1 Main Results & Baselines

| Representative Setup (OpenCode) | Base Harness | HARNESS² ($k=1$) | + Parallel ($k=5$) | Key Takeaway |
|---|---|---|---|---|
| WorkBuddy-Bench (GLM-5) | 64.2 | 75.7 (+11.5) | 79.6 (+3.9 more) | Single step beats Gemini 3.5 Flash base (72.4) |
| WorkBuddy-Bench (3.5 Flash) | 72.4 | 77.5 (+5.1) | 80.8 (+3.3 more) | Surpasses unmodified Claude Code across domains |
| JobBench (3.5 Flash) | 31.5 | 36.0 (+4.5) | 39.0 (+3.0 more) | Steady scaling on long-horizon projects |
| LAB Partial (GLM-5) | 59.6 | 71.4 (+11.8pp) | 78.1 (+6.7pp more) | Substantial gains on high-stakes legal review |
Without contrastive probing and a library, online baselines frequently regress: ReasoningBank drops up to -6.6 pts on coding, and un-scoped Harness Scaling underperforms the base harness in 7 of 12 benchmark setups.
4.2 Ablations: Skills & Scripts Dominate Prompts
Mechanism ablation (Table 3, $k=1$) confirms every pillar matters: removing the library drops -3.1 / -1.8 (WorkBuddy / JobBench), removing INV/DOM scoping drops -2.9 / -3.7, and skipping composition drops -1.6 / -1.9.
Component ablation (Table 6, $k=5$) delivers the sharpest practical lesson:
- Removing Skills (C6): -5.3 pts average drop (heaviest impact)
- Removing Scripts (C7): -3.7 pts average (-7.4 pts on Office!)
- Removing all Prompt components: only -1.5 pts average
4.3 Same-Model Self-Editing & Cross-Model Transfer
To rule out strong-editor distillation, Figure 8 evaluates same-model executor & editor ($k=2$) across five models up to Claude Opus 5—all five improve across all three benchmarks (GLM-5 +13.7 on LAB; Opus 5 +5.5 on JobBench). Meanwhile, Figure 12 shows harnesses refined for Flash transfer directly to GLM-5 (+17.3 pts on WB-code).


4.4 Compute Budget & The Production Escape Hatch
Full online HARNESS² is heavy: at $k=5$, WorkBuddy-Bench exceeds 10M tokens/task and JobBench exceeds 100M tokens/task—making full online loops unsuitable for low-latency chat, though still Pareto-superior to offline Meta-Harness (Figure 6).

Crucially, Direct Editing w/o Execution (Figure 7 left)—skipping baseline and probe rollouts entirely and assembling a one-shot edit from the accumulated library—recovers strong gains with minimal latency:

| Direct Online Editing (No Baseline/Probe, 3.5 Flash + OpenCode) | WB-code | WB-web | WB-office |
|---|---|---|---|
| Base harness | 73.4 | 69.9 | 74.0 |
| Blind edit w/o library | 63.2 (-10.2) | 65.0 (-4.9) | 77.1 (+3.1) |
| With $k=1$ library | 73.8 (+0.4) | 72.6 (+2.7) | 77.5 (+3.5) |
| With $k=5$ library | 74.3 (+0.9) | 74.3 (+4.4) | 79.1 (+5.1) |
4.5 Strengths vs. Real Limitations

- Positive expected value without verifiers: Avoids online regression and achieves a better compute–score Pareto frontier than offline Meta-Harness.
- Genuine cross-benchmark & cross-model transfer: JobBench library adds +2.9 pts to WorkBuddy Office; Flash harnesses lift GLM-5 Code by +17.3 pts.
- Heavy test-time compute & latency: 10M–100M tokens per task at $k=5$ restricts full online loops to asynchronous, high-value jobs.
- Blind-selection ceiling & shared bias: Truncated renderings can mislead the selector, and same-model candidates can share the same false premise.
- Unbounded library growth: Pure append-only storage lacks deduplication, retirement, and large-scale retrieval.
5. Three Engineering Takeaways to Apply Today
- Respect the Harness Cost Hierarchy — Stop Stuffing the System Prompt: Reach first for on-demand
SKILL.mdfiles (with explicit trigger lines) and deterministic Python Scripts; isolate heavy-input investigations in Subagents; enforce unignorable rules via Middleware Plugins (e.g.,deliverable_watchdog.tsinjecting a warning directly into tool output after 25 calls with an emptyoutput/); treat always-on prompts as a last resort. - Decouple Online Execution from Offline Library Growth: Keep production on a clean $H_0$, run expensive Propose-Probe-Compose asynchronously in the background on failed or high-value traces to store real executable files +
EXPERIENCE.md, and assemble lightweight one-shot edits online—always borrowing workflows while re-verifying workspace facts. - Tune Agents Like Controlled Experiments: Separate procedural/tool issues (INV) from domain rules (DOM), tie every edit to a concrete trajectory failure (defaulting to
KEEP_BASEotherwise), and label multi-edit ambiguity honestly asconfoundedorNO_ENTRYrather than polluting your team’s knowledge base with fake causality.
