# HARNESS² Paper Notes: Recursive Agent Harnessing for an Open World Without Ground-Truth Verifiers


> **Paper**: *HARNESS²: Recursive Agent Harnessing for an Open World* ([arXiv:2610.14224v1](https://arxiv.org/abs/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**.

{{< kpi-grid cols="4" >}}
{{< kpi label="WorkBuddy-Bench (GLM-5)" value="+11.5 pts" tone="blue" >}}
A single step ($k=1$) lifts GLM-5 from 64.2 → 75.7, beating Gemini 3.5 Flash's base harness (72.4); $k=5$ reaches 79.6.
{{< /kpi >}}
{{< kpi label="LAB Legal Partial (GLM-5)" value="+11.8pp" tone="emerald" >}}
Single-step gain from 59.6% → 71.4%; parallel scaling ($k=5$) climbs further to 78.1%.
{{< /kpi >}}
{{< kpi label="Removing Skills (C6)" value="-5.3 pts" tone="rose" >}}
Largest ablation drop across all 8 components; removing all prompt components drops only -1.5 pts.
{{< /kpi >}}
{{< kpi label="Self-Edit (Opus 5)" value="+5.5 pts" tone="amber" >}}
Even Claude Opus 5 editing itself gains on JobBench (62.4 → 67.9), proving gains are not merely strong-to-weak distillation.
{{< /kpi >}}
{{< /kpi-grid >}}

---

## 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](../../ai-concept/harness-engineering/)). 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:

1. **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)**.
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** |

{{< admonition type="tip" title="Core Insight: From a Swiss Army Knife to a Craftsman + Tool Wall" >}}
Instead of cramming every domain rule into one static "Swiss Army knife" harness—bloating context and creating conflicting instructions—HARNESS² cultivates a **craftsman and a wall of proven tools** (the Improvement Harness and Library). Every new task starts on a clean workbench ($H_0$), selectively adapts verified tools via live contrast, and hangs only evidence-backed artifacts back on the wall.
{{< /admonition >}}

---

## 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:

{{< widget name="harness-components" title="Interactive Explorer: The 8 Editable Harness Components (C1–C8)" hint="Filter by cost tier or click any component to inspect its runtime role and ablation impact" >}}

In the runtime dataflow, these 8 components span Context Construction, Tool Interface, Orchestration, and Middleware Control around the frozen base model $M$:

{{< diagram desktop="diagrams/components-desktop.svg" mobile="diagrams/components-mobile.svg" caption="Figure 1 | Runtime architecture of the 8 editable execution harness components around frozen base model M." >}}

{{< fold "Three Static Validator Rules (Preventing Broken Harness Trees)" "warning" >}}
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:
1. **Explicit Skill Trigger Line**: Every `SKILL.md` must be named with its trigger condition in always-on text (`systemprompt.md` or `guardrails.md`), otherwise the model will never invoke it.
2. **No Jinja Delimiters in Always-On Text**: `{{` or statement tags are forbidden to prevent pre-run template rendering crashes.
3. **Self-Contained Scripts**: Every referenced script must ship inside the proposal, with skill-specific helpers placed under `skills/<skill-name>/scripts/`.
{{< /fold >}}

---

## 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):

{{< diagram desktop="diagrams/two-level-desktop.svg" mobile="diagrams/two-level-mobile.svg" caption="Figure 2 | Two-level recursive architecture of HARNESS²: inner behavioral contrast for the current task, outer reflection into the append-only library." >}}

### 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$:

{{< widget name="recursive-loop" title="Interactive Stepper: Two-Level Recursion (Producers Task1) + Budget Calculator" hint="Step through Step 0–4 to watch H₀ and Rₜ evolve, or slide k to compare Parallel vs. Sequential rollouts" >}}

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**):

{{< diagram desktop="diagrams/parallel-seq-desktop.svg" mobile="diagrams/parallel-seq-mobile.svg" caption="Figure 3 | Parallel vs. Sequential recursion at budget k = 3. Both consume 12 executor rollouts and feed into the same blind Final Selector." >}}

- **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.

{{< fold "Blind Selection Ceiling & Epistemic Boundaries" "abstract" >}}
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.
{{< /fold >}}

### 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`).

$$R_{t+1} = \mathrm{UPDATE}(R_t, H_t^*, D_t)$$

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

{{< image src="fig1-overall.png" caption="Figure 1 | Overall performance across WorkBuddy-Bench, JobBench, and LAB (original paper Figure 1)." >}}

| 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).

{{< image src="fig8-same-model.png" caption="Figure 8 | Same model as executor and editor (k = 2): consistent gains across all five models and three benchmarks (original paper Figure 8)." >}}

{{< image src="fig12-cross-model.png" caption="Figure 12 | Cross-model transfer: a harness refined for Gemini 3.5 Flash boosts GLM-5 across all WorkBuddy-Bench domains (original paper Figure 12)." >}}

### 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).

{{< image src="fig6-compute-pareto.png" caption="Figure 6 | Compute–performance Pareto trade-off on JobBench and WorkBuddy-Bench vs. offline Meta-Harness (original paper 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:

{{< image src="fig7-library-transfer.png" caption="Figure 7 | Harnessing-level recursion: direct one-shot editing from the library (left) and cross-benchmark JobBench → WorkBuddy transfer (right) (original paper Figure 7)." >}}

| 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

{{< image src="fig14-failure-cases.png" caption="Figure 14 | Nine failure cases in recursive harnessing, exposing blind-selection mistakes and shared-premise bias (original paper Figure 14)." >}}

{{< compare >}}
{{< compare-item title="Core Strengths" tone="emerald" >}}
- **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**.
{{< /compare-item >}}
{{< compare-item title="Unavoidable Limitations" tone="rose" >}}
- **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.
{{< /compare-item >}}
{{< /compare >}}

---

## 5. Three Engineering Takeaways to Apply Today

1. **Respect the Harness Cost Hierarchy — Stop Stuffing the System Prompt**: Reach first for on-demand `SKILL.md` files (with explicit trigger lines) and deterministic Python **Scripts**; isolate heavy-input investigations in **Subagents**; enforce unignorable rules via **Middleware Plugins** (e.g., `deliverable_watchdog.ts` injecting a warning directly into tool output after 25 calls with an empty `output/`); treat always-on prompts as a last resort.
2. **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*.
3. **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_BASE` otherwise), and label multi-edit ambiguity honestly as `confounded` or `NO_ENTRY` rather than polluting your team's knowledge base with fake causality.

