In the context of AI, a 'harness' refers to the infrastructure surrounding a large language model (LLM) that enables it to act as an autonomous agent. This includes components such as system prompts, guardrails, memory, tool guidance, subagents, skills, scripts, and plugins. Harness² is a framework developed by Google Research to automate the optimization of these components, a process the researchers call 'harnessing.' Unlike standard fine-tuning, Harness² keeps the underlying model weights fixed and instead focuses on iteratively improving the external system that guides the model's behavior.

Diagram showing eight harness components including system prompts, guardrails, memory, and skills.
The framework optimizes various harness components such as system prompts, memory, and tool guidance to improve agent behavior.github.com

This image illustrates the specific components of the 'harness' infrastructure that the Harness² framework is designed to optimize.

The framework operates through two distinct layers of recursion to handle 'open world' scenarios, where agents face tasks not explicitly accounted for during the initial design phase. The first layer is 'task-level recursion,' which uses a Propose–Probe–Compose cycle. An agent proposes edits to its own harness, probes the effects of those edits on the current task, and composes a refined version based on behavioral contrasts. The second layer is 'harnessing-level recursion,' which maintains a persistent 'improvement harness.' This layer captures lessons and evidence-supported improvements from completed tasks to guide the refinement of future tasks, allowing the system to learn from experience over time.

Flowchart of the Harness² pipeline showing task-level and harnessing-level recursion cycles.
The Harness² pipeline utilizes two layers of recursion to propose, probe, and compose improvements to the agent's execution system.github.com

This diagram explains the dual-layer recursive process (task-level and harnessing-level) described in the second paragraph.

Experimental results from the researchers indicate that Harness² can provide significant performance gains across professional benchmarks. For example, a single step of Harness² improved the GLM-5 and Gemini 3.5 Flash models, yielding gains of up to 11.5 points on WorkBuddy-Bench and 11.8 percentage points on the LAB partial pass rate. The framework supports both parallel recursion, which explores multiple candidate harnesses simultaneously to find the best composition, and sequential recursion, which carries a refined harness through successive steps for deeper optimization. While the framework provides a structured method for agent evolution, the researchers note that the system's effectiveness scales with the 'recursion budget'—the number of Propose–Probe–Compose steps allowed per task.

One notable technical constraint of the framework involves its execution environment. While the framework supports various executors like OpenCode and Codex, the researchers specify that the Codex executor runs with its sandbox disabled, and the executor network access is unrestricted. To mitigate risks during evaluation, users are advised to configure network restrictions before running benchmarks to prevent the agent from accessing public rubrics or grading criteria that could compromise the integrity of the results. The project is released under the Apache 2.0 license and is intended as a plug-and-play tool for developers looking to build more adaptable autonomous agents.

The official Harness² brand mark logo.
Harness² is a plug-and-play framework released by Google Research for autonomous agent optimization.github.com

The project logo identifies the framework discussed throughout the article.

One limitation of the current implementation is the reliance on the agent's own execution evidence to judge the success of a harness edit. Because the system does not rely on ground-truth feedback (external labels of 'correct' or 'incorrect'), it must rely on the behavioral contrasts between different harness configurations. This means the quality of the optimization is inherently tied to the agent's ability to accurately probe and interpret the consequences of its own proposed changes. Furthermore, while the framework is designed for 'open world' tasks, its performance remains dependent on the quality of the initial components and the depth of the recursion budget provided by the user.

Users can interact with the framework via a local demo that runs both recursion modes with deterministic editors and real Python executions. For model-backed benchmarks, the framework integrates with Vertex AI and requires specific dependencies like Docker for WorkBuddy-Bench or Pandoc and Poppler for the LAB benchmark. The results of these runs are automatically saved in a structured directory, providing task summaries, deliverables, and reflection notes that document the evolution of the harness components over time.