# AI use cases for Harness2 (google-research/harness2)

Repo: [google-research/harness2](https://github.com/google-research/harness2) | Use cases: 3 | Page: https://dedupedai.com/use-cases/google-research-harness2/

Harness² is a Python framework from Google Research that refines the harness around a fixed model (prompts, tools, memory, skills, orchestration) so it performs better on agent tasks.

This file holds every use case of this repo. Each one starts with a "## " heading and ends with its URL.

- Try both recursion modes locally with no credentials: https://dedupedai.com/use-cases/google-research-harness2/try-recursion-modes-locally-no-credentials/
- Refine an agent harness on a small LAB legal set: https://dedupedai.com/use-cases/google-research-harness2/refine-agent-harness-on-lab-legal-tasks/
- Compare recursion budgets on WorkBuddy-Bench code tasks: https://dedupedai.com/use-cases/google-research-harness2/compare-recursion-budgets-on-workbuddy-code/

## How to try both recursion modes locally with no credentials with Harness2

Repo: [google-research/harness2](https://github.com/google-research/harness2) | Difficulty: Intermediate | Time: 30 minutes | Basis: From the README

Run the bundled demo to see parallel and sequential harness refinement before spending any API budget.

**Who it is for:** A developer or researcher evaluating Harness² who wants to see how the two recursion modes behave before configuring any model access.

**The problem:** Setting up model-backed benchmarks takes time and costs money, so it is hard to judge the framework before committing.

**The outcome:** A completed local demo run under runs/demo that shows both recursion modes using deterministic editors and real Python executions.

### Steps

1. Create the environment with `uv venv --python 3.12 .venv`
2. Activate it with `source .venv/bin/activate`
3. Install the package with `uv pip install -e '.[render]'`
4. Run the demo with `harness2-demo --output runs/demo --k 2`
5. Review the results saved under runs/demo and compare the two recursion modes

### Prompt to paste into your agent

```text
In the google-research/harness2 repo on Linux with Python 3.12 and uv, create the environment, install with uv pip install -e '.[render]', and run harness2-demo --output runs/demo --k 2. Report the files written under runs/demo and summarize what each recursion mode produced. Verify that the run finished without model credentials being configured.
```

### Caveat

The demo uses deterministic editors, so its output shows how the modes run, not how well they perform on real benchmarks.

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/google-research-harness2/try-recursion-modes-locally-no-credentials/

## How to refine an agent harness on a small LAB legal set with Harness2

Repo: [google-research/harness2](https://github.com/google-research/harness2) | Difficulty: Advanced | Time: 2 hours | Basis: From the README

Run one Propose-Probe-Compose step on a single LAB legal domain, then judge and report the result.

**Who it is for:** A legal-tech or AI evaluation engineer who needs evidence on whether a harness refinement helps an agent on legal work before scaling up.

**The problem:** Judging whether a harness change helps requires running real model-backed tasks, which is expensive and easy to misconfigure.

**The outcome:** A judged and reported LAB run for one domain with a small task count, showing whether the refined harness improved results.

### Steps

1. Create the environment with `uv venv --python 3.12 .venv`, activate it, and install with `uv pip install -e '.[render]'`
2. Run `cp .env.example .env`, edit .env with your Vertex AI project and model IDs, then run `gcloud auth application-default login`
3. Install the LAB benchmark with `harness2-setup lab` and check it with `harness2-check --bench lab`
4. Run one task with `harness2 --bench lab --k 1 --mode parallel --only-domains antitrust-competition --max-tasks 1`; add --dry-run first to preview task selection without model calls (inferred, check the README)
5. Judge the run with `harness2-judge --bench lab --k 1 --mode parallel`
6. Generate the summary with `harness2-report --bench lab --k 1 --mode parallel`

### Prompt to paste into your agent

```text
In the google-research/harness2 repo, set up the LAB benchmark, then run harness2 --bench lab --k 1 --mode parallel --only-domains <domain> --max-tasks 1, followed by harness2-judge and harness2-report with the same flags. Report the judged result for the task and the path of the saved results under runs/. Verify that the judge and report commands used the same benchmark, k, mode, and domain as the refinement run.
```

### Caveat

Model-backed runs incur API costs, so start with the single task limit shown and keep the same flags across run, judge, and report.

Risk, credentials: The setup uses gcloud application-default login and a .env file with Vertex AI settings, so keep those credentials out of shared logs and commits.

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/google-research-harness2/refine-agent-harness-on-lab-legal-tasks/

## How to compare recursion budgets on WorkBuddy-Bench code tasks with Harness2

Repo: [google-research/harness2](https://github.com/google-research/harness2) | Difficulty: Advanced | Time: 3 hours | Basis: From the README

Run parallel and sequential refinement on the WorkBuddy code subset to see which recursion style helps more.

**Who it is for:** An AI agent researcher who needs to choose a recursion strategy for coding-style office tasks and wants a fair side-by-side comparison.

**The problem:** Parallel and sequential recursion trade breadth for depth, and the right choice depends on the benchmark and budget.

**The outcome:** Separate judged and reported runs for each recursion mode on the WorkBuddy code subset, using a distinct runs directory for each.

### Steps

1. Set up the environment with `uv venv --python 3.12 .venv`, `source .venv/bin/activate`, and `uv pip install -e '.[render]'`, then run `harness2-setup wb` (Docker must be installed)
2. Check the install with `harness2-check --bench wb` (inferred, check the README)
3. Run `harness2 --bench wb --subset code --k 2 --mode parallel` with HARNESS2_RUNS_DIR set to a new folder for this mode (inferred, check the README)
4. Run `harness2 --bench wb --subset code --k 2 --mode sequential` with a different HARNESS2_RUNS_DIR (inferred, check the README)
5. Judge and report each mode with `harness2-judge --bench wb --subset code --k 2 --mode <mode>` and `harness2-report --bench wb --subset code --k 2 --mode <mode>` (inferred, check the README)
6. Compare the two reports, keeping the same benchmark, subset, k, and seed for both

### Prompt to paste into your agent

```text
In the google-research/harness2 repo, install WorkBuddy-Bench with harness2-setup wb, then run the code subset in parallel and sequential mode with --k 2, using a separate HARNESS2_RUNS_DIR for each. Report the judged score for each mode and which one scored higher. Verify that both runs used the same subset, k, and seed.
```

### Caveat

The README says the executor has unrestricted network access and Codex runs with its sandbox disabled, so configure the network restrictions in the experiment guide before evaluation.

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/google-research-harness2/compare-recursion-budgets-on-workbuddy-code/
