Google Research has just open-sourced Harness²: a recursive agent harness optimization framework
Two open-world problems Harness² addresses
1. At test time, the tasks are unseen and there is no ground-truth verifier. When editing a harness online, you don't know whether the answer is correct, so you cannot use "did the score go up?" to guide edits.
2. Recursive self-improvement (RSI) is usually task-specific, so it fails when the task changes and cannot generalize or accumulate.
Open-source repository: https://github.com/google-research/harness2
Core mechanism: two layers of recursion
Layer 1: task-level recursion, Propose–Probe–Compose (a contrastive improvement loop)
· Propose: First run a reference execution of the current harness. Note that this execution reveals "how the harness behaves", not "whether the deliverable is correct". Based on the task, the reference trajectory, and history, propose two candidate harnesses: one targeting cross-domain general agent deficiencies (planning, tool use, context management, delegation), and one targeting domain knowledge, procedures, and constraints of the current domain. Each candidate is a directly executable file-level edit.
· Probe: The two candidates are executed on the same task under the same model and environment conditions, and their behavior is compared against the reference execution: did the edit mitigate the targeted deficiency, have no effect, or cause a regression? The paper explicitly states that these comparisons "only inform subsequent composition, not verify task correctness."
· Compose: Read the reference execution, the two candidates, their diffs, and all execution evidence, and selectively build the successor harness: merge edits supported by evidence, revise conflicting ones, adopt one of them, or keep the original. Each decision must be tied to a specific observation, not a hypothesized score gain.
This step is the key innovation of the work: without a standard answer, it uses "same-task A/B behavioral comparison" in place of score feedback to guide edits, sidestepping the deadlock of having no verifier in open-world settings.
Layer 2: harnessing-level recursion, a continuously improving improvement harness
After each task finishes, the framework reflects on the complete improvement record and writes the adopted harnesses and evidence-supported lessons into a persistent library organized by domain. There are three key points:
· Lessons are retained only when supported by execution comparisons. Selecting a good output once does not make it transferable.
· The library stores executable component files rather than prose summaries, accompanied by an EXPERIENCE.md recording applicability scenarios and evidence.
· The next task still starts from the common base harness (the execution harness is not inherited), but Propose/Probe/Compose are guided by the updated library. In other words, "the improvement harness itself" is also being improved, which is the dual meaning of Harness² in the title.
Two scaling modes: parallel (probing k candidate sets simultaneously, with k independent composition sessions) and sequential (k-step chained refinement, carrying accumulated evidence step by step). Both modes improve monotonically from k=1 to 5.
Eight editable components, grouped by function
· Context construction: system prompt, guardrails, memory; takes effect on every call
· Tool interface: tool guidance, Skills; Skills load on demand and incur no cost otherwise
· Orchestration: subagents, the only component that increases the reasoning context
· Scripts: new deterministic capabilities, which execute rather than reason
· Plugins: TypeScript middleware, which "enforces a behavior within the tool loop rather than instructing it"
Main results (k=1 single step, editor is Claude Opus 4.8)
WorkBuddy-Bench
· Gemini 3.5 Flash: +5.1 (OpenCode)
· GLM-5: +11.5 (OpenCode, 64.2→75.7)
JobBench
· Gemini 3.5 Flash: +4.5 (OpenCode)
· GLM-5: +3.6 (OpenCode)
LAB partial pass rate
· Gemini 3.5 Flash: +4.0 (Codex)
· GLM-5: +11.8 (OpenCode, 59.6→71.4)
Notable findings:
· The weaker the execution model, the greater the benefit. GLM-5 with the improved harness surpassed Gemini's baseline score, so "swapping the harness" in some scenarios can rival "swapping the model."
· The improved harness transfers across models (a harness refined for Gemini gave GLM-5 +17.3 on the Code subset), and it also outperforms the fixed production harnesses of Claude Code and Codex by 4.6–5.8 points.
· Using the same model as both executor and editor still yields gains (GLM-5 self-editing gives +13.7 on LAB), showing that it does not depend on a stronger "teacher" model.
· Library ablation: removing the library costs 3.1 points on WorkBuddy-Bench, validating the value of harnessing-level recursion. The library also transfers across benchmarks (a library from JobBench still yields +0.6 to +2.9 on WorkBuddy-Bench).
