Google's Harness² (Recursive Agent Harnessing for an Open World) is a free, open-source (Apache 2.0) framework from Google Cloud AI Research and Northwestern University. It keeps the underlying LLM completely frozen and instead optimizes the agent harness—its system prompts, long-term memory, tool guidance, scripts, and guardrails—via a two-level recursive loop (Propose–Probe–Compose + Experience Reflection) so coding agents compound their intelligence over time without ground-truth answer keys.
Harness² leaves foundation model weights 100% frozen and recursively optimizes eight modular agent harness surfaces across sessions.
1. The Core Shift: An AI Agent Is Model + Harness
Most teams blame the foundation model when a coding agent loops endlessly on a failing test or forgets repository conventions. In practice, an AI agent is two distinct layers: the frozen LLM (reasoning engine) and the harness (the runtime scaffolding of system prompts, memory, tool definitions, guardrails, and orchestration scripts).
2. How Harness² Works: Two-Level Recursion
The superscript "2" in Harness² stands for two-level recursive optimization—a design that lets an agent improve both its current task execution and its long-term operational playbook simultaneously.
Task-Level Recursion: Propose → Probe → Compose
- Propose: A harness editor inspects the current task and suggests targeted edits—updating instructions, adding domain-specific guardrails, or writing helper scripts.
- Probe: The agent executes the task across these candidate harness variations in parallel or sequence.
- Compose: The framework evaluates behavioral contrasts between executions, identifies which harness changes produced cleaner, more reliable outcomes, and merges them—without needing a pre-labeled ground-truth answer key.
Harnessing-Level Recursion: Experience Reflection
- Reflect: After a task completes, an experience reflector distills what worked and what failed across the execution trace.
- Persist: Those validated lessons are written back into the persistent improvement harness, so the next coding session starts smarter than the last.
3. The 8 Editable Harness Components
Rather than treating a coding agent as a single monolithic system prompt, Harness² decomposes the runtime into eight modular, machine-editable surfaces:
4. Declarative Agent Harnessing (YAML Blueprint)
To make recursive self-improvement auditable, teams pair Harness²-style loops with declarative YAML contracts. Instead of hidden prompt spaghetti, every editable surface is version-controlled:
harness:
name: coding-agent-v2
model: frozen-llm
recursion:
task_level: propose_probe_compose
harness_level: experience_reflector
editable_surfaces:
- system_prompts
- guardrails
- long_term_memory
- skills
- tool_guidance
- helper_scripts
- subagents
- plugins
verification:
require_behavioral_contrast: true
ground_truth_required: false
5. Why This Matters for E-E-A-T & Agentic Workflows
At WebFlur, we see the exact same architectural principle in Technical AI SEO and Agentic Workflows: raw model intelligence is commoditized, while structured, verifiable scaffolding wins. When your engineering or content systems expose clear schemas, reproducible scripts, and explicit provenance—as we build in our AI SEO solutions—both coding agents (like OpenCode, Codex, and Claude Code wrapped in Harness²) and AI search engines can verify and compound trust automatically.
Ready to make your stack agent-ready?
WebFlur helps technical B2B teams structure their content, schema, and entity authority for AI search and autonomous agents.
