Make your AI agent improve itself. Free and open source, from Google Research
Harness² (say "Harness 2") is a free, open-source tool from Google Research. You give your AI agent a task. Harness² tries the same task with different setups, compares the results and keeps the best setup. Then it saves the lessons for the next task. Google calls this recursive self-improvement. Here are the links and the setup steps from my reel.
The code, the website and the research paper are free. If you want to see how it works first, open the website.
1
Harness² on GitHub
Google Research · Apache 2.0 license · more than 26,000 stars on GitHub
This is the full tool. A harness is the setup around an AI model: the prompts, tools, memory, skills and more. Harness² changes this setup. The AI model itself stays the same. For each task, Harness² tries changes on the same task, compares the results and keeps the changes that work. After each task, it keeps the best setup and the lessons for the next tasks.
Good to know: it is a research tool. It runs on Linux with Python 3.12. Real tasks use a paid AI model.
Still from my reel: an animation by Nick Saraev. It shows the idea. It is not a screen from the tool. One task runs with four setups: new instructions, new memory, new tools and new skills.Open Harness² on GitHub
2
The Harness² website
harness2.github.io · animations of the method and the test results
The website shows the method step by step, with animations that you can play. It shows the eight parts of the setup that Harness² can change. They are the system prompt, guardrails (rules for the agent), memory, tool guidance, subagents (helper agents), skills, scripts and plugins. It also shows the test results. Google Research tested it on three benchmarks (sets of test tasks). One Harness² step gave gains of up to 11.5 points on WorkBuddy-Bench and 4.5 points on JobBench. On LAB, the gain was up to 11.8 percentage points.
Still from my reel, from the overview video by Google Research. When Harness² tries more setups for each task (k from 1 to 5), the code score goes up by 4.3 points, to 80.8.Open the Harness² website
3
The research paper
arXiv 2610.14224 · Ruiyao Xu, Yanfei Chen and the team
The paper gives the full method and all the test results. Harness² has two loops. The first loop improves the setup for the current task. The second loop keeps the best setups and the lessons. It uses them to improve the setup of the next task.
One prompt to install Harness² and run the free demo
Open your AI agent, for example Codex or Claude Code, in an empty folder on a Linux computer. Copy this prompt and paste it.
Prompt
Install Harness² from Google Research on this Linux computer. Then run its free demo.
Code: https://github.com/google-research/harness2
1. Check that this computer has Python 3.12 and uv. If it does not have uv, install it from https://docs.astral.sh/uv/getting-started/installation/
2. Download the code with git clone. Open the harness2 folder.
3. Run these commands in this order:
uv venv --python 3.12 .venv
source .venv/bin/activate
uv pip install -e '.[render]'
harness2-demo --output runs/demo --k 2
4. Do not add API keys. Do not run a benchmark. The demo needs no AI model account.
5. When the demo stops, tell me what it did in 5 short lines. Show me where it saved the results.
Try Harness² by hand in 5 steps
1
Check your computer
Use Linux with Python 3.12 and uv. uv is a free tool that installs Python packages. The setup guide shows the commands for Debian and Ubuntu.
2
Download the code
In a terminal, run git clone https://github.com/google-research/harness2.git. Then open the folder: cd harness2.
3
Install Harness²
Make a virtual environment (a separate space for the Python packages): uv venv --python 3.12 .venv. Activate it: source .venv/bin/activate. Then install Harness²: uv pip install -e '.[render]'.
4
Run the free demo
Run harness2-demo --output runs/demo --k 2. The demo shows both modes, parallel and sequential, with real Python runs. It needs no AI model account.
5
Connect a model for real tasks
Install Node.js 20 or newer and the Google Cloud CLI. Copy .env.example to .env. Add your Vertex AI project and model IDs to .env. Sign in with gcloud auth application-default login. Real tasks cost money, so start with one small task.
Questions people ask
Is Harness² free?
Yes. The code is free and open source under the Apache 2.0 license. The demo needs no AI model account. Real tasks call a paid AI model, so they cost money. Start with one small task.
Which AI agents does Harness² work with?
This release uses OpenCode or Codex to do the work. OpenCode is the default. To use Codex, add --substrate cx to the command. The default setup uses Gemini models on Vertex AI, the AI service of Google Cloud. Open the Harness² setup guide
Does Harness² run on Windows or Mac?
The makers say to use Linux with Python 3.12. The setup guide does not give steps for Windows or Mac.
Is Harness² an official Google product?
No. Researchers at Google Cloud AI Research and Northwestern University made it. The code is on the Google Research GitHub page. The README says that it is not an officially supported Google product. It is a research tool.
Want AI set up like this for your business?We build AI setups and run ads for businesses.
Researchers at Google Cloud AI Research and Northwestern University made Harness² (github.com/google-research/harness2). The authors are Ruiyao Xu, Yanfei Chen, Zhongying CuiZhu, Bhavana Dalvi Mishra, Yifei Ming, Han Yu, Rujun Han, Chen-Yu Lee and Tomas Pfister. The code uses the Apache 2.0 license. B-roll in my reel: Google Research (the project site, video and setup GIF) and Nick Saraev (@nick_saraev). All credit to them.