# google-research/harness2

> harness2 is a plug-and-play framework for recursive agent harnessing, which improves the system around a model that acts as an agent, such as its prompts, tools, memory and skills, on tasks unseen when that system was designed. It keeps the model weights fixed and refines the harness for each task by proposing edits, probing their effects on the same task, and composing a refined harness from the behavioral differences between executions, without ground-truth feedback. The project is written in Python.

Source: https://github.com/google-research/harness2
Indexed: commit 1cfe254 on 2026-10-18 by Repowise. Facts come from the source and git history, not from the maintainer.

## Facts

- Type: App
- Language: Python
- Stars: 24,289 at index time
- License: Apache-2.0
- Code health: 7.9/10, Good
- Last commit: 2026-10-09
- Contributors: 2

## Install

From the README: https://github.com/google-research/harness2#install

Clone the harness2 repository.
    git clone https://github.com/google-research/harness2.git

Move into the harness2 folder.
    cd harness2

Create a virtual environment with Python 3.12 in the repository root.
    uv venv --python 3.12 .venv

Activate the virtual environment.
    source .venv/bin/activate

Run the local demo, which runs both recursion modes with deterministic editors and needs no model credentials.
    harness2-demo --output runs/demo --k 2

## How it works

Commands enter through the entry points in harness2/cli, such as harness2-check, harness2-demo and harness2-judge, which read command-line arguments and build shared adapters and run identities. harness2/substrate adapts each benchmark's harness tree into a common interface, turning a spec into a staged Install and then executing it and reading the trajectory output back. harness2/core takes an evidence-backed run and combines task views and per-channel configuration with an adapter-driven scoring step to produce structured judging results. third_party/lab_runner/adapt_runs_cx converts LAB session files into parsed summaries and an ordered transcript for later components. The scripts directory holds checks and small transformations that keep the repository in a known-good state and write results or pass/fail messages. Results are saved under runs/, so repeating the same command resumes the run.

- harness2/__init__.py: entry point
- harness2/cli/bridge.py: entry point
- harness2/cli/check.py: entry point
- harness2/cli/demo.py: entry point
- harness2/cli/judge.py: entry point
Modules: harness2, third_party, scripts, tests. 94 files, 13,377 lines, 878 symbols.

## Code health

- Score: 7.9/10 (Good)
- Rank: not ranked (leaderboards need 100+ files)
- Hotspots: none
- Lowest file: harness2/core/schedule.py
- Dead code: 1 findings

## Maintenance

- Last commit 2026-10-09, first commit 2026-10-08, 3 commits
- 2 contributors, bus factor 1

## Security

- Security findings are shown to signed-in users at https://repowise.dev/repo/google-research/harness2/security

## More

- Page: https://repowise.dev/repo/google-research/harness2
- Ask this codebase: https://repowise.dev/repo/google-research/harness2/chat
- Docs: https://repowise.dev/repo/google-research/harness2/docs
- MCP (signs in with Repowise on first use):
    claude mcp add --transport http repowise https://api.repowise.dev/mcp/google-research/harness2
