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

Repo: [google-research/harness2](https://github.com/google-research/harness2) | Use cases: 7 | 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/
- Refine a Codex-based agent harness on office tasks: https://dedupedai.com/use-cases/google-research-harness2/refine-a-codex-harness-on-office-tasks/
- Compare parallel and sequential recursion on JobBench: https://dedupedai.com/use-cases/google-research-harness2/compare-parallel-and-sequential-recursion/
- Run harness refinement with the Codex executor: https://dedupedai.com/use-cases/google-research-harness2/swap-codex-executor-into-agent-loop/
- Resume a long refinement run after it stops midway: https://dedupedai.com/use-cases/google-research-harness2/resume-interrupted-multi-task-refinement-run/

## 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/

## How to refine a Codex-based agent harness on office tasks with Harness2

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

Run Harness2 with the Codex executor on the WorkBuddy-Bench office subset to improve the harness around the model.

**Who it is for:** An agent researcher who wants to see whether recursive harnessing helps Codex on office work.

**The problem:** Hand-tuning prompts, tools and memory for an agent on unseen tasks is slow and unprincipled.

**The outcome:** A refined harness and evaluation results for office tasks, saved under runs/ with adopted harnesses and lessons.

### Steps

1. Install with `uv venv --python 3.12 .venv` and `uv pip install -e '.[render]'`
2. Set up the benchmark with `harness2-setup wb` (WorkBuddy needs Docker)
3. Preview the task selection with --dry-run before spending on model calls
4. Run Harness2 with --bench wb, --subset office, --k 1 and --substrate cx to use Codex
5. Read the task summaries, adopted harnesses and evaluation results under runs/

### Prompt to paste into your agent

```text
Using google-research/harness2, set up WorkBuddy-Bench, dry-run a small office subset selection, then run one Propose-Probe-Compose step with the Codex executor and summarize what the adopted harness changed.
```

### Caveat

Executor network access is unrestricted and Codex runs with its sandbox disabled, so configure network restrictions before evaluating.

Risk, credentials: Model-backed runs use your Vertex AI project and incur API costs; start with a small task selection.

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-a-codex-harness-on-office-tasks/

## How to compare parallel and sequential recursion on JobBench with Harness2

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

Run the same JobBench tasks with parallel and sequential recursion to see which refines your harness better.

**Who it is for:** A researcher deciding whether to explore wider or refine deeper for their agent.

**The problem:** Without a controlled comparison you cannot tell whether more candidates or more refinement steps help.

**The outcome:** Results for both modes on the same tasks, resumable, with a clear view of which mode gained more.

### Steps

1. Install Harness2 and configure .env with your model IDs, then `gcloud auth application-default login`
2. Set up JobBench with `harness2-setup jb`
3. Run Harness2 on --bench jb with --k 3 --mode parallel on a small task set
4. Run the same tasks with --k 3 --mode sequential, using a new HARNESS2_RUNS_DIR
5. Compare the evaluation results and the lessons retained by harnessing-level recursion

### Prompt to paste into your agent

```text
With google-research/harness2, run the same five JobBench tasks with k=3 in parallel mode and in sequential mode, keep the runs in separate directories, and give me a table comparing scores and cost.
```

### Caveat

Model-backed runs cost money; use --dry-run first and repeat the same command to resume an interrupted run.

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-parallel-and-sequential-recursion/

## Harness2 with Codex: swap the executor from OpenCode to Codex

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

Switch from the default OpenCode executor to Codex to see how the executor changes refined-harness results.

**Who it is for:** Developer who already uses Codex as a coding agent and wants harness improvements tuned to that executor

**The problem:** Harness edits that help one executor may not carry over to another, and you have no way to check without a controlled run.

**The outcome:** A refinement run on Codex whose results are stored separately so you can compare it against an OpenCode run.

### Steps

1. Read the Codex executor section in docs/SETUP.md and finish its prerequisites.
2. Install a benchmark: harness2-setup jb
3. Run with Codex: Harness2 --bench jb --k 1 --mode parallel --substrate cx --max-tasks 1
4. Use a fresh HARNESS2_RUNS_DIR when changing models or task selection.
5. Judge and report with matching flags: harness2-judge --bench jb --k 1 --mode parallel --substrate cx

### Prompt to paste into your agent

```text
In google-research/harness2, run one JobBench task with --substrate cx and --k 1 --mode parallel, then judge it with matching flags. Verify the run completes under its own runs directory and that network restrictions are configured first.
```

### Caveat

Codex runs with its sandbox disabled and executors get open web access, so run it only in an isolated environment, and confirm whether judge and report also need the substrate flag in the experiment guide.

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/swap-codex-executor-into-agent-loop/

## How to resume a long refinement run after it stops midway with Harness2

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

Re-issue the same command to continue a multi-task run without redoing finished tasks.

**Who it is for:** Researcher running a larger JobBench or LAB sweep that was interrupted by a crash or quota limit

**The problem:** Long model-backed runs cost money, and restarting from scratch after an interruption wastes both time and API spend.

**The outcome:** A completed run that picked up where it stopped, with results kept under the same runs directory.

### Steps

1. Note the exact command you used, including --bench, --k, --mode, any subset flags and seed.
2. Re-run the identical Harness2 command to resume.
3. Use a new HARNESS2_RUNS_DIR only if you changed models or task selection.
4. Run harness2-judge and harness2-report with the same flags once refinement finishes.
5. Check each command's --help for extra options.

### Prompt to paste into your agent

```text
My google-research/harness2 run on <benchmark> stopped partway. Reconstruct the exact original command, re-run it to resume, and verify that previously finished tasks were not repeated by checking the runs/ folder.
```

### Caveat

Resume only works when you repeat the same benchmark, executor, subset, --k, --mode and seed, and changing models or task selection requires a new HARNESS2_RUNS_DIR.

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/resume-interrupted-multi-task-refinement-run/
