AI agent harness: The setup around a model that decides how well it works
An agent harness is everything around an AI model: prompts, tools, memory and rules. Why the same model can succeed or fail depending on it, and why teams now let AI rewrite it.

An AI agent harness is everything that surrounds a language model when it works as an agent: the instructions it reads, the tools it can call, the memory it keeps and the rules that limit it. The model supplies the reasoning. The harness decides what the model sees, what it can do and when it stops.
The idea has moved from a niche engineering term to a research topic. Google Research recently open-sourced a framework that rewrites the harness automatically, as we reported.
The same driver, two very different cars
Picture a talented new employee on a first day. With no instructions, no login and no notes from yesterday, they will struggle. Give them a checklist, the right software, a shared folder of past work and a manager who reviews their output, and the same person performs far better.
The employee is the model. The checklist, software, folder and review are the harness. Nothing about the person changed, yet the results did.
That is why two products built on the same model can behave very differently. A chat window and a coding assistant may call the same model, but the assistant adds tools to read files, run tests and remember the project.
The moving parts inside the wrapper

A harness is a loop. The model reads its context, picks an action, the harness runs that action, and the result goes back into the context. This repeats until the task is done or something tells it to stop.
Around that loop sit the pieces a team can design:
- System prompt: standing instructions about role and style.
- Tools: what the agent can do, such as search the web, edit a file or run code.
- Memory: notes and logs that survive after the model’s limited working space fills up.
- Guardrails: rules about what is off limits.
- Subagents: helper agents that take a narrow piece of the job.
- Scripts and checks: automatic steps that test whether the work is right.
Each piece is usually plain text or ordinary code, so a person can read and change it. The model’s own weights, the numbers learned in training, stay untouched.
Why long jobs forced the idea into the open
The need became obvious with long tasks. In a post dated November 26, 2025, Anthropic engineer Justin Young described a basic problem: an agent works in separate sessions, and each new session starts with no memory of the last one.
Anthropic reported two failure patterns. The agent tried to build too much at once and ran out of working space mid-feature, leaving a half-finished mess. Or a later session saw some progress and declared the whole project done too early.
The fix was a better harness, not a better model. A first session sets up the environment and writes a feature list marking every feature as failing. Later sessions pick one feature, test it and leave clean notes.
The notes lived in ordinary files: a JSON feature list, a progress file called claude-progress.txt, a start-up script called init.sh and a history of small git commits. The authors chose JSON because the model was less likely to overwrite it carelessly than a Markdown file. They also called this one possible set of solutions, tuned for web app development.
When the harness itself becomes the thing being improved
If the harness matters this much, who writes it? Usually a person, once, and then it is reused for every task. Researchers now ask whether the agent can improve it.
Harness², described in our news story, is one answer. A model acting as editor proposes changes to the harness, tests them against the original and keeps what the comparison supports. What it learns carries over to later tasks. According to its README, it can edit eight components, including the prompt, memory, skills and subagents.
Other groups are working on the same theme. A paper submitted to arXiv on July 17, 2026 by Hyunin Lee, Matei Zaharia, Yujin Tang and colleagues, titled “Recursive Harness Self-Improvement”, treats the harness as a prompt-level description of the agent’s loop and refines it over several rounds. The authors report that a few rounds let agents set to low reasoning effort beat agents set to maximum effort, with up to 60% lower inference cost. Those figures come from 30 synthetic research tasks, so they are the authors’ own results on a narrow test.
Why a good harness does not last forever
A harness carries assumptions about what the model cannot do. As models improve, those assumptions go stale. In an April 8, 2026 post, Anthropic’s Lance Martin, Gabe Cemaj and Michael Cohen gave an example: a workaround that reset the agent’s working space helped with Sonnet 4.5 but was unnecessary with Opus 4.5. In their words, the resets had become dead weight.
There are other limits. Automated harness tuning costs money. A guide from the consultancy Wavect notes that each recursive configuration in Harness² implies several executor runs plus editor, composer, reflection and grading calls. It suggests judging cost per accepted result, not per attempt.
Safety is the second concern. Wavect reports that the research release does not restrict the executor’s network access and that Codex runs with its sandbox disabled. In one validation run an agent downloaded a grading rubric without being told to. The guide recommends isolated, disposable environments, and says a rules file such as guardrails.md is not a security boundary because the agent can edit it.
Finally, a bigger model may be doing part of the work. As our article notes, Harness² uses a frontier model as the editor, so gains for a weaker agent may partly reflect a stronger model writing its environment.
What to watch as harnesses become software that edits itself
Three questions will decide whether this approach spreads. First, do the gains hold when other teams repeat the experiments, using their own baselines rather than the authors’? Most reported numbers so far come from the groups that built the methods.
Second, can the improved harness be kept safe? A system allowed to rewrite its own instructions and scripts needs limits that live outside the files it can edit.
Third, how much of a harness is still needed as models get stronger? Anthropic’s own advice points toward harnesses that are expected to be rewritten, or removed, with each model generation.
For readers choosing between AI tools, the practical lesson is simple. When an agent seems unusually good or bad, the model may not be the main reason. The setup around it deserves a look too.
Sign Up for the Daily AI Pulse
One email a day. All the stories that matter.
By signing up, you agree to our Terms of Use and acknowledge the data practices in our Privacy Policy. You may unsubscribe at any time.
Daniel ReedAI Research, Safety & Ethics AnalystDaniel Reed currently works as an AI Research, Safety & Ethics Analyst at Aiholics, writing about how changes in artificial intelligence are affecting and will affect scholarship,…
You may also like

Claude Code subscription: Plans, prices and how to install it (2026)

How Walmart’s agent orchestration strategy is reshaping the future of retail AI

How Developers Are Harnessing Trae Agent to Automate Their Coding Tasks
