Google Cloud AI Research has open-sourced Harness², a framework designed to automate the recursive self-improvement of AI agent scaffolding without modifying underlying model weights. Released under the Apache-2.0 license, the repository provides tools to optimize prompts, tools, memory, skills, and orchestration across open-world tasks where no ground-truth answer keys or verifiers exist.
Decoupling Agent Scaffolding from Model Weights
An autonomous agent's performance depends heavily on its execution harness: the operational scaffolding surrounding a base large language model. This harness dictates how context is assembled, how tools are invoked, and how multi-step reasoning is coordinated. While prior recursive self-improvement (RSI) approaches focus on offline prompt tuning or supervised reinforcement learning against fixed unit tests, they struggle in open-world environments where incoming tasks are novel and lack automated evaluation rubrics.
Harness² addresses this limitation by decomposing the agent harness into eight modular, file-level components:
- System Prompt: Core persona and operating constraints.
- Guardrails: Output validation and safety checks.
- Memory: Cross-session state and factual retrieval.
- Skills: Procedural playbooks and task-specific workflows.
- Tool Guidance: Interface definitions and invocation schemas.
- Scripts: Deterministic helper utilities.
- Subagents: Delegation routines and parallel worker configurations.
- Plugins: Middleware controlling runtime execution loops.

Two-Tier Recursive Architecture
Harness² structures agent optimization across two interconnected feedback loops:
1. Task-Level Recursion
To refine an agent during an active task without ground-truth labels, Harness² implements a contrastive Propose–Probe–Compose workflow:
- Propose: The editor inspects a reference execution and proposes two candidate harnesses. One candidate introduces invariant edits targeting general agentic capabilities (planning, context management, delegation), while the other introduces domain-specific edits (task rules, domain conventions).
- Probe: Both candidate harnesses execute the task in parallel. The system contrasts their runtime trajectories and intermediate outputs against the reference run to identify behavioral differences and regressions.
- Compose: An editor analyzes the contrastive execution evidence, selectively merging beneficial modifications into an updated successor harness.
The task-level loop supports two scaling modes controlled by a recursion budget parameter (k):
- Parallel Recursion: Probes k invariant and k domain candidates simultaneously, composing successor configurations across aggregated execution traces.
- Sequential Recursion: Chains k iterative refinement steps, carrying forward cumulative execution history.
2. Harnessing-Level Recursion
Rather than forcing future tasks to inherit heavily overfitted execution harnesses, Harness² updates a continual improvement library after each task completes. An experience reflection module evaluates which harness edits succeeded and why, logging structured operational lessons into EXPERIENCE.md files alongside the adopted harness tree.
When a new task begins, the agent starts from a clean baseline harness but draws on the accumulated improvement library to inform proposal generation and composition decisions.
Benchmark Results and Implementations
Google evaluated Harness² across three professional benchmark suites using frozen executor models, including Gemini 3.5 Flash and GLM-5, running on OpenCode and Codex execution substrates:
- WorkBuddy-Bench (Office, Web, and Code Tasks): A single Harness² refinement step (k=1) improved performance across all tested configurations, with parallel recursion (k=5) producing gains of up to 11.5 points over base harnesses and outperforming offline optimization baselines like Meta-Harness.
- JobBench (Professional Workflows): Delivered gains of up to 4.5 points on complex multi-step job tasks.
- Legal Analysis Benchmark (LAB): Increased the per-criterion partial pass rate by up to 11.8 percentage points.
The public release includes benchmark integration scripts for JobBench, LAB, and WorkBuddy-Bench, support for OpenCode and Codex execution engines, and a deterministic local execution demo that runs without cloud API credentials.









