Section 1 How a harness works
An AI coding agent is two things: a model and a harness. The model is the AI that reads and writes text. The harness is everything else: the loop that keeps it working, the tools it can use, what it reads on every step, the safety rules, the checks, and when it stops.
People usually talk about the model. But in 2026, study after study found that the harness changes the cost of a run a lot, sometimes changes who wins a comparison, and decides whether the result can be trusted.
This guide explains the whole harness from A to Z, in plain words, with real code and real numbers. You do not need to know anything about agents to read it. Every term is explained the first time it appears, and there is a glossary at the end.
How to read this guide
- Parts 1 to 5 explain how a harness works: the loop, the code, what the model reads, and tool calls.
- Parts 6 to 14 go through each part of a harness one at a time.
- Parts 15 to 20 cover what research has found: what matters, what makes a harness efficient, and what is still unknown. Part 21 is a glossary.
- Small examples marked (made-up example) are invented to teach an idea. Every other number comes from a paper or report listed in the Sources.
1. Three words: model, harness, agent
- Model: the AI that reads text and writes text. Claude, GPT and Qwen are models. A model cannot open a file, run a command or remember anything between calls. It only reads what it is given and writes a reply.
- Harness: the program around the model. It decides what the model reads, runs the commands the model asks for, keeps the record of what happened, checks the work, and decides when to stop. Some people call it a scaffold.
- Agent: a model plus a harness, working step by step until a task is done.
Agent = Model + Harness. Same model, different harness, different agent.
The harness has layers
For a coding tool like Claude Code, there are really two harness layers around the model:
┌──────────────────────────────────────────────────────────┐
│ YOUR HARNESS (you build it for your project) │
│ rule files, settings, extra tools, tests, checks │
│ ┌──────────────────────────────────────────────────┐ │
│ │ THE TOOL'S HARNESS (built by the tool's makers)│ │
│ │ the loop, built-in instructions, built-in tools │ │
│ │ ┌──────────────────────────────────────────┐ │ │
│ │ │ MODEL (built by the AI company) │ │ │
│ │ └──────────────────────────────────────────┘ │ │
│ └──────────────────────────────────────────────────┘ │
└──────────────────────────────────────────────────────────┘
- The tool's harness comes with the tool you install. In Claude Code, the loop and the built-in instructions are inside the program; you cannot rewrite them.
- Your harness is what you add around it for your own project: a rules file, a settings file, extra tools, your tests. You fully control this layer.
- In open-source harnesses (mini-swe-agent, OpenHands, OpenCode), you can edit the middle layer too, because the code is open. That is why most research experiments use them.
This layered picture comes from Birgitta Böckeler's article on harness engineering (see Sources).
2. The agent loop
Every agent, from a 100-line script to Claude Code, repeats the same four steps.
┌──────────────────────┐ ┌──────────────────────┐ ┌──────────────────────┐
│ 1. Build the request │ ───▶ │ 2. Call the model │ ───▶ │ 3. Check and run │
│ tools, instructions, │ │ it asks for a tool, │ │ safety check, then │
│ task, history │ │ or says it is done │ │ run the tool │
└──────────────────────┘ └──────────────────────┘ └──────────────────────┘
▲ │
│ ▼
┌──────────────────────┐ ┌──────────────────────┐
│ Done? │ ◀───────────────────────────────── │ 4. Add the result │
│ no: go again │ │ add it to the history│
│ yes: hand in the fix │ └──────────────────────┘
└──────────────────────┘
The model never touches the computer. It only asks. The harness acts.
One turn of the loop, for real
The task is a real Django bug: "floatformat loses precision for Decimal numbers."
- Build the request. The harness puts together the list of tools, its instructions, and the bug report.
- Call the model. The model replies:
use bash: grep -rn "floatformat" django/. (grepis a command that finds a word in every file of a folder.) - Check and run. The harness checks the command is allowed, then runs it.
- Add the result. grep prints
django/template/defaultfilters.py:95: def floatformat(...). The harness adds both the model's request and this output to the history, which is the running record of the run. - Done? Not yet. Back to step 1. The next request now includes the history, so the model knows where the function is.
The model decided to search because of what it read: the bug report names floatformat, its instructions say "find the code, fix it, run the tests", and its tool list includes bash. If its tool list had a web-search tool, it might have searched the internet instead. The tools you give an agent change what it tries first, not just what it can do.
3. The whole loop in 85 lines of Python
Here is a complete, working coding agent. It talks to any model server that accepts OpenAI-style requests (for example llama.cpp or vLLM). Read run_agent first; it calls everything else.
# mini_agent.py: a minimal coding agent, written top down
import json, os, subprocess
from openai import OpenAI # any OpenAI-compatible server: llama.cpp, vLLM, OpenRouter
client = OpenAI(base_url=os.environ.get("BASE_URL", "http://localhost:8080/v1"),
api_key=os.environ.get("API_KEY", "none"))
MODEL = os.environ.get("MODEL", "qwen3.8-27b")
# ---------- 1. The loop: read this first ----------
def run_agent(task, workdir, step_limit=30, log_path="run.jsonl"):
messages = [{"role": "system", "content": SYSTEM.format(workdir=workdir)},
{"role": "user", "content": task}]
with open(log_path, "w") as log:
for step in range(1, step_limit + 1):
reply = call_model(messages) # 2. ask the model
messages.append(reply["message"]) # keep its turn in the history
record(log, step, reply) # 6. recorder
calls = reply["message"].get("tool_calls") or []
if not calls: # no tool call: nudge it
messages.append({"role": "user", "content": "Use a tool, or call submit."})
continue
for call in calls:
name = call["function"]["name"]
args = json.loads(call["function"]["arguments"] or "{}")
if name == "submit": # 5. stopping rule
return {"status": "submitted", "steps": step}
output = run_tool(name, args, workdir) # 3. guards + tools
messages.append({"role": "tool", "tool_call_id": call["id"],
"content": cut(output)}) # 4. output handling
return {"status": "step limit", "steps": step_limit}
# ---------- 2. The model call ----------
def call_model(messages):
resp = client.chat.completions.create(model=MODEL, messages=messages, tools=TOOLS)
msg = resp.choices[0].message.model_dump(exclude_none=True)
return {"message": msg, "usage": resp.usage}
# ---------- 3. Tools: what the model sees, and what really runs ----------
TOOLS = [
{"type": "function", "function": {"name": "bash",
"description": "Run a shell command in the repository. Returns exit code, stdout and stderr.",
"parameters": {"type": "object", "properties": {"command": {"type": "string"}},
"required": ["command"]}}},
{"type": "function", "function": {"name": "submit",
"description": "Call this when the fix is done and tested.",
"parameters": {"type": "object", "properties": {}}}},
]
BLOCKED = ["rm -rf /", "git reset --hard", "sudo ", "curl ", "wget "] # policy guards
def run_tool(name, args, workdir):
if name != "bash":
return f"Unknown tool: {name}"
cmd = args.get("command", "")
if any(b in cmd for b in BLOCKED):
return "Blocked by policy. Try another way."
try:
p = subprocess.run(cmd, shell=True, cwd=workdir, capture_output=True,
text=True, timeout=60)
return f"exit code {p.returncode}\n{p.stdout}{p.stderr}"
except subprocess.TimeoutExpired:
return "Timed out after 60 s."
# ---------- 4. Output handling: keep the head and tail of long outputs ----------
def cut(text, limit=4000):
if len(text) <= limit:
return text
half = limit // 2
return text[:half] + f"\n... [{len(text) - limit} characters cut] ...\n" + text[-half:]
# ---------- 5. The prompt ----------
SYSTEM = """You are a coding agent. The repository is at {workdir}.
Inspect the code with bash, make the smallest fix, run the tests,
then call submit."""
# ---------- 6. The recorder: one line per model call ----------
def record(log, step, reply):
u = reply["usage"]
calls = reply["message"].get("tool_calls") or []
log.write(json.dumps({"step": step,
"input_tokens": u.prompt_tokens if u else None,
"output_tokens": u.completion_tokens if u else None,
"actions": [c["function"]["arguments"] for c in calls]}) + "\n")
if __name__ == "__main__":
print(run_agent("test_calc.py fails. Fix calc.py so the test passes.", workdir="demo"))
What each part does
| Part in the code | What it does | Harness part it shows |
|---|---|---|
run_agent |
The loop: call the model, run its tool, add the result, repeat | The loop |
call_model |
Sends the whole messages list and gets the reply |
The model call |
TOOLS |
The tool descriptions the model reads on every call | Tools |
run_tool + BLOCKED |
Refuses blocked commands, then runs the rest | Guards and tools |
cut |
Shortens long outputs to the first and last 2,000 characters | Output handling |
SYSTEM |
The harness's instructions | Instructions |
record |
Writes one log line per call | Logging (the trajectory) |
step_limit and submit |
When the loop ends | Stopping rules |
Three Python words to know:
messagesis a list holding the history. Everything in it is sent to the model on every call..append(...)adds something to the end of that list. This one detail matters a lot for cost (Part 9).subprocess.run(...)is the line that actually runs a command on the computer. Only the harness does this.
Follow one run by hand
The practice bug: calc.py computes an average and adds + 1 by mistake, so a test fails.
Call 1 sends: [TOOLS] [SYSTEM] [TASK: "test_calc.py fails, fix calc.py"]
model asks: bash: cat calc.py
harness adds: the file, which shows "return sum(xs) / len(xs) + 1"
Call 2 sends: [TOOLS] [SYSTEM] [TASK] [cat calc.py → the code]
model asks: bash: sed -i 's/ + 1//' calc.py && python -m pytest -q
harness adds: "1 passed"
Call 3 sends: [TOOLS] [SYSTEM] [TASK] [cat calc.py] [sed + pytest → "1 passed"]
model asks: submit
loop ends: {"status": "submitted", "steps": 3}
New things are only ever added at the end. Nothing old is changed. Remember this; Part 9 explains why it keeps the run cheap.
A good test of understanding: close this page and write run_agent, call_model, run_tool and cut from a blank file. If you can, you understand every part of a harness.
4. What the model reads on every call
The model has no memory between calls. So on every call, the harness sends the whole request again: everything from before, plus the newest step. The request grows like a stack of blocks.
Here is a run on the floatformat bug (made-up example, realistic sizes). Sizes are in tokens; a token is a small piece of text, about ¾ of a word, and models are priced per token.
Call 1: [TOOLS 21,000] [INSTRUCTIONS + TASK 13,000] = 34,000
Call 2: [TOOLS] [INSTRUCTIONS + TASK] [grep 1,150] = 35,150
Call 3: [TOOLS] [INSTRUCTIONS + TASK] [grep] [open file 9,750] = 44,900
Call 4: [TOOLS] [INSTRUCTIONS + TASK] [grep] [open file] [web search 2,450] = 47,350
Call 5: [TOOLS] [INSTRUCTIONS + TASK] [grep] [open file] [web search] [edit 400] = 47,750
Call 6: [TOOLS] [INSTRUCTIONS + TASK] [grep] [open file] [web search] [edit] [tests 2,050] = 49,800
Each step block holds the model's short request plus what the tool printed.
What is inside the first two blocks:
- TOOLS (21,000): descriptions of every tool the model may use. Built-in tools 6,000 + tools from outside servers 15,000.
- INSTRUCTIONS + TASK (13,000): the harness's instructions 9,000 + a list of skills 1,500 + the project's rules file 2,000 + the bug report itself, only 500.
What to notice:
- The bug report is 500 of the first 34,000 tokens. Most of what the model reads is setup.
- The big file opened at call 3 is sent again in calls 4, 5 and 6.
- Over 6 calls the model reads 34,000 + 35,150 + 44,900 + 47,350 + 47,750 + 49,800 = 258,950 tokens, even though only 49,800 tokens of text exist.
This is why agents are expensive. A 2026 study measured that agent coding tasks use about 1,000× more tokens than answering a code question, and that runs of the same task can differ by up to 30× in total tokens.
The most a model can read in one call is its context window (for example 131,072 tokens). When the request grows past it, the harness must shrink the history (Part 8).
5. A tool call, up close
A tool call is just text in a fixed format. The model writes "I want this tool, with these inputs" and stops. The harness runs it and sends back a tool result. Here is the real shape on Anthropic's API (other providers look similar).
1. What the harness sends:
{
"tools": [ { "name": "bash",
"description": "Run a shell command",
"input_schema": { "type": "object",
"properties": { "command": { "type": "string" } } } } ],
"system": "You fix bugs in /testbed ...",
"messages": [
{ "role": "user", "content": "Fix: floatformat loses precision for Decimal ..." }
]
}
2. What the model sends back:
{ "stop_reason": "tool_use",
"content": [ { "type": "tool_use", "id": "t1", "name": "bash",
"input": { "command": "grep -rn floatformat django/" } } ] }
3. What the harness adds before the next call:
{ "role": "assistant", "content": [ "...the tool_use block above..." ] },
{ "role": "user", "content": [ { "type": "tool_result", "tool_use_id": "t1",
"content": "django/template/defaultfilters.py:95: def floatformat(..." } ] }
What each piece means:
"tools"is the TOOLS block from Part 4. The description of every tool is sent on every call. A tool's name, description and input list is called its tool schema."stop_reason": "tool_use"means "I want a tool; send me the result." Any other stop reason means the model is done for now.- Step 3 adds two messages at the end of the history.
- Some harnesses skip this format. mini-swe-agent lets the model write a bash command in plain text and picks it out of the reply. Same loop, different format.
6. Tools: built-in tools and MCP tools
A tool is an action the harness can do for the model: run a command, edit a file, search the web. The model never runs the tool. It only reads the tool's description and asks for it by name.
Built-in tools are static; MCP tools are dynamic
| Built-in tools (static) | MCP tools (dynamic) | |
|---|---|---|
| Who provides them | The harness's own code | Separate programs called MCP servers that the user connects |
| Examples | bash, edit file | a GitHub server, a web-search server, a database server |
| When the list is known | Before the run; the same every time | When the harness starts, it asks each server for its list |
| Can it change during a run? | No | Yes: a server can announce that its tool list changed |
| Same for every user? | Yes | No: it depends on which servers each person connected |
MCP (Model Context Protocol) is a standard way to plug outside tools into any harness. The words you will see:
- Host: the app you use, such as Claude Code.
- Client: a connector inside the host; one per server.
- Server: the outside program that offers tools.
tools/list: the request the client sends at start to get the server's tools.tools/call: the request the client sends to run a tool, with its name and inputs.notifications/tools/list_changed: the message a server sends when its tool list changes.
Tool descriptions cost tokens on every call
Every tool description sits in the TOOLS block, which is sent on every call. A few built-in tools are small. Many MCP tools are not.
Built-in only: [bash] [edit] small
Built-in + MCP, all loaded: [bash] [edit] [58 MCP tool descriptions ......] ≈ 55,000 tokens
Built-in + MCP, on demand: [bash] [edit] [tool_search] ≈ 8,700 tokens
The 55,000 and 8,700 numbers are from Anthropic's own example of 58 tools from 5 servers.
Loading tools on demand ("tool search"), step by step
- The harness knows all 58 tools, but sends the model only a few tools plus one called
tool_search. - The model needs the web, so it calls
tool_search("search the web"). - The harness finds
web_searchand sends back its description as a tool result, at the end of the history. - The model can now call
web_search. The cost is one extra step.
A related idea from Anthropic gives the agent its tools as code files that it opens only when needed; in one example this cut 150,000 tokens to 2,000.
An independent 2026 system that recommends tools on demand (from a catalog of about 8,200 tools) cut input tokens by 17% with Codex and 40% with Claude Code, and lowered the bill by up to 40% with the same task completion, compared with a fixed list of 100 tools.
Skills work the same way
A skill is a folder of instructions for one kind of job. Only each skill's name and one-line description sit in the instructions. The full instructions are added at the end of the history only when the model decides to use that skill.
Fewer, better-designed tools often win
- mini-swe-agent has one tool, bash, and scores over 74% on SWE-bench Verified (a standard set of real GitHub bugs).
- A 2026 study gave Claude Code and Codex CLI either their normal tools, bash only, or a single "run code" tool. The single run-code tool was cheaper or tied in 3 of 4 cases, with the same pass rate.
- Another 2026 study (The Devil Is in the Interface) tested six tool designs with the same models and tasks over 11,700 runs. A Python tool reached similar results with 41.6% fewer steps and 56.3% fewer tokens than bash only. Small, single-purpose tools made results more consistent from run to run.
- A source-code study of 11 real harnesses found skills in 9 of 11 and MCP in 8 of 11.
Tools change behavior
The tool list is part of what the model reads, so it shapes the model's first move. With only bash, a coding agent searches the code with grep and works out a fix. With web_search in its list, it may search the internet and find the fix someone already wrote. Adding a tool is a behavior change, not just a new ability.
7. Instructions and project rule files
Instructions tell the model who it is and how to work. They come in two kinds:
- The system prompt: the harness's fixed instructions at the start of every request. Example: "You are a coding agent. Inspect the code, make the smallest fix, run the tests, then call submit."
- A project rules file that the harness adds to the instructions:
CLAUDE.mdfor Claude Code,AGENTS.mdfor Codex and several other tools.
A small rules file:
# Project rules
- Run tests with: python -m pytest tests/template_tests
- Make the smallest change that fixes the bug
- Do not edit files outside django/template/
What practice teaches:
- Keep it short and point to more. OpenAI's team found that one big instructions file "failed in predictable ways". They used an
AGENTS.mdof about 100 lines as a table of contents pointing into adocs/folder. - Rules work best as checks, not text. The same team turned rules into custom linters (programs that check code) whose error messages tell the agent how to fix the problem.
- Instructions are the cheapest part to change, but one study of an automatic harness improver found most of the gain came from tools, the code around tool calls, and memory, not from the system prompt.
8. Managing the history
The history grows every step. Sooner or later the harness must decide what to keep. There are five common choices.
| Choice | What it does | Example |
|---|---|---|
| Keep everything | Append every step, never change old ones | mini-swe-agent ("a completely linear history") |
| Cut long outputs | Shorten each tool output before adding it | cut() in the code above keeps the first and last 2,000 characters |
| Hide old outputs (masking) | Replace tool outputs older than a few steps with a short note like [old output hidden] |
Studied with SWE-agent and OpenHands |
| Summarize (compaction) | Replace much of the old history with a summary written by the model | Claude Code does this when the request gets too long |
| Start fresh with notes | End the session; the next one reads a short progress file | Anthropic's long-running agents (Part 13) |
What the evidence says:
- Hiding old outputs halves cost compared with keeping everything, and solves as many tasks as AI summaries (The Complexity Trap, 2025). A mix of both cut cost a further 7%.
- History rules matter most when space is tight. With a small 20,480-token window, shortening older tool results and reacting when the agent stalls raised fully solved tasks from 43 to 72 out of 169. With a large window, the difference was small.
- Simple rules first, AI summaries second was the most efficient order in a controlled 2026 study of 176 settings.
- Dropping history can hurt success, not just cost, when the dropped fact cannot be seen again (for example, a test output that changed). Summaries that keep notes recovered most of the loss in one study.
- But changing old history breaks the prompt cache, which can make the bill go up. That is the next part.
9. The prompt cache: why some changes cost so much
This is the most important idea for a harness's cost, and the one most often misunderstood.
What the cache is
Sending the whole request on every call would be very expensive. So model servers keep a prompt cache: they save their work on the last request. If the next request starts with the same text, the server reuses its saved work for that part and charges about 1/10 of the normal price for it. With Anthropic's pricing, reading from the cache costs about 0.1× the normal input price, and saving new text into the cache costs about 1.25×. Saved work lasts about 5 minutes by default, and each reuse restarts that clock.
The one rule
The server compares this call with the last one, from the start, block by block. Blocks that match are cheap. At the first block that is different, the matching stops. From there to the end, every block is full price, even blocks that are the same text as before.
The order is fixed: tools first, then instructions, then the messages.
Example 1: adding at the end (normal)
Call 3: [TOOLS] [INSTRUCTIONS] [grep] [open file]
Call 4: [TOOLS] [INSTRUCTIONS] [grep] [open file] [web search]
cheap cheap cheap cheap NEW (full price)
Full price this call: 2,450 tokens
Example 2: changing the start
At call 4, a new MCP server is connected. Its tool descriptions go into TOOLS, the first block.
Call 3: [TOOLS] [INSTRUCTIONS] [grep] [open file]
Call 4: [TOOLS + new tool] [INSTRUCTIONS] [grep] [open file] [web search]
CHANGED paid again paid paid new
(same text, but after the change)
Full price this call: 50,350 tokens
Same run, same step. The only difference is where the new text went.
Why a change stops the matching
The server's saved work on each block depends on all the blocks before it, like a running total. The running total of 3, 5, 2 is 3, 8, 10. Change the first number to 4 and every total after it changes: 4, 9, 11. So after a change, nothing that follows can be reused.
Three things people mix up
- Cheap is not skipped. The model still reads every block on every call. The cache only saves the server from redoing work.
- Cheap still fills the space. Cached tokens count toward the context window.
- The cache does not change the answer, only the price. Do not blame it for different runs.
Four scenarios, same six calls (made-up example)
The "bill" below counts a cheap token as 1/10 of a full-price token, to keep the sums simple: bill = full-price tokens + cheap tokens ÷ 10.
| Scenario | What happens | Tokens read | Bill |
|---|---|---|---|
| 1. Normal | Only add at the end | 258,950 | 70,715 |
| 2. New tool added at the start (call 4) | TOOLS changes; call 4 is all full price | 267,950 | 114,725 |
| 3. Same new tool added at the end (call 4) | The description arrives as a tool result at the end, like tool search | 267,950 | 74,315 |
| 4. Old outputs hidden (from call 4) | Each call swaps one old output for a note, changing a middle block | 235,290 | 80,472 |
What the table shows:
- Scenarios 2 and 3 add exactly the same text. Only the position differs. At the start, the bill is about 40,000 higher.
- Scenario 4 reads fewer tokens than Scenario 1 but costs more, because every call changes a block in the middle. In much longer runs, the smaller request can still win; that is exactly what researchers measure.
- In a normal run, each block is paid in full only once, the first time it is sent.
What real systems and studies measured
- Real use is mostly cache. In 13.5 million real GitHub Copilot agent sessions, the cache hit rate averaged 90% within a turn, fell to 55% across turn boundaries (when a new user message starts a turn), and was only 8% after switching models. A study of about 4,300 real Claude Code and Codex sessions measured a 95.7% cache hit rate, with a median of about 119,000 repeated tokens per step against 875 new ones.
- Fewer tokens can mean a higher bill. Shrinking tool outputs in Claude Code cut tool-output tokens by 38.4% but raised the bill by 6.8%, because cache writes and reads were most of the cost (Token Reduction Is Not Cost Reduction, 2026).
- Adding or removing context mostly raises cost once the cache is priced in. Across more than 20,000 runs, adding retrieved code cut search commands by 18–34% but raised cost by 33–42%; removing old outputs raised cost by 38–116% at a one-tenth cache price (Context Has a Price, 2026).
- Cache-aware history management works. Keeping the start of the request stable and removing old context in batches cut cost by 56–87% on two agent benchmarks (TokenPilot, 2026).
The cache lives inside the loop
The cache is not one discount for the whole run. It is checked on every call, inside the loop. Whether a call is cheap depends on what changed since the call before. So a harness feature (adding tools, hiding old outputs, summaries, switching models) can only be judged by following the cache call by call, and by measuring cost per solved task, not tokens saved.
10. Guards, permissions and the sandbox
- A guard (or permission) is a rule checked before an action runs. In the code above,
BLOCKEDrefusesrm -rf /,sudo,curlandwget. - A sandbox is a locked space where commands run, so they cannot harm the real machine. Docker containers are the common choice.
In Claude Code, you write your own rules in .claude/settings.json (example):
{
"permissions": {
"allow": ["Bash(pytest:*)"],
"deny": ["Bash(rm -rf:*)", "Read(./.env)"]
}
}
allow: the agent may runpytestwithout asking you each time, so it can test and fix itself.deny: it may never runrm -rf, and may never read.env, a file that often holds passwords.
The tool's harness gives you the mechanism (asking, allowing, blocking). Your settings file fills in the rules for your project, because the tool cannot know which files are secret or which commands are dangerous for you.
What research found:
- Auto-approving everything is dangerous. In a 2026 benchmark across six harnesses, auto-approve raised attack success from 29.2% to 95.6%. Network isolation and read-only mode blocked attacks but made the agent much less useful. Command allowlists cut attacks with a small loss of usefulness. About half of the safety mechanisms were off unless the user turned them on.
- An open network can turn solving into copying. With internet access, an agent working on a benchmark bug can find and copy the real fix that was published later. SWE-Bench Pro V2 now blocks all network access except to the model.
11. Guides and sensors: steering and checking
Böckeler's article gives two simple words for the parts of a harness that shape quality:
- Guides steer the agent before it acts. Examples: the rules file, skills, a project template.
- Sensors check the work after it acts. Examples: tests, a linter, a code review.
You need both. With only sensors, the agent keeps making the same mistake. With only guides, it never finds out whether it followed them.
Each guide or sensor is one of two kinds:
| Kind | Run by | Examples | Speed and cost | Same answer every time? |
|---|---|---|---|---|
| Computational | Normal code | tests, linters, type checkers | fast, almost free | Yes |
| Inferential | An AI | an AI code reviewer, "AI as judge" | slower, costs tokens | No |
A linter is a program that reads code without running it and flags mistakes and messy style, such as an unused variable. It is a computational sensor.
A sensor wired in with a hook (example). A hook is a command the harness runs automatically at a point in the loop. This Claude Code setting runs the linter after every file edit and shows the result to the agent:
{
"hooks": {
"PostToolUse": [
{ "matcher": "Edit|Write",
"hooks": [ { "type": "command", "command": "ruff check ." } ] }
]
}
}
Write sensor messages for the agent. line too long is weak. Line 88 is too long; split the condition like line 40 tells the agent exactly how to fix it. OpenAI's team built its linters this way.
The steering loop. When the agent makes the same mistake more than once, a person adds or improves a guide or sensor so it stops happening. Example: the agent keeps running the whole 20-minute test suite, so you add "run only the test file for the code you changed" to the rules file.
A cheap checker pays off. In a 2026 study, a read-only checker at the end of each run rejected 61% of invalid runs for under one cent per run.
What no sensor catches yet. If the agent misunderstands the bug and writes tests that match its own wrong fix, the tests pass, the linter is happy, and the fix is still wrong. Checking that a program behaves correctly is still mostly unsolved.
12. Stopping rules and budgets
The loop ends when one of these happens:
- The model says it is done, by calling a
submittool or giving a final answer. mini-swe-agent has the model run a special echo command to signal it is done. - A step limit is hit, for example 250 steps in mini-swe-agent's SWE-bench setup.
- A budget runs out: tokens or dollars.
- The request no longer fits the context window, or an error happens.
Step limits and budgets are harness settings like any other. A lower limit is cheaper but leaves more tasks unfinished.
13. Long jobs across many sessions
Big jobs, like building a full web app, do not fit in one session (one run of the agent until its context window is full). Each new session starts with no memory. Anthropic described a harness for this in November 2025.
The first session sets up files, and writes no app code. The main one is feature_list.json: 200+ features, all marked not done at the start. One entry looks like this (shortened):
[
{ "category": "functional",
"description": "New chat button creates a fresh conversation",
"steps": ["Click the 'New chat' button", "Verify a new conversation is created"],
"passes": false }
]
claude-progress.txt: a diary of what has been done.init.sh: a script that starts the app.- A first git commit (a saved snapshot of the code).
Every later session follows the same routine:
- Read the diary and the git history.
- Run
init.shand check the basics still work. - Pick one feature that is still
false. - Build it, then test it like a real user in a browser.
- Only then set it to
true; commit to git and update the diary.
Why each piece is there: one feature per session stops the agent doing too much at once; the feature list stops it saying "done" too early; the diary and git tell a blank session what happened; browser testing stops it marking features done without real checks. They used JSON for the list because the model was less likely to rewrite or delete JSON than plain text.
A follow-up (March 2026) split the work between three agents: a planner that turns a short prompt into a spec, a generator that builds it, and an evaluator that clicks through the app and grades it strictly. On one app, a single agent took 20 minutes and $9; the full harness took 6 hours and $200 and produced a working app. Their key lesson: every part of a harness exists because of something the model cannot do alone, and these reasons go stale as models improve. After a newer model came out, they removed one of their own harness parts.
14. What a harness looks like in files
A harness is not one file. It is code plus settings plus instructions. Here are three real examples.
mini-swe-agent (the simplest well-known harness)
From its README: about 100 lines of Python for the agent; bash is the only tool; no tool-call format (the model writes the command in plain text); a completely linear history; and each command runs in a fresh subprocess.run. Its settings live in a YAML file with the instruction templates, the step limit and the dollar limit, the sandbox (for example Docker), and the model to use.
SWE-agent (a richer research harness)
Its current default settings file has this shape (from the repository's config/default.yaml):
agent:
templates: # INSTRUCTIONS
system_template: ...
instance_template: ...
next_step_template: ...
tools: # TOOLS
bundles:
- path: tools/registry
- path: tools/edit_anthropic # a file-editing tool
- path: tools/review_on_submit_m # makes the agent review before submitting
enable_bash_tool: true
parse_function:
type: function_calling # uses the tool-call format
history_processors: # HISTORY RULE
- type: cache_control # marks the last 2 messages for the prompt cache
last_n_messages: 2
Claude Code (a closed product)
The loop and built-in instructions are inside the program. Your layer is a set of files in your project:
my-project/
├── CLAUDE.md ← your rules (a guide)
├── .claude/settings.json ← permissions (guards) and hooks (sensors)
├── .claude/skills/ ← skills, loaded only when needed
├── .mcp.json ← which MCP servers to connect (adds tools)
└── tests/ ← your tests (sensors)
Change one thing, and it is a different harness
| Change | Part changed | What can happen |
|---|---|---|
| Add "run the tests before submitting" to the instructions | Instructions (a guide) | Fewer wrong fixes, more steps |
Add a web_search tool |
Tools | The agent may look up a fix instead of working it out |
| Hide outputs older than 5 steps | History rule | Fewer tokens, but the cache breaks every call |
| Step limit 250 → 50 | Stopping rule | Cheaper, more unfinished tasks |
| Allow internet in the sandbox | Guard | Possible copying of published fixes |
This is how research compares harnesses: same model, same tasks, change one part, run several times, measure success and cost.
15. Does the harness matter?
Short answer: switching harness usually changes success a little (often about as much as simply running again) but can change cost a lot. And some model–harness pairs fit badly, which can flip rankings.
| Study (2026) | Setup | What they found |
|---|---|---|
| What Does a Harness Buy? Tokens, Mostly | Claude Code, mini-swe-agent and OpenCode; 7 models | No harness wins everywhere. Differences of 2–5 points, about the same as a re-run. Cost differences from under 10% up to 3–4×. |
| Harness or Model? | Each company's own harness vs a neutral one, same model, 256 private tasks | Claude Opus 4.8: 48.8% vs 50.0%. GPT-5.5: 55.6% vs 54.4%. The neutral harness cost 1.2–1.6× more per solved task. |
| Stop Comparing LLM Agents Without Disclosing the Harness | 3 harnesses × 3 models, 2 runs each | Harness changes moved scores about 7.8× more than model changes; 6 of 9 model comparisons flipped order depending on the harness. |
| Finding the Right Fit | 66 model–harness pairs | On one benchmark, Claude led GPT by 7.94 points in one harness and trailed by 30.16 in another. |
| Don't Blame the Large Language Model | One model, 35 releases of one harness (Qwen Code) | No clear rise in success (average 30.5%), but tokens per task rose from about 391,000 to 668,000. |
| Beyond the Model | Five harness parts added to mini-swe-agent; 10 models | +7.37 and +6.21 points. Structured tools and task-specific helper agents helped most; history compression could hurt. |
| Better Harnesses, Smaller Models | Harnesses adapted automatically for small models | The best small model reached 89.7% of a large model's score at 4% of the cost. |
What this means in practice:
- Always name the harness when you report an agent's score.
- Run more than once before claiming one harness is better.
- Measure cost per solved task, because cost is where harnesses differ most.
- Harness updates can add cost without adding success.
16. Why the same task runs differently each time
Run one task three times with the same model and the same harness, and you can get three different runs.
- Sampling. The model does not always pick its single most likely next word; it picks among several likely ones. How much variety it allows is set by the temperature (0 = almost always the top choice; 1.0 = more variety).
- Snowball. A different command gives a different output, so the next request is different, and so is every request after it.
- The environment. Network lookups, timeouts, the clock and flaky tests can give different results to the same command.
- The server. Even at temperature 0, small differences in how the server processes requests can change results.
- Not the cache. The cache changes the price, not the answer.
What studies measured:
- In 60,000 runs on SWE-bench Verified, a score from a single run moved by 2.2 to 6.0 points depending on which run was picked, and by more than 1.5 points even at temperature 0. Runs split apart within the first few percent of their tokens (On Randomness in Agentic Evals).
- About 54% of the spread in scores came from simply re-running the same setup, not from changing it (Agents Are Systems, Not Models).
- 10.7% of passing runs were lucky passes: they passed, but the path was poor (AgentLens).
- A fixed plan format made 3 of 4 small-model setups fully repeatable and used fewer tokens (Harness Engineering for Predictable Agentic Systems), though only on made-up tasks.
17. What makes a harness efficient: a checklist
Each line comes from the evidence above. "Efficient" here means solving the task for the least cost per solved task, not using the fewest tokens.
What the model reads
What the agent can do
Checking the work
Safety
Long jobs
Measuring
18. Harnesses that improve themselves
The fastest-growing research area. The model stays the same; another AI (or a search method) edits the harness, runs it, and keeps what helps.
| Work | What it changes | Result |
|---|---|---|
| Darwin Gödel Machine (2025) | The agent rewrites its own code; keeps a family tree of versions | SWE-bench 20.0% → 50.0% |
| Agentic Harness Engineering (2026) | Edits harness files and checks each edit's predicted effect | Terminal-Bench 2: 69.7% → 77.0%; gains came from tools, the code around tool calls, and memory, not the system prompt |
| DarwinX (2026) | A population of harnesses; only versions that do not get worse are kept | Terminal-Bench 2.1: 83.2%; about +17 points on average across 4 benchmarks |
| MILO (2026) | Rewrites whole harnesses and evolves the search itself | Terminal-Bench 2.1: 86.1%, with 26% fewer tokens than its starting harness |
| HarnessMM (2026) | Reuses decisions the agent already made | Same 90.82% success, tokens per task 66.72k → 47.02k |
| LongCapHarness (2026) | A strong AI builds harnesses for long reading tasks; a small model uses them, no training | Llama3-8B on HELMET: 15.14 → 79.32 |
| Harnesses Can Be Compositional Generalizers (2026) | Trains a model inside a harness that splits big problems into small calls | Training on short tasks worked on tasks 2–64× longer; 26.9% better on average with about 2× fewer tokens |
A warning. When harness evolution was compared with simply giving a plain agent the same budget to try more times, evolution did not win on Terminal-Bench 2.1, though it did win on two other benchmarks. Some studies also leaked test answers into the search. Ask for equal budgets and unseen tasks before trusting a claim (Rethinking the Evaluation of Harness Evolution).
19. A short history of harnesses
| Year | Milestone | What it added | Problem it solved | What it left open |
|---|---|---|---|---|
| 2022 | ReAct | Think → act → observe, repeated | Models could reason or act, not both | Tools for real code |
| 2024 | SWE-agent | Tools designed for the model (viewer, search, editing, tests) | Models got lost in raw shell output | Built for weaker models |
| 2024 | CodeAct, OpenHands | Actions as code; an open platform with a sandbox | Rigid tool calls; no shared platform | Cost |
| 2024 | Agentless | No loop: find → fix → check | Cost and unpredictability (32% of SWE-bench Lite at $0.70) | Less flexible |
| 2025 | mini-swe-agent | ~100 lines, bash only | Showed strong models need little harness (over 74% Verified) | No memory or extra checks |
| 2025 | Claude Code, Codex CLI | Permissions, hooks, MCP, skills, helper agents, summaries | Daily real-world use | Closed cores, hard to study |
| 2025–26 | Long-running harnesses | Progress files, feature lists, planner / builder / checker | Memory across sessions | Mostly web apps |
| 2026 | Tool search, harness engineering | On-demand tools; guides and sensors | Tool lists eating the request; trust without review | Measuring harness quality |
| 2026 | Definitions and comparisons | 11 harness jobs; controlled comparisons | No shared vocabulary; unfair comparisons | Which parts help, and why |
| 2025–26 | Self-improving harnesses | AI edits the harness | Hand-tuning | Fair evaluation; cost of the search |
The pattern: each harness covered a weakness of the models of its time. As models improved, simpler harnesses often did just as well.
20. What is still unknown
I searched for each question below and read the closest papers. "Partly answered" means some work exists but a clear piece is missing.
| Question | Status | What exists | What is missing |
|---|---|---|---|
| How much does the cache save or lose, call by call, when a harness changes old content? | Partly answered | Context Has a Price; Copilot and TraceLab measurements | Adding or changing tools mid-run |
| Does loading tools on demand beat loading all of them, on coding benchmarks with cache pricing? | Partly answered | Tool recommendation study (vs a fixed 100-tool list) | A direct test against loading all tools on SWE-bench-style tasks |
| How does adding one tool change the agent's path, step by step? | Partly answered | The Devil Is in the Interface (tool design changes steps and tokens) | Adding a web-search tool and tracing whether the agent looks up fixes |
| How much do repeat runs differ? | Answered | On Randomness in Agentic Evals; Agents Are Systems, Not Models | — |
| Which harness parts cause that difference? | Open (searched) | Plan format, on small models and made-up tasks | Real harness parts on real coding tasks |
| Can a cheap early score judge a harness without full runs? | Partly answered | EarlyEval predicts pass or fail from early steps (89–97% accuracy) | Using it to score harness candidates |
| Does harness search beat simpler methods? | Partly answered | Not on Terminal-Bench 2.1; yes on two others | The same check on SWE-bench-style tasks |
| How do we check that a fix behaves correctly? | Open | Cheap final checkers help | A reliable method |
| How do we measure how good a harness is? | Open | Named as needed by several authors | A shared measure, like test coverage for tests |
Updated with the 50 papers in Section 13.
21. Glossary from A to Z
- Agent: a model plus a harness, working step by step until a task is done.
- AGENTS.md / CLAUDE.md: a project rules file the harness adds to the model's instructions.
- Benchmark: a fixed set of tasks used to score agents. SWE-bench Verified is a set of real GitHub bugs; Terminal-Bench is a set of command-line tasks; HELMET and RULER test reading very long inputs.
- Budget: a limit on tokens or money; when it runs out, the harness stops the run.
- Cache (prompt cache): the server's saved work on the start of the last request. Matching blocks from the start cost about 1/10 of the normal price.
- Cache break: a change to something already sent. From that point to the end, everything is full price again.
- Call: one request to the model and its reply. A run has many calls.
- Compaction: replacing old history with a summary written by the model.
- Computational check: a check run by normal code, like tests or a linter. Fast, cheap, same answer every time.
- Context (request): everything the model reads in one call: tools, instructions, task and history.
- Context window: the most tokens one request can hold.
- Dynamic tools: tools whose list is learned while the harness runs, like MCP tools. The list can change.
- Evaluation harness: the program that grades a finished run. It is not the harness that runs the agent.
- Guard (permission): a rule checked before an action runs, like "never run
rm -rf". - Guide: anything that steers the agent before it acts, like a rules file or a skill.
- Harness (scaffold): everything around the model: loop, instructions, tools, history rules, guards, checks, stopping rules.
- History: the running record of every earlier step in the run.
- Hook: a command the harness runs automatically at a point in the loop, such as after every edit.
- Inferential check: a check run by an AI, like an AI code reviewer. Smarter, slower, can vary.
- Instructions (system prompt): the harness's fixed text at the start of every request.
- Linter: a program that reads code without running it and flags mistakes and messy style.
- Loop: build the request, call the model, run its tool, add the result, repeat until done.
- Masking: hiding old tool outputs behind a short note to make the request smaller.
- MCP (Model Context Protocol): a standard way to connect outside tools to a harness, through MCP servers.
- Model: the AI that reads and writes text. It cannot act on its own.
- Pass rate (resolve rate): the share of tasks the agent solves; "pass@1" means solved on the first try.
- Observation: what a tool returned, as the model sees it (often shortened).
- Rerun noise: the difference in results when you simply run the same setup again.
- Sandbox: a locked space where commands run, so they cannot harm the real machine.
- Sensor: anything that checks the work after the agent acts, like tests or a linter.
- Session: one run of the agent, from its first call until it stops or its context window is full.
- Skill: a folder of instructions; only its name and short description are sent until the model uses it.
- Static tools: tools written into the harness's code; the same list every run.
- Step limit: the most steps the harness allows before stopping.
- Sub-agent (helper agent): a second agent the main one starts for a side job, with its own separate request.
- Temperature: how much variety the model allows when picking its next word.
- Token: a small piece of text, about ¾ of a word. Models are priced per token.
- Tool: an action the harness can do for the model, like running a command.
- Tool call / tool result: the model's request to use a tool / the output sent back.
- Tool schema: a tool's description in JSON: its name, what it does, and its inputs.
- Tool search: sending only a few tools plus a search tool, and adding other tool descriptions at the end when the model asks.
- Trajectory: the full record of one run, step by step.
- Verification: proving the change works, not just saying it does.
22. Sources
Every number in this guide comes from one of these pages (read in November 2026). Numbers labeled (made-up example) are invented to teach an idea.
Practice and products
- Anthropic, Effective harnesses for long-running agents (Nov 2025)
- Anthropic, Harness design for long-running apps (Mar 2026)
- Anthropic, Advanced tool use and Code execution with MCP
- Anthropic docs, Prompt caching and Tool use
- MCP specification: Tools
- OpenAI, Harness engineering (Feb 2026)
- Birgitta Böckeler, Harness engineering for coding agent users (Apr 2026)
- mini-swe-agent and SWE-agent default config
Classic harness papers
Definitions and studies of many harnesses
Does the harness matter?
- What Does a Harness Buy? · Harness or Model? · Stop Comparing LLM Agents Without Disclosing the Harness · Finding the Right Fit · Same Model, Different Harness · An Empirical Study of Harness Design · Beyond the Model · Don't Blame the Large Language Model · Better Harnesses, Smaller Models
Context, tools, cache and cost
- The Complexity Trap · Token Reduction Is Not Cost Reduction · Context Has a Price · TokenPilot · Agentic Coding in the Wild (Copilot) · TraceLab · How Do AI Agents Spend Your Money? · Cost-Inefficient Behaviors · execute_code only · The Devil Is in the Interface · Tool Recommendation for Multi-Step Agents · When the harness decides success · How Do Agent Harnesses Create Value?
Trusting results
- On Randomness in Agentic Evals · Agents Are Systems, Not Models · AgentLens · Predictable Agentic Systems · SWE-Bench Pro V2 · EarlyEval
Harnesses that improve themselves
- Darwin Gödel Machine · Agentic Harness Engineering · DarwinX · MILO · HarnessMM · LongCapHarness · Language Model Harnesses Can Be Compositional Generalizers · Rethinking the Evaluation of Harness Evolution
Section 2 How the papers were chosen
Finding the useful papers is the slow part of learning a new topic: there are many, and most only touch it in passing. Sections 3 to 11 do that sorting for you, like a small systematic literature review: a fixed set of papers, chosen by stated rules, each read and written up in the same way. This section explains the rules, so you can judge the choice yourself.
Where the papers came from. I started from a list of 96 papers about harnesses, published on arXiv between February and November 2026 and gathered from DAIR.AI's weekly paper roundups.
What was kept. A paper was kept when the harness is its main subject and it teaches something general about building or judging harnesses. A paper was left out for one of three reasons; Figure 8 names them with their counts.
- 22 Its idea is covered by an included paper:
- 12 The harness is only a side topic.
- 12 Applies a harness to one narrow area, without a general lesson.
- 7 already discussed in Section 1
- 43 more
What was taken from each paper. Each paper was read from its full text (abstract, method, main results and limitations) and written up in the same form. Each write-up gives the problem, what the authors did, how they tested it, what they found, its limits, a one-sentence takeaway, and a link to the authors' code when they released it. Where a paper reports many numbers, the write-up keeps the ones the paper uses for its main claims.
Words used in the write-ups. Held-out tasks or benchmarks are kept aside while a method is built or tuned, so they show whether it works on new cases (held-in tasks are the ones used to build it); out-of-distribution benchmarks are ones unlike those used for tuning. An ablation removes one part at a time to see what it contributed. pass@k means a task was solved in at least one of k tries, and best@k is the best score over k tries, while pass^k means it was solved in all k tries. Reinforcement learning (RL) trains a model by trial and reward; GRPO and PPO are two common RL methods. SFT (supervised fine-tuning) trains a model on example answers. Precision is the share of found or flagged items that were right, recall is the share of right items that were found, and F1 combines the two into one score.
How the write-ups were checked. Every number in a write-up was checked by script against the paper's text, and for most of them the paper's own sentence was kept as evidence. Code links were checked to exist. Numbers are reported as the papers give them; no experiment was re-run.
Limits of this review. The starting list comes from one source, so papers it missed are missing here too. The papers are arXiv versions, which may change in later revisions. Model names are written as each paper gives them.
The 46 papers left out, and why
Up next Section 3: The big picture: what a harness is
Section 3 The big picture: what a harness is
Most people meet a harness inside a tool they install, so it feels like a fixed part of the product. These four papers step back and treat the harness as something to describe and design on purpose. Two only frame the idea; two build small harnesses and test them.
Builds on Part 1 (model, harness, agent), Part 14 (a harness in files)
From Model Scaling to System Scaling: Scaling the Harness in Agentic AI
Connects to Part 8 (history), Part 11 (guides and sensors)
A position paper (an argument, with no experiments) saying that agent progress depends on scaling the harness around the model, with a framework, an evaluation agenda and a reference harness.
The problem. Agent evaluation mostly reports final task success and treats memory, retrieval, tool use and verification as implementation details. The author asks whether the system around the model is the next bottleneck.
What they did. The paper splits an agent into the model and the harness parts around it: memory, context construction, skill routing (choosing tools and sub-agents), the orchestration loop, and verification and governance. It names three bottlenecks: context governance (what to retrieve, compress and keep active), trustworthy memory (what to store and trust) and dynamic skill routing. A table compares Claude Code, OpenClaw and the author's CheetahClaws. The paper also proposes benchmarks that measure trajectory quality, memory hygiene and verification cost.
- Memorywhat to store and how far to trust it
- Contextwhat to retrieve, compress and keep active
- Skill routingchoosing tools and sub-agents
- Orchestration loopwraps the flow: context draws on memory to feed the model
- Verification and governancechecks on what the model does
name: str
description: str
type: str
content: str
file_path: str = ""
created: str = ""
scope: str = "user"
confidence: float = 1.0
source: str = "user"
last_used_at: str = ""
conflict_group: str = ""How they tested it. No experiments. It is a framing and design paper with a table comparing Claude Code v2.1.88, OpenClaw v2026.4.6 and CheetahClaws v3.05.79.
What they found.
- The three harnesses address the same three problems differently: CheetahClaws stores confidence and recency on each memory entry, while the other two derive trust from access patterns.
- The author argues that stronger models may reduce failures such as stale memory, but will not remove the need for explicit mechanisms over what the model sees and does.
Limits. The paper states that the manuscript is under active development. It reports no measured results.
Takeaway. Someone building a harness can use the memory, context and skill-routing split as a checklist for what to log and evaluate, beyond final task success.
Code as Agent Harness
Connects to Part 1 (model, harness, agent), Part 6 (tools)
A survey that treats code as the shared medium of an agent harness and sorts the literature into interface, mechanisms and multi-agent scaling.
The problem. Earlier surveys treat code as what a model writes. The authors ask how agents use code they create themselves to act, keep state and check progress.
What they did. The survey separates model abilities, harness infrastructure (tools, sandboxes, memory, validators, permissions), and agent-initiated code artifacts such as tests, temporary tools and reusable skills. It sorts the work into three layers. The interface layer is code for reasoning, acting and modelling the environment. The mechanism layer covers planning, memory, tool use and feedback control. The scaling layer covers shared code artifacts for coordination and review between agents.
- Interface layercode for reasoning, acting and modelling the environment
- Mechanism layerplanning, memory, tool use, feedback control and harness optimization
- Scaling layershared code artifacts for many agents
See Figure 2 from the paper

How they tested it. No experiments. A survey with a taxonomy, application areas and a list of open challenges.
What they found.
- On tools, the survey says the open question is whether the harness makes tool use safe, auditable and useful over long tasks.
- It suggests treating a harness change like a change to a safety-critical runtime, with a stated target failure, a test that could disprove it and a rollback path.
- For multi-agent work it names transactional shared program state as the missing abstraction.
Limits. As a survey, it reports no new measurements. The open challenges it lists include evaluation beyond final task success and consistent shared state across agents.
Takeaway. Someone studying harnesses can use the three-layer taxonomy to place a feature (a test, a skill, a permission tier) and see which layer it belongs to.
Natural-Language Agent Harnesses
Connects to Part 7 (instructions), Part 11 (guides and sensors)
Harness rules written as editable natural-language documents and run by a shared runtime gave task scores similar to code harnesses; adding one module at a time to a basic version showed which parts helped.
The problem. Harness logic sits inside controller code, so it is hard to inspect, move and ablate. The authors ask whether it can be written as an executable natural-language document.
What they did. A Natural-Language Agent Harness (NLAH) is a document that states a run's stages, roles, state rules, verification rules, recovery rules and stopping conditions. The Intelligent Harness Runtime (IHR) is a thin loop (a model with a terminal as its only tool) that reads the document and launches child agents. Tests, parsers and sandboxing stay in code.
- 1Harness as a documentstages, roles, state, checks and stopping rules in plain language
- 2A runtime reads ita thin loop with a terminal as its only tool
- 3Child agents do the workeach given only its task packet
- 4Exact steps stay in codetests, parsers, sandboxing and adapters
## Verification procedure
1. Identify the candidate's actual claim.
2. Break that claim into checkable subclaims or steps. Mark each one as
verified, contradicted, or still uncheckable.
3. Check completeness: does the candidate cover all required parts of the
problem, or only a subset?
4. Check factual correctness: are any stated facts unsupported, contradicted, or
invented?
5. Check logical correctness: does the explanation genuinely support the final
answer, or are there gaps, contradictions, or unjustified jumps?
6. When feasible, run at least one central check that does not merely restate
the candidate's own phrasing or trust the candidate's preferred test route.
7. If uncertainty remains, do not over-accept. Distinguish "appears promising"
from "verified".How they tested it. gpt-5.4-mini in Codex CLI on SWE-bench Verified, Terminal-Bench 2.0 and OSWorld, comparing code, prompted and IHR-executed versions of each harness, then adding one module at a time.
What they found.
- On Live-SWE, the IHR-executed NLAH scored 73.0 against 67.0 for the native code harness and 77.0 for the same text used as a plain prompt; on OSWorld it scored 46.3 against 47.1 for code.
- The policy shrank from 60.1k tokens of code to a 2.9k-token NLAH for Live-SWE, and from 10.5k to 0.8k for MHTBA.
- With file-backed state added, SWE rose from 73.0 to 75.6 and OSWorld from 44.4 to 58.3. Multi-candidate search raised agent calls from 1.1 to 5.7 on SWE and lowered the score to 71.4.
Limits. The authors name natural-language imprecision as the main limit.
Takeaway. Modules that keep state and evidence explicit helped most, while extra branching cost more calls without a matching gain.
Harness as a Language: A Minimalist Agent Framework With Maximal Expressivity
Connects to Part 2 (the loop), Part 18 (self-improving harnesses)
JAZ, a minimal harness built on one primitive called invoke, matched or beat specialised memory and self-improvement harnesses with prompting alone.
The problem. Long-term memory and self-improvement are usually added as specialised systems on top of the agent loop. The authors ask how far a near-bare loop can go.
What they did. JAZ exposes one primitive, invoke, which calls an LLM that writes code in a Python REPL (an interactive interpreter). That code can call invoke again, and everything the model sees, including its history, is a REPL variable. Hooks add logging, return checks and budgets. For memory, a context-warning hook tells the agent to hand remaining work to a sub-agent. For self-improvement, a meta-agent edits prompts and tools between task batches.
- invokethe model writes code in a Python REPL
- Code calls invoke againeverything the model sees is a variable
- Optional hookslogging, return checks, budgets
- Long recallhand work to a sub-agent when context runs out
- Self-improvementthe top-level invoke edits sub-agents' prompts and tools between batches
from jaz import invoke
from jaz.hooks import ReturnType
# Simple task
result = invoke(
ReturnType(int),
task="Calculate the factorial of 10",
)
# With custom inputs
result = invoke(
ReturnType(list),
task="Double each number in the list",
numbers=[1, 2, 3, 4, 5]
)How they tested it. GPT-5.4 nano on StuLife (939 graded tasks, 207 needing far recall; 3 runs) and AppWorld (417 tasks; GPT-5.4 as meta-agent; 6 runs for self-improving methods).
What they found.
- On the 207 far-recall StuLife tasks, JAZ invoke scored 69.9% pass rate against 61.8% for Letta (MemGPT) and 32.0% for CodeAct with sub-agents, at $18.3 against $42.1 for Letta.
- On AppWorld, JAZ invoke reached 74.2% task goal completion against 69.9% for ACE and 71.1% for CodeAct with sub-agents.
- ACE (an earlier method that learns from past tasks) cost about 10 times more per task to learn than JAZ invoke, so the authors let it learn only on the first 42 tasks.
Limits. No limitations section. Evidence comes from two benchmarks and one model family, and ACE learned from only 10% of tasks.
Takeaway. An expressive loop with prompting reproduced memory and self-improvement behaviour that specialised harnesses were built for, at lower cost.
What these papers show together
These papers share the picture from Section 1: an agent is a model plus a harness, and the harness can be described in parts, though each paper names the parts a little differently. The two papers with experiments both found that a lighter harness can match a heavier one: rules written as a plain-text document scored close to the same harness in code, and JAZ's single invoke primitive matched or beat specialised harnesses. Both used few models and benchmarks, so read them as a direction to explore.
Up next Section 4: Does the harness matter? Measuring it
Section 4 Does the harness matter? Measuring it
Leaderboards usually credit the model for a score. If the harness matters too, a fair comparison has to say how much, and in what way. These seven papers measure it: what changes when only the harness changes, and which measures tell you more than one pass rate.
Builds on Part 15 (does the harness matter), Part 16 (run-to-run differences), Part 20 (open questions)
What Does a Harness Buy? Tokens, Mostly
Connects to Part 15 (does the harness matter), Part 16 (run-to-run differences)
Seven models were run in three coding harnesses with reruns; swapping the harness changed about as many task outcomes as rerunning, but changed cost a lot.
The problem. Studies report large score gaps between harnesses, mostly from single runs. The paper tests whether a swap moves a pass rate more than a rerun.
What they did. They ran three production harnesses as shipped (Claude Code, mini-SWE-agent and OpenCode), which differ in system prompt, tools, history handling and steps. They used a rerun (same model, harness and tasks) as the yardstick and counted flipped tasks (pass in one run, fail in the other). Runs were offline.
- 1Seven modelseach run in three shipped harnesses
- 2Rerunsame model, harness and tasks again
- 3Comparetasks flipped by a harness swap vs by a rerun
- 4Costsame model and tasks, different harness
How they tested it. Seven models, including Qwen3.8-27B, on SWE-bench Verified split into hard45 (45 tasks) and pool447 (445 scored), plus SpreadsheetBench Verified and DABstep.
What they found.
- On hard45 each harness has the top pass rate for some model, and averaged over seven models no pair differs.
- On pool447, eight of twelve single-model harness differences are within 5 points, and a harness swap and a rerun each change 13% of hard45 tasks at the median.
- Some pairings differ: OpenCode trails by 8 to 9 points with Qwen3.8-27B on pool447 but leads mini-SWE-agent by 14 with DeepSeek-V4.1-Flash on hard45.
- For the same model and tasks, the most expensive harness costs under 10% more than the cheapest on some models and 3 to 4 times as much on another.
Limits. The two other benchmarks used one model, and one run over 445 tasks does not reliably detect a difference below about 5 points.
Takeaway. The authors recommend reporting a rerun of the same configuration next to every harness difference.
An Empirical Study of Harness Design for Coding Agents
Connects to Part 8 (history), Part 15 (does the harness matter)
Controlled ablations of context management, planning and tool set in one coding harness show each component's effect depends on model, budget and task.
The problem. Harnesses are usually compared whole, so a score gap does not show which component caused it. The authors ask when each helps.
What they did. They built a small ReAct-loop harness and varied three parts. Planning is a persistent plan. The action space is predefined tools or bash only. Context management has five tiers: T0 none, T1 hides stale tool output (masking), T2 also stores it so it can be recalled, T3 uses LLM summaries, and T4 hides first, then summarises.
- 1One small loopa fixed ReAct harness
- 2Change one partfive history tiers at four context budgets; planning or bash-only at 128k
- 3176 settingsfour models, SWE-Bench Verified and Terminal-Bench 2.1
How they tested it. Nemotron-3 30B, 120B, 550B and Mistral-Medium-3.5-128B on SWE-Bench Verified (500 tasks) and Terminal-Bench 2.1 (89 tasks); 176 settings.
What they found.
- Without context management, overflow failures fell from 78.7% to 8.7% on SWE-Bench as the window grew from 32k to 128k; managed tiers had none, and their success gain shrank from 35.7 to 2.7 points.
- T4 had the lowest cost in seven of eight model-benchmark panels at similar success. Adding recall (T2) beat T1 in 15 of 32 comparisons and lost in 14.
- Planning raised Nemotron-3 30B success by 11.6 points on SWE-Bench; for 550B and Mistral it cut cost about 30% and 32%, with success 2.0 and 0.4 points lower.
- For Nemotron-3 550B, bash-only raised success 3.6 and 5.6 points on SWE-Bench and Terminal-Bench and cut cost 53% and 30%.
Limits. Planning and action space were tested only at T4 with 128k. Each setting ran once; many Terminal-Bench differences are not statistically significant.
Takeaway. No component was a default win here; the right choice depended on the model, the task and the budget.
The Harness Effect: How Orchestration Design Sets the Token Economics of Enterprise Agentic AI
Connects to Part 9 (prompt cache), Part 17 (efficiency checklist)
Engineers at Writer swap a conventional agent loop for their own harness across six models; cost per task falls 41% while quality stays level.
The problem. The software around the model decides how many tokens each call in an agent loop uses. The authors ask whether the harness can lower token use.
What they did. The Writer Agent Harness replaces a baseline loop that replayed a roughly 49 KB system prompt every turn. It keeps a byte-stable prompt prefix so the prompt cache hits, and folds old history into a typed checkpoint at 80% of the input budget. Large tool output goes to files, and long reading to sub-agents. Waiting is a suspended job, not polling.
- 1Same six models22 locked tasks
- 2Swap only the loopbaseline replays a ~49 KB prompt each turn; the harness keeps a cached prefix and checkpoints history at 80%
- 3Measurecost, time, tokens and quality per task
How they tested it. Six models (Claude Sonnet 4.6, Gemini 3.1, Gemini Flash 3.5, Qwen 3.6, GLM 5.1, Palmyra X6; no sizes given) ran 22 locked tasks under both loops.
What they found.
- Against the frozen baseline, cost per task fell from $0.21 to $0.12 (41%), median time from 48 s to 27 s (44%), and tokens from 14.2k to 8.8k (38%).
- Quality score moved from 0.78 to 0.81, which the authors read as parity at 22 tasks.
- Every model's cost fell by 33% to 61%. A model's quality gain tracked its baseline score almost exactly (correlation r = 0.99 over six models).
- Completions per million tokens rose from 54.9 to 92.0.
Limits. 22 tasks are too few to judge quality, and the baseline ran once. The authors work at Writer, the harness maker.
Takeaway. On this workload, changing the loop moved cost more than changing the model, so tokens per task is worth tracking beside quality.
It’s Not the Capability: Harness Sensitivity Is Non-Monotone Across LLM Agent Tiers
Connects to Part 7 (instructions), Part 15 (does the harness matter)
A 432-run test of three prompt harnesses on six models finds no single best level: strict helps one reasoning model and hurts one chat model.
The problem. Teams often assume stricter harnesses help every model and stronger models need less. The author tests whether capability tier predicts the best harness.
What they did. Here the harness is only the system prompt (instructions plus the checks it asks for). Light is two lines, a role and the task. Balanced adds a four-step template (plan, execute, check, respond) and an allowed-file list. Strict adds six stages (preflight to report), success criteria, and a verification spec.
- 1Three system promptslight, balanced, strict
- 2Six modelsacross four capability tiers
- 324 tasks checked with git432 runs in total
How they tested it. Six models (Gemini 2.5 Flash, Qwen3.5-122B-A10B, GPT-OSS-120B, Qwen3.5 2B, LLaMA 3.2 3B, Gemma4:e2B) on HEAT-24, 24 synthetic tasks checked with git, one repeat each.
What they found.
- Gemini 2.5 Flash scored 95.8% verified task success (VTSR) under light, 58.3% under balanced and 66.7% under strict; all of its failures under the two stricter prompts were format violations.
- Qwen3.5-122B (extended thinking on) scored 87.5%, 75.0%, and 91.7%, and ran faster under strict (23.3 s against 35.4 s).
- Qwen3.5 2B scored 0.0%, 58.3%, and 4.2%.
- Gemma4:e2B scored 91.7% under all three.
Limits. Each tier has one model and each cell one repeat, so the author calls the results model-specific and preliminary.
Takeaway. In these tests the best prompt harness differed by model, so probing the target model comes before one template for a fleet.
Scaling Laws for Agent Harnesses via Effective Feedback Compute
Connects to Part 17 (efficiency checklist), Part 20 (open questions)
The paper proposes Effective Feedback Compute, a count of useful tool feedback, and reports that it predicts harness success better than tokens or cost.
The problem. Raw tokens, tool calls, or wall time cannot tell useful feedback from repeated or unstable interaction. The authors look for a better scaling quantity.
What they did. Effective Feedback Compute (EFC) credits feedback only if it is informative, valid, non-redundant, and retained. EFC divided by raw cost gives harness efficiency; divided by task demand it gives sufficiency. EFC-Adapter is a control layer added to an existing harness. It scores each feedback action by expected gain per unit cost, keeps useful feedback in memory, and stops or rolls back low-value loops (memory, checks, and stopping rules).
- 1Read each tracethe tool feedback in a run
- 2Count useful feedbackinformative, valid, non-redundant, retained
- 3Predict successcompared with raw tokens or cost
- 4EFC-Adapterkeeps useful feedback, stops low-value loops
How they tested it. Seven harness families with DeepSeek-V4-Flash, gpt-5.4-nano, and Claude-Haiku-4.5 (sizes not given), on synthetic tasks, code tasks, and subsets of HumanEval, Terminal-Bench 2.0, and SWE-bench Verified.
What they found.
- In controlled tests, EFC predicted success with R² = 0.99 (1.0 is a perfect fit). On real traces, NRS-EFC (retained, non-repeated feedback) reached R² = 0.93, where raw compute fit near zero or worse.
- Improving feedback quality raised success from 0.27 to 0.90 without changing raw cost or tool calls.
- Under matched settings, EFC-Adapter raised mean pass rate from 61.2% to 68.2% and cut mean raw cost from 213.8 to 85.1.
Limits. The real-benchmark layer uses subsets meant to test scaling-law fit, not to estimate absolute benchmark scores.
Takeaway. Useful, retained feedback predicted success better than spend, which suggests logging feedback quality beside cost.
Model or Harness? An Interaction-Centric Taxonomy for Localizing Agent Failures
Connects to Part 15 (does the harness matter), Part 20 (open questions)
The paper proposes 41 agent failure modes, each tied to a pair of components and a fault side, and checks them with four LLM judges.
The problem. A label like 'task failed' does not say whether the fix belongs in the model, harness, environment, or benchmark. The authors want labels that say where a failure started.
What they did. The harness is one component beside the model, users, and environment. Each failure mode sits on an edge between two components and carries a fault side saying where the repair belongs. A failure is model-side when a more capable model could have avoided it. Harness-side modes point to scaffolding fixes, for example context compaction that removes a user instruction.
- 1A failurefrom a run, report or system card
- 2Find the edgethe interaction between two components
- 3Fault sidewhere the repair belongs
See Figure 1 from the paper

How they tested it. Worked examples come from public benchmarks, system cards, reports, and logged trajectories. Four judge agents (GPT-5.5, Claude Opus 4.6, 4.7, 4.8) tried to recover the human labels on 40 examples.
What they found.
- On category labels, agreement with the human annotator (Cohen's kappa, where 1.0 is perfect agreement) was 0.76 for GPT-5.5 and 0.70 to 0.71 for the three Opus models.
- Full failure-mode labels were harder: accuracy was 0.62 to 0.72.
- Labeling only when judges agree: three of four gave 0.83 category precision at 90% coverage; all four gave 0.96 at 68%.
- Most failure modes fall on the model side, which the authors partly link to their attribution rule.
Limits. The taxonomy does not estimate how often each failure happens, and judge accuracy stays limited, especially for failure modes.
Takeaway. A harness builder can sort failures by fault side first, then decide whether the fix belongs in the harness, the model, or the benchmark.
Automata from Agent Traces: Failure and Next-Step Prediction
Connects to Part 11 (guides and sensors), Part 15 (does the harness matter)
The paper builds small finite-state machines from agent traces and uses them to predict the next step and task failure on twelve public datasets.
The problem. Long, unstructured traces are hard to audit or monitor. Existing methods look at one trace at a time or at successful runs only.
What they did. The paper adds a sensor, not a new loop. It builds a finite-state machine (FSM, a graph of states and allowed moves) from many traces with a prefix tree, merges states by last activity, and filters rare transitions. The FSM can be given to an agent as context. Per-state features feed a failure predictor and an online monitor with early stopping.
- 1Many tracestwelve public datasets
- 2Small state machinestates and allowed moves, 7 to 43 states
- 3Use itas agent context, or to predict failure early
How they tested it. Twelve public datasets, among them SWE-smith, SWE-agent, WebArena, AgentNet, and tau2-bench. tau2-bench traces come from four LLMs.
What they found.
- The FSMs have 7 to 43 states and at least 0.997 test fitness, and are 15 to 3,036 times smaller than machines built by RPNI, a standard method that learns a state machine from example runs.
- As context, the FSM beats Agent Workflow Memory at next-step prediction on all eight ground-truth-matched datasets, six of them with a statistically significant gap.
- Per-state features predict task failure with AUROC up to 0.941 on held-out runs (1.0 means every failing run is ranked above every passing one; 0.5 is chance).
- Base rates matter: on SWE-agent 84.3% of runs fail, so flagging every run already scores F1 0.914 (F1 is high only when a monitor catches most failures with few false alarms), slightly above the two-rule monitor's 0.904.
- One FSM built from four LLMs' tau2-bench traces replays each at 1.000 fitness.
Limits. The FSM describes observed traces, not the agent's generating process, and activity extraction needs per-dataset knowledge, so the scope is structured tool-call interfaces.
Takeaway. In these datasets, a small graph of tool-call types carried enough structure to monitor runs.
What these papers show together
Three findings repeat. First, success changes less than people expect: in What Does a Harness Buy?, a harness swap changed about as many of the hardest tasks as a plain rerun. Second, cost changes a lot, both in that study and when Writer changed only the loop. Third, the best harness depends on the model. A stricter prompt helped one model and hurt another, and in the controlled study no part (planning, tool set, history rule) was a win everywhere. The other papers offer measures beyond a single pass rate: counting useful feedback, labelling where a failure started, and building a map of behaviour from many runs. Most of these studies use few runs or few tasks, which their authors state.
Up next Section 5: What the model reads: tools, search and history
Section 5 What the model reads: tools, search and history
Every call starts with what the model reads, and Part 4 showed that most of it is setup. These seven papers test those inputs one at a time: which search tool to give, how its results reach the model, how the history is kept, and who decides what to forget.
Builds on Part 4 (what the model reads), Part 6 (tools), Part 8 (history), Part 9 (prompt cache)
Is Grep All You Need? How Agent Harnesses Reshape Agentic Search
Connects to Part 6 (tools)
A study of grep versus vector search inside four agent harnesses: grep usually won, and moving to another harness changed accuracy about as much as swapping the search tool.
The problem. Retrieval is usually compared in a fixed pipeline. The authors ask how grep (exact text match) versus vector search (match by meaning) interacts with the harness and with how tool results reach the model.
What they did. The study varies three things. The search tool is grep or vector. The harness is a custom one called Chronos, Claude Code, Codex CLI or Gemini CLI. The result is either put inline in the context or written to a file the model must open. A second experiment adds unrelated sessions as noise.
- 1Search toolgrep or vector search
- 2HarnessChronos, Claude Code, Codex CLI or Gemini CLI
- 3Result pathinline in the context, or a file to open
- 4Score, then add noise116 LongMemEval-S questions; then more unrelated sessions mixed in
How they tested it. Five models (Claude Opus 4.6, Claude Haiku 4.5, GPT-5.4, Gemini 3.1 Pro, Gemini 3.1 Flash-Lite; sizes not given) on 116 LongMemEval-S questions, graded by GPT-4o. Ten harness-model pairs.
What they found.
- Inline, grep beat vector in all ten harness-model pairs. The widest gap was Chronos with Gemini 3.1 Flash-Lite (86.2% vs. 62.9%).
- Claude Opus 4.6 scored 93.1% under Chronos and 76.7% under Claude Code (inline grep).
- With file-based delivery, vector beat grep on five of ten pairs. Codex with GPT-5.4 fell from 93.1% (inline grep) to 55.2% (file-based grep).
- With unrelated sessions added, both methods degraded little and grep stayed ahead on average.
Limits. The authors tie the results to long-memory chat questions with exact-text answers and do not claim grep beats vector in general.
Takeaway. Results depended on the harness and on how results reached the model, so a retrieval comparison should report both.
Context as Infrastructure: Knowledge Compilation for Retrieval in Agentic Systems with Harnesses
Connects to Part 6 (tools), Part 8 (history)
Compiled claim-evidence pairs in a RAGFlow search harness cut query tokens 38% on average on FRAMES, with no detectable accuracy gain.
The problem. A search harness with only BM25 (keyword ranking) and grep already answers most questions, but its loop repeats queries and fills the window with unused passages.
What they did. Knowledge compilation: before any query, an LLM turns documents into artifacts such as a tree whose leaves are atomic claims with verbatim evidence. At query time, five stations run: capability check, evidence prefetch, evidence gate, tool loop, deterministic close. If the gate judges the evidence sufficient, one model call answers; otherwise the block is discarded. A step limit and wall-clock budget bound the loop.
- 1Compile firstdocuments become claims with verbatim evidence
- 2Capability checktools for compiled artifacts shown only if the corpus has them
- 3Prefetch and gateenough evidence: one model call answers
- 4Not enough evidencediscard it and run the tool loop
- 5Deterministic closeif the loop ends abnormally, answer from the evidence in hand
// Two consumers, one rule ("compiled first, raw chunk only when it is not
// enough"):
//
// - the pre-loop probe: one search, an answer call over the claims it found,
// then a verification of that answer. An answer that survives verification
// ends the turn without a chunk ever being read; one that does not is dropped
// and the ordinary loop runs, because a multi-hop question's second fact
// lives in a document the question's own wording never reaches and the loop
// is the only place that decides what to search next.
// - every locate tool result: the claims compiled from THAT result set's
// chunks are rendered ahead of the hits, so a mid-loop search can be
// answered without list_chunks. Claims the run has already shown are not
// repeated.How they tested it. MiniMax M3 (size not given) on BrowseComp-Plus (baseline check) and FRAMES, a multi-hop benchmark. Token results use 200 FRAMES questions; the latency comparison uses 7. Single runs.
What they found.
- BM25 plus grep alone reached 85% on BrowseComp-Plus and 91% on FRAMES; the authors say the two are not comparable.
- Summary trees, outlines, wikis, and graphs gave no detectable accuracy gain on FRAMES.
- Claim-evidence leaves cut query tokens by 91% when evidence sufficed and added 1.9% when not, 38% on average. Compiling pays off when evidence suffices for more than about 2% of questions; it sufficed for about 43%.
- On seven paired questions, tokens roughly halved while latency roughly tripled.
Limits. One benchmark, one compiler model, no confidence intervals or repeated seeds; FRAMES is English and Wikipedia-based.
Takeaway. Fetching compiled evidence first saved tokens without a measurable accuracy loss, but cost retrieval rounds and latency.
PRO-LONG: Programmatic Memory Enables Long-Horizon Reasoning
Connects to Part 8 (history)
PRO-LONG gives a coding agent a searchable log of its past; on ARC-AGI-3 it matched or beat specialized harnesses while using 4.2 to 5.8 times fewer tokens.
The problem. On long exploratory games, an agent must decide what to save and how to load it into context. Keeping more usually makes details harder to find.
What they did. PRO-LONG changes the memory of a plain coding agent (an LLM looping with a shell and files). Writing appends every observation, action, and outcome to a log, with no summarizing. Reading is code: the agent greps or runs Python over the log. There are no sub-agents or vector index, and the prompt is about 30 lines.
- 1Log everythingevery observation, action and outcome
- 2Search it with codegrep or Python over the log
- 3Acta plain coding agent, no sub-agents
SYSTEM_PROMPT = """\
You are a coding agent playing a grid-based puzzle game by writing Python action plans.
Your primary objective is to solve all levels in the game. Your secondary objective is to minimize total cumulative actions used.
`/workspace/logs.txt` is the game log: action headers, tool calls, board states, and your own prior analyses. {log_window_desc} Parse it **programmatically**, as reading full 64x64 board states from prompt can introduce precision errors.{cross_turn_hint}
**Tools**: Read, Write, Edit, Bash, Grep, Glob.
**Workspace**: `/workspace/` persists across calls. `actions.json` is cleared each call; other files accumulate. Feel free to save notes, state, or helper functions.How they tested it. ARC-AGI-3 public games (25) with GPT 5.5, Opus 4.6, and Fable 5 (sizes not given), 500 actions per game. NetHack with GPT-5.6 plus Codex and Kimi plus Mini-SWE, five episodes per lifetime.
What they found.
- Against the same agent without a log, ARC-AGI-3 pass@1 rose by 15.7 to 21.0 points across the three models.
- On Codex it scored 41.2 pass@1 against WorldModeler's 45.1 with 5.8x fewer tokens; on Claude Code, 82.1 best@2 against Schema's 84.4 with 4.2x fewer.
- File reading alone scored 23.1%; grep added 4.1 points and Python more than ten.
- On NetHack the best episode reached 25.7%, against 20.6% for the best published.
Limits. The authors note large variance across game runs, so they report best@k, and that two models postdate ARC-AGI-3.
Takeaway. A complete log plus code to search it carried most of the gain; note-taking tools added little.
Harness-1: Reinforcement Learning for Search Agents with State-Externalizing Harnesses
Connects to Part 8 (history)
Harness-1 trains a 20B search agent with reinforcement learning while the harness keeps its search state, reaching 0.730 average curated recall on eight benchmarks.
The problem. Search agents usually learn both how to search and how to remember what they saw, in a growing transcript. The authors argue the bookkeeping part can be done more reliably by the environment.
What they did. The harness keeps a per-episode working memory: a candidate pool, a tagged curated set, evidence links, verification records, and compressed, deduplicated observations shown within a budget. The model, trained with RL, still decides what to search, keep, verify, and when to stop.
- The harness keeps statecandidates, curated set, evidence, checks
- The model decideswhat to search, keep, verify, and when to stop
- Trained by RLa 20B model, trial and reward
See Figure 2 from the paper

ALL_TOOL_SCHEMAS = [
SEARCH_CORPUS_SCHEMA, GREP_CORPUS_SCHEMA, READ_DOCUMENT_SCHEMA,
MULTI_TOOL_USE_SCHEMA,
FAN_OUT_SEARCH_SCHEMA, CURATE_SCHEMA, END_SEARCH_SCHEMA,
REVIEW_DOCS_SCHEMA,
]
if V8D_VERIFY_TOOL:
ALL_TOOL_SCHEMAS.append(VERIFY_SCHEMA)How they tested it. A 20B model (gpt-oss-20b base) on eight retrieval benchmarks, scored by curated recall (relevant documents in a returned set of at most 30). Baselines include Tongyi DeepResearch 30B and frontier models.
What they found.
- Harness-1 reached 0.730 average curated recall, 11.4 points above the next open subagent. Only Opus-4.6 among frontier retrievers was ahead on average.
- On four benchmarks held out of training, gains over the closest open baseline averaged 17.0 points, against 7.9 on the four source-family benchmarks.
- It used 4,352 unique training items; Context-1 used 9,159 unique RL queries.
- Disabling importance tags at inference on BrowseComp-Plus lowered recall by 4.1% (relative).
Limits. Tests cover evidence-seeking retrieval, not breadth-oriented research or adversarial web settings. The evidence graph uses a regex extractor.
Takeaway. Moving bookkeeping into the harness went with larger gains on unseen benchmarks.
AutoCompact: Learning When to Compact Context in Long-Horizon Coding Agents
Connects to Part 8 (history)
AutoCompact trains a coding agent to choose when to compact its context and what to keep; pass rates rose 9.2 and 5.0 points.
The problem. In long coding runs, earlier exploration goes stale. Compacting only when the window is nearly full ignores task progress, and a summary can drop key facts.
What they did. The harness gives the agent a compact() action (history compaction). During data collection, a judge reviews each compaction decision, the summary, and the following actions, and replaces flawed ones before they run. The model is fine-tuned on these runs, then trained with RL using only pass or fail.
- 1Agent runswith a compact() action
- 2A judge reviewscompaction choices and summaries; flawed ones are fixed
- 3Trainfine-tune, then RL on pass or fail
See Figure 1 from the paper

How they tested it. Qwen3-Coder-30B-A3B-Instruct on SWE-bench Verified and SWE-PolyBench Verified, averaged over three runs, with 1,052 judge-corrected training trajectories. Cost tests used per-task budgets from $0.10 to $4.00.
What they found.
- Pass rates rose from 30.4% to 39.6% on SWE-bench Verified and from 19.5% to 24.5% on SWE-PolyBench Verified, against the full-history base.
- Judge-guided SFT alone beat SWE-Compressor (offline-inserted compaction) by 1.2 and 1.6 points; RL added 7.4 and 2.8 more.
- After RL the agent compacted on 58.5% of tasks (44.3% after SFT), and summaries missing key state fell from 3.1% to 0.2%.
Limits. RL used 32K-token sequences against a 256K evaluation window, and the study covers one scaffold.
Takeaway. Training the model to time and write its own compaction beat compacting at a fixed length.
Evolving Agent Interfaces
Connects to Part 6 (tools)
Agent S4 evolves interfaces for a computer-use agent from synthetic task runs; Qwen3.8-27B with them reaches 21.30% binary success on OSWorld V2.
The problem. Computer-use agents act through interfaces that humans design by hand and fix before the task starts. The authors ask whether the interfaces, and the knowledge of when to use each, can be built from the agent's own experience.
What they did. Agent S4 changes the tools and instructions of the harness. A repository holds interfaces (GUI actions, file operations, application workflows) plus notes on when to use them. A meta-agent reads trajectories (recorded runs) from synthetic training tasks, without success labels, and writes new repositories by mutation or crossover. Parents are chosen by scores on validation tasks the meta-agent never sees. The task agent's model and harness stay fixed.
- 1Runs on practice taskssynthetic tasks, no success labels
- 2Meta-agentreads the runs, writes new interface repositories
- 3Selectby score on validation tasks it never sees
- 4Task agentsame model, new interfaces
See Figure 3 from the paper

A mutation runs these steps:
1. A tournament picks the parent (`tournament.py`).
2. The parent is checked out, and its task trajectories are staged for the
Builder to read.
3. Optionally, a scratch VM is started (`scratch_vm.py`) so the Builder can
try things in a live app.
4. The Builder harness edits `shadow_interface/`. For OSWorld-V2 and
ScienceBoard it runs inside a Landlock sandbox, because the Base checkout
next to the clone holds the benchmark's gated evaluators.
5. Edits outside the allowed scope are reverted, and the child is tagged
`evol/<island>/if-NNN`.
6. The evaluator harness runs the child on the train and val splits. The
per-task results, scores and costs go into the database.How they tested it. Qwen3.8-27B on OSWorld V2 (108 tasks) and ScienceBoard (169 tasks), with 30 descendant repositories per search run.
What they found.
- On OSWorld V2, the evolved repository (no scratch virtual machine) reached 21.30% binary success at $1.10 per task. The same model scored 5.56% with the fixed Qwen CUA (computer-use agent) interface, 15.74% in Agent S4's harness with no repository, and 19.44% with the seed repository; evolution then raised it to 21.30%.
- In the same table, GPT-5.5 scored 13.00% at $25.50 per task and Claude Opus 4.8 (batched) 20.60% at $72.40.
- On ScienceBoard, an evolved repository reached 58.58%, against 41.4% for Qwen CUA and 55.03% for the seed (starting) repository.
Limits. The paper has no limitations section. Long computer-use tasks vary from run to run, and OSWorld V2 skipped repeated validation because of cost, and its 108 tasks include the 15 validation tasks used to pick the repository.
Takeaway. Most of the gain came from Agent S4's harness and seed repository; evolution added the smaller final step.
JevAgentHarness: Benchmarking, Deploying and Training Decision Models That Share Control with LLMs
Connects to Part 2 (the loop), Part 17 (efficiency checklist)
A harness hands routine multiple-choice steps to a small decision model when it is confident; a fitted threshold keeps task success while cutting cost.
The problem. Harnesses call a large LLM at every step, which is slow and costly, yet most calls end in a multiple-choice decision such as which tool to call next. The authors ask how to hand them to a cheap model without losing success.
What they did. JevAgentHarness changes the decision step and the guards in the loop. Each routine choice goes to a decision model as a typed multiple-choice question; it returns a probability per option. The answer is used only when confidence passes a threshold fitted on the agent's own trajectories; otherwise the LLM decides. The authors also train AgentDecision-4B on states the agent reaches.
- 1A routine choicee.g. which tool next, as multiple choice
- 2Small decision modela probability for each option
- 3Confident enough?threshold fitted per choice on the agent's own runs; below it the LLM decides
- 4Train AgentDecision-4Bon states the agent reaches after its own mistakes
tiers:
strong: {upstream: gemini, model: gemini-4-argon, effort: high}
fast: {upstream: gemini, model: gemini-3.8-flash, effort: low, cache: explicit}
lite: {upstream: gemini, model: gemini-3.5-flash-lite, effort: low}
router:
decision: {type: jev, provider: openrouter}
tau: 0.5
first_steps_strong: 1
stick_strong: 0
max_fast_streak: 0
verify_finish: true
on_error: strong
decision_timeout_s: 8How they tested it. Gemini 3.5 Flash as agent LLM with Jev as decision model, on DecisionGym, tau2-bench and ALFWorld.
What they found.
- The top model on isolated questions (StartLux-9B, 92.2% on BFCL) solved 69.5% of agent tasks. AgentDecision-4B scored 89.3% on BFCL but solved 91.5%.
- Letting Jev make every tool choice lost 19.0 points of success. The fitted threshold cut cost by 14.2% without changing the outcome of any of 500 tasks.
- With AgentDecision-4B on its own GPU, the DecisionGym agent was 86.3% cheaper and 2.5 times faster, with success 0.5 points higher.
Limits. Coding harnesses saved 7.0 to 10.5%, and a new agent needs refitted thresholds.
Takeaway. The fitted threshold kept success when steps moved to a small model, and isolated accuracy did not predict which model worked.
What these papers show together
Simple tools do well inside a good harness: plain grep beat vector search when results went straight into the context, and a search harness with only BM25 and grep did well on BrowseComp-Plus. How a result reaches the model matters too: when results went to a file instead, grep lost its lead. On history, the papers move away from fixed rules. PRO-LONG keeps everything and lets the agent search it with code, Harness-1 moves bookkeeping into the harness, and AutoCompact trains the model to decide when to compact. Two papers change the tools themselves: Agent S4 writes new interfaces from the agent's own runs, and JevAgentHarness hands routine choices to a small model when it is confident. Several papers report token savings; Part 9 explains why fewer tokens do not always mean a lower bill.
Up next Section 6: Rules, guards and checks
Section 6 Rules, guards and checks
An agent that never checks its work repeats the same mistakes, and a check that trusts the agent's own word misses them. These five papers look at the parts that steer and check: the rules it reads, checks before an action runs, and reviews after the work is done.
Builds on Part 7 (instructions), Part 10 (guards), Part 11 (guides and sensors)
Harness-IF: Evaluating Instruction Following Across Instruction Surfaces in Coding Agents
Connects to Part 7 (instructions)
Harness-IF scores coding agents on one rule at a time across instruction surfaces; all 12 models do worse on rules that oppose their defaults.
The problem. When a coding agent obeys a rule, it may simply have been going to do that anyway. Existing benchmarks put rules in the user turn or score only final task success.
What they did. The paper studies the instructions part of the harness. It names six surfaces where rules reach an agent: harness default, system prompt, tool description, skill description, project file (such as CLAUDE.md) and user instruction. Each rule gets a pass, fail or not-applicable verdict from execution evidence. Against-Prior Accuracy (AP-Acc) scores only rules that oppose what the model does unprompted, found by re-running tasks with the rule withheld.
- 1One ruleon one of five configurable surfaces: system prompt, tool, skill, project file, user turn
- 2Agent runsa multi-turn coding task
- 3Verdictpass, fail or not applicable, from execution evidence
- 4Rule withheldrerun to find rules that go against habit
How they tested it. 12 frontier models on 60 multi-turn coding items from a 642-rule library, 256 rules scored, 2,160 runs. A conflict pilot used nine older builds.
What they found.
- Accuracy ranged from 72.1% to 85.9% and AP-Acc from 66.1% to 78.6%. Every model scored lower on against-prior rules, by 3.6 to 7.4 points (mean 5.81).
- Prior control left the top build unchanged and exchanged three adjacent rank pairs.
- In the conflict pilot, system prompts, project files and user instructions tied for the best mean rank (2.22), ahead of tool descriptions (3.78) and skill descriptions (4.56).
Limits. An LLM judge scores 86.8% of verdict rows, and agreement falls to 62.1% under a judge swap, so the model order is read as a point ranking.
Takeaway. An overall score hid a model-specific gap on rules that go against a model's habits.
Rethinking Verification in Agent Harnesses
Connects to Part 11 (guides and sensors)
The paper compares 17 ways to add verification to a coding harness; a separate critic that reviews the work gave the best accuracy for its cost.
The problem. Little evidence shows when a harness should check an agent's work, who should check, and whether the extra compute pays off.
What they did. The authors sort verification into four layers. L0 puts checking instructions in the first prompt, and L1 sends reminders during the run. L2 is a completion gate that asks the agent to recheck or rejects its finish. L3 is independent review: a separate critic, in a fresh context with the live sandbox, runs its own checks and returns findings for the agent to fix. These change instructions, stopping and sensors.
- L0: first promptchecking instructions
- L1: remindersduring the run
- L2: completion gaterecheck, or reject the finish
- L3: independent reviewa separate critic, fresh context, live sandbox
See Figure 1 from the paper

How they tested it. Seven coding models, including Qwen3.7-Max, on subsets of Terminal-Bench (TB) and SWE-bench Verified (SWE), three trials per task, with Qwen3.7-Plus as critic.
What they found.
- L3 review raised average accuracy by 5.9 to 9.5 points on TB and 3.9 to 6.6 on SWE, at 1.13 to 1.25 times baseline cost on TB and 1.00 to 1.04 times on SWE.
- L2 rejection gates cost 1.60 to 1.76 times baseline on TB and 1.48 to 1.56 times on SWE; automated rejection gained +4.0 on TB and +5.3 on SWE.
- A system-role instruction (L0) gave +3.3 on TB and +3.9 on SWE, against +1.2 and -1.1 as a user message.
Limits. The tests use task subsets of two benchmarks and one critic model for all seven agents.
Takeaway. A separate critic gave larger gains per unit of cost than prompt-level checks; giving it the full trajectory did not help consistently.
VeriHarness: Scaling Agentic Verification for Long-Horizon Tasks
Connects to Part 11 (guides and sensors)
VeriHarness lets a model check its own sampled outputs against the workspace; in the authors' tests it beat voting and judging baselines on five benchmarks.
The problem. Long-horizon agents produce reports and spreadsheets that are hard to check, and no stronger judge exists when the generator is already the best model.
What they did. The verifier is the generator's own model, placed in a harness with a workspace, evidence tools and reusable verification skills. From ten sampled rollouts, a disagreement resolver tests claims on which rollouts differ, and a consensus challenger looks for evidence against shared claims. Adjudication then picks a base artifact and revises it. This adds a sensor stage after the loop.
- 1Ten rolloutsfrom the same model
- 2Two checks at oncea disagreement resolver and a consensus challenger, in separate contexts
- 3Adjudicatea fresh context reads both records, picks a base artifact and revises it
See Figure 3 from the paper

You are deciding, not investigating. Two sessions examined the N candidates and neither saw the
other's work: `ledger_elim.json` holds the disagreements one of them worked and who came out
right; `ledger_fals.json` holds the positions all candidates share and whether each survived an
attempt to break it. You have neither session's context, and that is the point: only the two
records, spec/, workspace/ and the deliverables count. Read spec/ and both records first.
Both records are provisional. Check every entry you lean on: does what was checked actually
show what the entry says? Re-run a command when it matters. Weigh, do not count — one finding
on what the task asked for outweighs three on trivia. Prose is not evidence, a majority is not
evidence, and overturning either record needs a workspace or spec fact, not an argument.How they tested it. Gemini 3.5 Flash and Claude Opus 4.8, each as generator and verifier, on five workspace benchmarks, with ten frozen rollouts per task and three-run means.
What they found.
- Selection raised the average over a single rollout by 4.4 points with Flash and 4.1 with Opus, and beat every baseline in all ten model-benchmark settings.
- Adding evidence-backed revision raised the average gain to 6.2 points with Flash and 6.4 with Opus.
- An agentic verifier with the same workspace access but no protocol or skills recovered only about half of the gain.
- A case study found roughly a third of agreed values were incorrect, so voting keeps shared errors.
Limits. Every method gets ten rollouts per task, so the comparison is at equal generation cost, but the approach needs that pool.
Takeaway. Checking claims against the environment gave the gains here, and the same protocol also ran inside Gemini CLI, Claude Code and Codex.
Mid-Harness: Scaling Actions Between Model and Harness for Terminal Agents
Connects to Part 10 (guards), Part 11 (guides and sensors)
Mid-Harness samples several next commands and lets a verifier pick one before it runs; in the authors' tests, verifier quality decides the gain.
The problem. A poor terminal command, such as a wrong package install, can change the environment and hurt later steps even when the model could have written a better one.
What they did. Mid-Harness sits in the model-call wrapper, outside the unchanged harness loop. At each step the generator proposes N candidate actions, a verifier picks one, and only that action reaches the harness. The authors compare listwise, pointwise and pairwise verifiers, and distil a stronger verifier into the 9B model with LoRA (small trained add-on weights). It adds a check before each tool call.
- 1Propose N actionsthe generator samples candidate commands
- 2A verifier picks onelistwise, pointwise or pairwise
- 3Run itonly that action reaches the harness
See Figure 1(a) from the paper

How they tested it. TMAX-9B (trained from Qwen3.5-9B) on TerminalBench-Lite, 98 tasks with three runs each, plus 4B and 27B versions. GPT-5.6 Sol is the strong verifier.
What they found.
- With 8 sampled actions, a GPT-5.6 Sol verifier raised Pass@1 from 50.00% for the base agent to 68.03%; weak self-verification gained little.
- With the same 9B model as verifier, pairwise verification reached 54.76% Pass@1; distillation raised it to 57.14%.
- Distilled Mid-Harness plus Best-of-3 trajectories reached 66.33%, above Best-of-7 trajectories alone (59.18%), at lower estimated token cost.
Limits. Distillation leaves a gap to the frontier verifier (57.14% against 68.03%), and the authors lack gold action labels, so verification correctness is not measured directly.
Takeaway. Extra candidate actions pay off only when the verifier can tell them apart, so invest in the verifier before widening the sample.
Think Before You Act: Decision Gate for LLM Agents
Connects to Part 10 (guards)
JevAct checks selected tool calls against compiled policy checks before they run; in the authors' tests it helped most on Telecom and was mixed on Airline.
The problem. Agent loops often run a proposed tool call at once, so an unauthorized write or a premature hand-off can be hard to undo.
What they did. JevAct adds a check between proposal and execution in a ReAct loop (reason and act in turns) with the model, prompt and tools unchanged. Offline, an LLM compiles a domain policy into questions, rules and code over tool records. At runtime, code checks tool-state facts and a decision model, Kev, answers conversation questions with probabilities. A flagged call returns with feedback for up to two revisions. This adds a guard and a sensor.
- 1Agent proposesa write call or a hand-off; model, prompt and tools unchanged
- 2The gate checkscode over tool records; a decision model answers policy questions compiled offline
- 3Revise or runflagged: sent back with feedback, up to 2 revisions for writes and 1 for hand-offs; otherwise, or once the budget is spent, the call runs
How they tested it. Eleven agent LLMs, including Claude Opus 4.6 and GPT-4.1, on tau2-bench Airline (50 tasks), Telecom (114 tasks) and BFCL (800 entries), three runs, same model with and without JevAct.
What they found.
- On Telecom, all eight agents improved; pass@3 rose 16.0 points on average, and Opus 4.6 went from 39.5% to 80.7% pass^3 (all three runs solved).
- On Airline, success across all three runs improved for four agents and fell for two.
- In a one-trial Airline ablation with GPT-4.1, success rose from 50.0% without the gate to 72.0% with it; code checks alone reached 68.0%, and flagging every write without checking stayed at 50.0%.
Limits. The authors say the results do not isolate the judge's effect, and the Telecom gain did not appear with a gpt-oss-120b user simulator.
Takeaway. Much of the Airline gain came from executable checks, so a rule-based check may be a cheaper first guard than a model judge.
What these papers show together
Across these papers, checks paid off most when they were independent and grounded in evidence: a separate critic, claims tested against the workspace, a strong verifier for each command, and plain code checks before a tool call. Rules on their own were less reliable than they look, because models followed rules less often when a rule went against their habits.
Section 7 Long jobs
Some jobs do not fit in one session, and Part 13 showed one way to keep such a job on track. These two papers try two different ways for longer and larger work.
Builds on Part 13 (long jobs)
Harness-of-Harness: Multi-Day Autonomous Software Development with Continual Improvement
Connects to Part 13 (long jobs)
Harness-of-Harness (HoH) wraps an existing coding harness in repeated plan, code and test loops, and in the authors' tests it beat the plain harness on three benchmarks.
The problem. Building software from scratch without human help needs long runs, where agents lose requirements, repeat fixes, or stop too early.
What they did. HoH runs on top of an unchanged harness. Each loop has a planner, a developer with focused tests, and a tester that evaluates the system independently; the tester's report returns to the planner. Roles return structured artifacts, and a schema violation triggers a retry. Plans and reports sit in the file system behind a short index, not a memory module, and the project is versioned.
- 1Plannerupdates the plan
- 2Developerbuilds, with focused tests
- 3Testerevaluates the system independently
- 4Report backto the planner for the next loop
See Figure 3 from the paper

How they tested it. Codex with GPT-5.5, OpenCode with DeepSeek-V4-Pro and Pi with MiniMax-M3, against the same harness run once, on 45 GameCraft-Bench tasks, 15 FrontierSWE tasks and ProgramBench, plus a multi-day game build.
What they found.
- After three loops, GameCraft-Bench Overall rose from 49.58 to 71.52 for Codex, 26.90 to 48.98 for OpenCode and 42.16 to 58.78 for Pi.
- At matched passes, Codex Vanilla Continuation scored 58.24 after three passes; HoH scored 71.52, and HoH at two loops (64.84, 5.67M tokens) beat it with fewer tokens than its 6.33M.
- Removing plan updates, evidence feedback or warm-start lowered the three-loop score by 8.13, 6.28 and 7.85 points.
Limits. FrontierSWE uses 15 of 17 tasks because of compute limits, and the paper names only future work on other kinds of software.
Takeaway. Carrying a plan and test evidence across loops beat giving the same agent more passes, so loop structure mattered beyond extra compute.
Harness Engineering for Software Engineering via Modular Executable Dev-Primitives
Connects to Part 13 (long jobs)
HERMES gives each repository file its own resident LLM agent; in the authors' tests it raised resolution rates over matched baseline harnesses by 12.4 points on average.
The problem. Long coding runs build long histories, and program state is spread across files, configs and tests.
What they did. A Dev-Primitive pairs a repository artifact (a file, by default) with a resident LLM that answers for its code, talks to other primitives, and edits itself. Dynamic activation switches on only the likely components and their callers, configs and tests. After the repository runs, bug diagnosis maps the failure to the implicated components and reactivates only those, until tests pass or a revision budget of 3 runs out. This adds sub-agents and a stopping rule.
- 1Activatelikely files plus their callers, configs and tests
- 2Dev-Primitivesonly activated files get their own LLM; they edit and message each other
- 3Run and diagnosemap the failure to the parts involved
- 4Revisereactivate only the implicated files, until tests pass or 3 rounds run out
See Figure 1 from the paper

How they tested it. SWE-bench Verified, SWE Refactor Bench, Terminal-Bench 4.0 and DevOps-Gym, each baseline harness (such as Claude Code or Codex) against HERMES on the same backbone, from GPT-5.6 Sol to Qwen3-8B.
What they found.
- On SWE-bench Verified, HERMES improved the resolved rate for 19 of 20 backbones and tied on one; it reached 97.0% with GPT-5.6 Sol against 96.2% under mini-SWE-agent.
- On SWE Refactor Bench, GPT-5.6 Sol under Codex rose from 6.5% to 31.0% at medium effort.
- On Terminal-Bench 4.0, GPT-5.6 Sol gained 18.8 points at medium effort, while Claude Opus 5 gained 1.5.
- Qwen3-8B primitives stayed within 4.5 points of the GPT-5.6 Sol setup, at 26.2% lower Terminal-Bench 4.0 inference cost.
Limits. The authors state added cost and latency, smaller gains with the strongest backbones, and reliance on correct activation.
Takeaway. Gains were largest where baseline harnesses scored low, so per-component agents look most useful for repository-wide changes.
What these papers show together
The two papers take opposite routes. Harness-of-Harness keeps an existing harness and adds loops around it. HERMES replaces the harness with an agent for each part of the repository and wakes only the parts a task touches; its authors list added cost and latency as limits.
Up next Section 8: Harnesses that improve themselves
Section 8 Harnesses that improve themselves
A harness is code, so a model can edit it. Part 18 calls this the fastest-growing area, and these twelve papers show different ways to do it.
Builds on Part 18 (self-improving harnesses)
AutoHarness: improving LLM agents by automatically synthesizing a code harness
Connects to Part 10 (guards), Part 18 (self-improving harnesses)
Gemini-2.5-Flash writes its own code harness for 145 text games, which stops illegal moves and lets it beat larger models.
The problem. In the Kaggle GameArena chess competition, 78% of Gemini-2.5-Flash losses came from illegal moves. Hand-written harnesses prevent this but need new work for every game.
What they did. The model writes the harness as code: a loop that calls the model and rejects moves that a learned function, is_legal_action(), marks illegal. This is a guard. A tree search with Thompson sampling (a rule that balances trying new versions against fixing promising ones) picks which code version to refine, using game feedback. In harness-as-policy, the code picks the move itself and the model is not called during play.
- 1The model writes harness codeincluding is_legal_action()
- 2Playgame feedback
- 3Refinetree search picks which version to improve
- 4Guardillegal moves are rejected
How they tested it. Gemini-2.5-Flash wrote harnesses for 145 TextArena games. Play was compared on 16 one-player and 16 two-player games against Gemini-2.5-Pro, and on one-player games also GPT-5.2 and GPT-5.2-High.
What they found.
- The harness reached a 100% legal action rate on all 145 games, after 14.5 tree-search iterations on average.
- In two-player games, Flash with the harness won 9 of 16 games against Gemini-2.5-Pro (56.3% overall win rate against 38.2%).
- In one-player games, average reward was 0.745 with the harness, against 0.707 for Pro and 0.673 for Flash alone.
- Harness-as-policy scored 0.870, against 0.844 for GPT-5.2-High, which cost about $640; the code policy costs almost nothing at test time.
Limits. One harness is built per game. Harness-as-policy was tested only on one-player games, because two-player games need reasoning about the opponent.
Takeaway. In these games, a small model that writes code to check its own actions matched or beat larger models.
Meta-Harness: End-to-End Optimization of Model Harnesses
Connects to Part 18 (self-improving harnesses)
A coding agent searches over harness code while reading all earlier candidates' code, scores and traces; it beats hand-built harnesses on three tasks.
The problem. Harnesses are mostly designed by hand, and existing text optimizers see little feedback: scores, short summaries or the latest candidate. The authors ask whether richer feedback helps.
What they did. Meta-Harness is an outer loop that proposes, tests and logs harnesses. The proposer is a coding agent. It reads a filesystem holding every earlier candidate's code, scores and execution traces, using grep and cat, then writes a new harness. The search edits code that decides what to store, retrieve and show the model, so it touches history, memory and prompts. A Pareto frontier (candidates no other candidate beats on every goal) tracks accuracy against context cost.
- 1A filesystemcode, scores and traces of every earlier candidate
- 2Proposer agentreads them with grep and cat, writes a new harness
- 3Evaluatelog its score and traces
- 4Repeattrack accuracy against context cost
See Figure 2 from the paper

How they tested it. Online text classification with GPT-OSS-120B, math retrieval on 200 IMO-level problems across five models, and TerminalBench-2 (89 tasks) with Claude Opus 4.6 and Claude Haiku 4.5.
What they found.
- On text classification the best harness scored 48.6%, 7.7 points above ACE (an earlier context-management system), using 11.4K context tokens against 50.8K.
- With scores only, the proposer reached a median of 34.6 and best of 41.3. With full traces: median 50.0, best 56.7.
- The math retrieval harness gained 4.7 points on average over no retrieval across five models.
- On TerminalBench-2 it scored 76.4% with Opus 4.6 (Terminus-KIRA: 74.7%) and 37.6% with Haiku 4.5 (Goose: 35.5%).
Limits. Search and final scoring on TerminalBench-2 used the same 89 tasks. Only one proposer agent was tested.
Takeaway. An optimizer that could read raw traces from earlier runs beat one given only scores or summaries.
Agentic Harness Engineering: Observability-Driven Automatic Evolution of Coding-Agent Harnesses
Connects to Part 7 (instructions), Part 18 (self-improving harnesses)
AHE splits a coding agent's harness into files that another agent edits, predicting what each edit will fix; ten rounds lifted Terminal-Bench 2 from 69.7% to 77.0%.
The problem. Harness engineering is a manual craft. Automating it is hard: editable parts vary, trajectories are huge, and edits are hard to credit.
What they did. AHE splits the harness into files: system prompt, tools, middleware (code around tool calls) and long-term memory, each revertible alone. A debugger agent condenses trajectories into layered evidence. An evolve agent edits the files and writes a manifest predicting which tasks each edit will fix or break. The next round's results are checked against those predictions. This touches tools, guards, memory and instructions.
- 1Harness as filesprompt, tools, middleware, memory
- 2Debugger agentcondenses runs into evidence
- 3Evolve agentedits files and predicts what each edit fixes or breaks
- 4Check predictionsagainst the next round's results
{
"iteration": {{ iteration }},
"changes": [
{
"id": "chg-1",
"type": "new|improvement|rollback",
"description": "What was changed and why",
"files": ["relative/to/workspace/file.py"],
"failure_pattern": "The failure class this addresses",
"predicted_fixes": ["task-name-a", "task-name-b"],
"risk_tasks": ["task-name-c"],
"constraint_level": "middleware|tool_impl|tool_desc|skill|prompt",
"why_this_component": "Why this component level was chosen over alternatives"
}
]
}How they tested it. The seed was a bash-only agent; GPT-5.4 at high reasoning filled all three roles. Evolution ran ten iterations on Terminal-Bench 2 (89 tasks). Transfer used 500 SWE-bench-verified tasks and five other models.
What they found.
- Pass@1 on Terminal-Bench 2 rose from 69.7% (seed) to 77.0%. Codex, for comparison, scored 71.9%.
- On SWE-bench-verified, AHE scored 75.6% against 75.2% for the seed, with 12% fewer tokens than the seed.
- With no further evolution, five other settings (three other model families, plus GPT-5.4 at medium and at extra-high reasoning) gained 2.3 to 10.1 points on Terminal-Bench 2, e.g. deepseek-v4-flash from 51.7% to 61.8%.
- Adding one component to the seed: memory 75.3%, tools 73.0%, middleware 71.9%, system prompt 67.4% (seed 69.7%).
Limits. Evolution was fitted to GPT-5.4 high and Terminal-Bench 2, so transfer numbers mix portability with that setting. The authors call AHE a research prototype.
Takeaway. Gains came from tools, middleware and memory, not the system prompt, so a prompt-only search may miss most of them.
Self-Harness: Harnesses That Improve Themselves
Connects to Part 18 (self-improving harnesses)
A model mines its own failures, proposes small harness edits and keeps only edits that pass regression tests; all nine model-benchmark pairs improved.
The problem. Harnesses are mostly built by human experts, but models fail in different ways. A harness tuned for one model may fit another poorly, and hand-tuning for each new model does not scale.
What they did. The same fixed model runs a loop. Weakness Mining groups failed runs by the verifier's reason for failure. Harness Proposal writes several small, distinct edits to declared parts: instructions, tools, verification guidance and a runtime control policy. Proposal Validation tests each edit on held-in and held-out tasks, and keeps it only if neither split gets worse and one improves. This touches instructions, guides, sensors and stopping rules.
- 1Weakness mininggroup failed runs by failure reason
- 2Harness proposalsmall edits to declared parts
- 3Validationkeep only if neither split gets worse and one improves
How they tested it. MiniMax M2.5, Qwen3.5-35B-A3B and GLM-5 on Terminal-Bench-2.0 (64 tasks), SWE-bench Verified (100 tasks) and AppWorld (180 tasks), starting from a minimal DeepAgent harness. Pass rate covers two attempts per candidate.
What they found.
- All nine model-benchmark pairs improved on both held-in and held-out tasks; no promoted harness degraded either split.
- The largest relative gain was 132%, for Qwen3.5-35B-A3B on AppWorld (22.5% to 52.2%).
- The largest absolute gain was 40.6 points, for GLM-5 on AppWorld (44.4% to 85.0%).
- The smallest gain was 7%, for GLM-5 on SWE-bench Verified (52.0% to 55.5%). Kept edits differed by model.
Limits. The paper covers bounded edits on fixed benchmarks, not open-ended self-improvement. Accepted edits may reflect benchmark-specific failure patterns.
Takeaway. Keeping an edit only if neither split got worse was enough to turn a model's own failure traces into gains.
ParetoSaddler: Pareto-Guided Optimization of Agent Harnesses for Quality and Cost
Connects to Part 17 (efficiency checklist), Part 18 (self-improving harnesses)
ParetoSaddler optimizes agent harnesses for quality and cost together by keeping candidates that improve either one; it raised quality and cut cost on two benchmarks.
The problem. Harness optimizers mostly aim at quality. When cost is added, applying the deployment preference at every step can reject candidates that would help later steps.
What they did. ParetoSaddler separates which candidate to keep during search from which harness to deploy at the end. An optimizer edits a parent harness. Parent and candidate each run several times, and a Bayesian bootstrap (repeated reweighting of results to measure how sure the evidence is) checks for credible gains in quality or cost. Kept candidates get a wider development test and stay available as parents. This changes the loop that edits the harness.
- 1Optimizer editsa parent harness
- 2Repeated runsparent and candidate, several times each
- 3Credible gain?in quality or cost, by Bayesian bootstrap
- 4Choose at the endapply the deployment preference only now
See Figure 2 from the paper

How they tested it. ClawMark (92 tasks, OpenClaw with GPT-5.4) and GAIA2 (ReAct-style harness, GPT-5.5), with domain-disjoint train, development and test splits. Test numbers average three repeats.
What they found.
- On ClawMark, quality rose from 70.86% to 81.35% and cost fell from $1.17 to $1.01 per task.
- On GAIA2, quality rose from 56.22% to 62.89% and cost fell from $0.78 to $0.45 per task.
- Against the quality-only baseline, quality was 7.49 points higher on ClawMark and 5.56 higher on GAIA2, at lower cost.
- The cost-minimizing variant reached $0.82 per task on ClawMark and $0.44 on GAIA2.
Limits. Repeated runs raise evaluation cost, and the bootstrap covers run-to-run variation, not task sampling. Only two benchmarks were tested, and safety was not evaluated.
Takeaway. Keeping promising candidates for later steps, and applying the final goal only at the end, gave harnesses that were both better and cheaper.
SoL-Pi: Recursively Scaling Auto-Research Loops for Efficient Agent Harness
Connects to Part 9 (prompt cache), Part 18 (self-improving harnesses)
An AI researcher searched for ways to cut a coding agent's token use; four kept mechanisms cut token traffic 44.7-49.0% at similar scores.
The problem. Coding agents run long unattended sessions, so token cost matters. The authors ask whether an automated research loop can find harness changes that save tokens and work on unseen tasks.
What they did. A research agent reads the base harness's (Pi) traces and proposes changes. A change stays only if capability metrics hold within a preset tolerance and one efficiency metric improves. Four survived. Action Fusion joins an edit and its follow-up command into one request. Online Context Compact compacts only when the saving beats the prompt-cache rewrite cost. ObservationPack swaps large tool results for a handle and a 1 KB excerpt. Evidence-Preserving Reducer has a cheaper model summarize logs, then verifies it.
- 1Search at scale152 directions across six families, each developed on its own
- 2Propose a changefrom the base harness's traces
- 3Keep it ifcapability holds and one efficiency metric improves
- 4Four survivedfrozen, then tested on unseen benchmarks
{
"version": 1,
"actionFusion": false,
"observationPack": false,
"evidencePreservingReducer": false,
"evidencePreservingReducerProvider": "provider-id",
"evidencePreservingReducerModel": "model-id",
"onlineContextCompact": false,
"cacheWriteReadRatio": 12.5
}How they tested it. Search used GPT-5.6 Sol. Held-out tests: 51 public EdgeBench tasks (also Opus 5, no re-search), 63 Terminal-Bench 4 tasks, six IMO 2026 problems and a kernel swarm.
What they found.
- On EdgeBench with GPT-5.6 Sol, the full stack used 1.10 B tokens, 49.0% fewer than Pi, and scored 42.0 against 44.8.
- On Opus 5, it kept 94.3% of Pi's score while token traffic fell 44.7% and API cost fell 33.5%.
- On Terminal-Bench 4 it solved 15 of 63 tasks against 18 for Pi, at $211.12 against $286.45.
Limits. The authors call cross-model evidence preliminary: the mechanisms fired less on Opus 5. Full search is costly, so breadth and depth were not compared at a fixed budget.
Takeaway. Most savings came from changing what is sent again on each turn, which is where the prompt cache matters (Part 9).
HarnessMM: Recursive Self-Improvement for Harness Token Efficiency
Connects to Part 17 (efficiency checklist), Part 18 (self-improving harnesses)
HarnessMM stores actions the model already decided and runs them when tool results allow; on HumanEval it cut tokens by 29.54% (Codex) and 87.93% (DeepSeek Harness).
The problem. After each tool result, a harness must decide whether to ask the model to reason again or run an action earlier reasoning already fixed. Repeated reasoning can regenerate unchanged decisions and cost tokens.
What they did. HarnessMM changes the loop and its checks. Executable Decision Graphs store resolved actions, arguments, dependencies and guards. When a tool result meets a guard, the stored action runs through the native tool interface and the skipped model call is recorded. A typed selector picks an eligible action or abstains, returning control to the original model. Recursive self-improvement tunes companion prompts and settings on training tasks.
- 1Store decided actionswith arguments, dependencies and guards
- 2Guard met?yes: run the stored action and skip the model call; no: control returns to the model
- 3Self-improvementfeedback from training tasks refines prompts, context settings and adapter rules
// A slow actor would author these literal actions before the root tool call.
const commands = ['compile example.py', 'test example.py', 'report example.py'];
const nodes = commands.map((command, index) => ({
candidate_id: 'ABC'[index], predecessor_id: index ? 'ABC'[index - 1] : 'root',
tool: 'terminal', arguments: {command}, guard: {return_code: 0},
required_receipt_fields: ['return_code'],
expected_local_cost: {selector_upper_tokens: 8192}, dependency_ids: [],
}));How they tested it. Codex and DeepSeek Harness, with and without HarnessMM, on 98 HumanEval and 257 MBPP-sanitized test tasks, plus companion studies such as AIME.
What they found.
- On HumanEval, Codex kept 90.82% success while tokens per task fell from 66.72k to 47.02k. DeepSeek Harness rose from 71.43% to 85.71% success while tokens fell from 96.28k to 11.62k.
- In an MBPP ablation, full HarnessMM used 13.17k tokens per task, against 18.03k with single-use graphs and 16.37k with callbacks retained.
- On the 560 AIME test questions, HarnessMM used 5.90k tokens per task against 4.59k for the baseline harness.
Limits. Savings depend on provider accounting and on whether resolved actions exist. Authorship, selection and recovery can outweigh avoided calls.
Takeaway. Reusing actions the model had already decided removed model calls in coding harnesses, and the AIME result shows the saving depends on such actions existing.
LongCapHarness: Capability-Guided Auto-Harnessing for Long-Context Reasoning
Connects to Part 18 (self-improving harnesses)
LongCapHarness has a strong model build reusable harnesses for long-context tasks; small models run them without training and beat trained baselines on average.
The problem. Methods for long-context reasoning usually synthesize training data and post-train the model, which the authors call empirical and computationally heavy. They ask whether existing model capabilities can be harnessed instead.
What they did. LongCapHarness changes the tools and control logic. A harnessing agent (GPT-5.6-Sol) splits a task into capability primitives such as lookup, state tracking and counting. It revises their code, a capability state and the control logic by comparing answers with reference answers. The final harness is frozen in a library, and at test time an execution LLM selects and runs one.
- 1A strong agent buildscapability primitives such as lookup and counting
- 2Reviseby comparing answers with reference answers
- 3Freeze in a libraryone harness per capability, shared by many questions
- 4A small model picks onematches the question to a library entry and runs it
See Figure 2 from the paper

How they tested it. Llama3-8B, then Qwen2.5-3B, on HELMET and RULER (59,826 held-out test examples) and LongBench-v2, against NExtLong, PolicyLong and RRSI.
What they found.
- On the HELMET and RULER average with Llama3-8B, it beat the base model by 64.18 points, NExtLong by 9.17 and RRSI by 39.65. With Qwen2.5-3B it beat the base model by 16.82, PolicyLong by 14.63 and RRSI by 40.27.
- On LongBench-v2 with Qwen2.5-3B, it scored 34.47 on Medium against 27.10 for PolicyLong, and 27.85 on Long against 31.50.
- Estimated development cost was $541.47, against estimated training costs of $3,696.00 (NExtLong) and $1,858.82 (PolicyLong).
Limits. The method needs a strong harnessing agent. When Llama3-8B and Qwen2.5-3B built their own harnesses, the authors observed a sharp drop.
Takeaway. Steps that can run as code carried over between models, while steps needing the model's judgement did not.
Harness-R1: Learning to Edit Executable Runtime Harnesses from Agent Failure Trajectories
Connects to Part 10 (guards), Part 18 (self-improving harnesses)
A 9B model is trained with reinforcement learning to patch another agent's runtime; average success on three benchmarks rises from 44.3% to 53.6%.
The problem. Deployed agents gather trajectories, but their behavior stays fixed. Prompting frontier models to edit the harness was unreliable: Self-Refine lowered reward on all three benchmarks.
What they did. Harness-R1 trains a separate 9B "harness engineer" to patch the runtime around a frozen target agent. It reads the target's failures and writes a validated patch with four hooks: episode start, before the decision (context), before the action (a guard that can rewrite or veto), and after feedback (recovery). The patched target reruns the same tasks; the reward change trains only the engineer, by fine-tuning then GRPO (reinforcement learning over groups of candidate patches).
- 1Target failsa frozen 9B agent's failed runs
- 2Engineer patcheshooks at start, context, before action, after feedback
- 3Rerunthe same tasks with the patch
- 4Train the engineerreward is the change in success
See Figure 2 from the paper

{
"type": "add_code_hook",
"hook": "on_init",
"code": "def hook(ctx, nb):\n nb['stage'] = 'search'\n nb['last_hint'] = ''\n return {'skills': [{'text': 'Search, inspect a matching product, select every required option, verify constraints, then buy.'}], 'tool_hint': 'Use visible page evidence before advancing to the next shopping stage.'}"
},
{
"type": "add_code_hook",
"hook": "make_pre_hint",
"code": "def hook(ctx, nb):\n state = ctx.get('state', {})\n text = str(state).lower()\n if 'buy now' in text and ('required' in text or 'select' in text):\n msg = 'Before buying, select every required option shown on the product page.'\n if nb.get('last_hint') != msg:\n nb['last_hint'] = msg\n return {'message': msg}\n return None"
}How they tested it. A frozen Qwen3.5-9B target on WebShop (500 tasks), ALFWorld (500) and DBBench (300), against ReAct, Self-Refine, Reflection and six prompted frontier models.
What they found.
- Average success rose from 44.3% to 53.6% over the unmodified target; the best prompted engineer, GLM-5.2, reached 48.8%.
- With a fine-tuned target, a retrained engineer lifted the average from 59.2% to 64.2%.
- On twenty unseen target configurations the average gain was 7.06 points.
- Removing the pre-action guard cost 3.9 points and post-feedback recovery 3.3, against 0.9 and 0.6 for the other two hooks.
Limits. The authors study one step from a vanilla to a fine-tuned target, and their reward is tied to the tasks used to mine failures.
Takeaway. A small engineer trained on rerun outcomes beat larger prompted editors, and the guard and recovery hooks carried most of the gain.
Exo: An Architecture for Self-Improving Systems at Runtime
Connects to Part 18 (self-improving harnesses)
Exo lets an agent edit its own harness during a task, behind a protected core; model cost fell 12–53% versus Codex and Pi in game runs.
The problem. Hand-designed harness policies take effort, and automated tuning needs benchmark tasks and repeated costly runs. The tuned policy then stays fixed during work.
What they did. Exo splits the harness in two. A small protected layer keeps the append-only execution history, a versioned store, credentials, the sandbox API and a guardian. The rest, the executor, is editable: tools, context assembly, prompts, memory and skills. The agent edits executor code with its ordinary coding tools, then asks the guardian to activate it; the default guardian only checks that the build succeeds.
- Protected corehistory, versioned store, credentials, sandbox, guardian
- Editable executortools, context, prompts, memory, skills
- Activate an edita guardian outside the executor decides; the default one checks the build
How they tested it. RuneScape objectives against Codex and Pi with gpt-6.1-sol; AppWorld, SREGym and Continual Learning Bench against the same starting policy without editing (Control), with gpt-5.6-sol.
What they found.
- Standalone combat cost $3.71 for Exo, against $7.26 for Codex and $7.95 for Pi.
- On AppWorld held-out tasks both arms passed 96.9%; Exo cost $0.141 per task against $0.359 for Control.
- On 20 held-out SREGym incidents, median diagnosis time fell from 81 s to 53 s.
- On the quest objective Exo cost $0.28 per quest point, against $0.24 for Codex and $0.21 for Pi.
Limits. With gpt-5-mini on AppWorld, three seeds made limited edits and reused no tools; pass rates were 59% against 55% for Control. The authors believe a minimum model ability is needed.
Takeaway. Self-editing repaid its early cost when work repeated, and did not on the one-off quest task or with the smaller model.
Prime Agent: A Self-Improving RLM Harness
Connects to Part 12 (stopping rules), Part 18 (self-improving harnesses)
Prime Agent is an open-source harness with a persistent Python REPL and recursive subagents; the authors report it matches or exceeds other harnesses on long tasks.
The problem. The authors want models to fail evaluations because a task is too hard, not because the harness dropped state, blocked actions, miscounted resources or stopped early.
What they did. Prime Agent gives the model a persistent IPython REPL (an interactive Python session) for processing context with code, following the Recursive Language Model idea. Recursive subagents message each other directly. Continual Harness keeps prompts, memories, skills and subagent specifications as versioned, editable state. Autonomous mode runs under turn, token and time limits until an end-condition test passes, and cost is summed over all subagents.
- Persistent REPLprocess context with code
- Recursive subagentsthat message each other
- Continual Harnessprompts, memories and skills as versioned state
- Limitsturn, token and time budgets
await refine.status()
await refine.run()
await refine.run("create a memory about always checking git status before committing")
await refine.run("promote the error-handling pattern to a global skill", global_=True)How they tested it. ARC-AGI-3, long-context tasks, nanoGPT speedruns, PMPP-Hard, EmulatorBench, Factorio and MazeBench, against Pi, Claude Code, Codex and others.
What they found.
- The abstract reports an ARC-AGI-3 score rising from 30% to 95.5%; the authors note their native-harness reruns scored below published figures.
- On OOLONG (128k) with GLM-5.2, Prime Agent scored .700 against .420 for Pi-mono, but .900 against .920 for Claude Code and .940 against .900 for Codex; the table gives no significance tests.
- On nanoGPT, harness choice had little effect on final records compared with experiment noise.
- In one Factorio trace the agent found an RCON exploit and saved it as a reusable skill.
Limits. The authors write that models still show friction in allocating subagents and managing retained information. The EmulatorBench results are preliminary.
Takeaway. Persistent, refinable state can also keep a shortcut that games the measured objective, so the authors call for least-privilege actions, independent validation and rollback.
Harness Handbook: Making Evolving Agent Harnesses Readable, Navigable, and Editable
Connects to Part 14 (a harness in files), Part 18 (self-improving harnesses)
A behavior-organised map of a harness's code helps a coding agent find where to edit; plans won more often and used fewer planner tokens.
The problem. Before changing a harness, a person or coding agent must find every code location behind a behavior. Requests describe behavior, while repositories are organised by files and functions.
What they did. The Harness Handbook is a document tree built from a repository by static analysis and LLM structuring: a system overview, one page per execution stage, and units linked to source code. A workflow called BGPD guides a coding agent from the overview down to code and checks each candidate location against the current source. It changes the reference material the agent reads when planning an edit. After each edit the handbook is rebuilt.
- 1Harness codea large repository
- 2Build the handbookstatic analysis plus LLM structuring; rebuilt after every edit
- 3Handbookoverview, stage pages, units linked to source
- 4Planner reads downfrom behaviors to code, checking each location
See Figure 1 from the paper

## How to plan — ROUTE with the handbook, READ the real source, EMIT verbatim edits
1. Understand the request's true intent: the behavior delta, and the state/conditions/values
it fixes.
2. **Route with the handbook.** Read its `SKILL.md`, then `index.md`, then only the
`stages/<id>.md` chapters and `registers.md` entries your intent points to. Assemble the
candidate set: every file + function + anchor the change must touch. Watch for
scattered/mirror sites (a parser change usually has a twin in the OTHER parser and in both
prompt templates; a state change fans out to every read site listed under that register).How they tested it. Codex and Terminus-2, with 30 modification requests each. A read-only DeepSeek-V4-Pro planner ran with and without the handbook; GPT-5.5, Opus 4.8 and DeepSeek-V4-Pro judged the plans.
What they found.
- Handbook-assisted plans won more often: 38.3% against 28.3% on Codex, and 45.6% against 26.7% on Terminus-2.
- Average planner tokens fell from 0.102M to 0.089M per Codex request (12.7%) and from 0.058M to 0.053M per Terminus-2 request (8.6%).
- Against reference plans from Opus 4.8 and GPT-5.5, all 24 comparisons of recall, precision and F1 were higher, with F1 gains of 5.0 to 18.8 points.
Limits. The study covers two harnesses and 60 requests, and scores edit plans rather than executed edits.
Takeaway. A code map organised by behavior gave a coding agent better edit locations at a lower token cost than exploring the repository directly.
What these papers show together
The papers differ in who edits the harness and what may change, but most share one pattern: run the agent, read what went wrong, change the harness, and keep the change only if a check passes. What differs is the check: regression tests (Self-Harness), predictions checked in the next round (AHE), statistics over repeated runs (ParetoSaddler), or a build check (Exo). Harness Handbook instead helps an agent find where to edit, and Prime Agent applies each edit at the end of a turn and keeps versions so it can roll back. Several papers aim at cost rather than success (SoL-Pi, HarnessMM, Exo). Two cautions come from the papers themselves: Meta-Harness searched and scored on the same tasks, and in Prime Agent a saved skill gamed the measured objective.
Up next Section 9: Warnings: how to judge a self-improving harness
Section 9 Warnings: how to judge a self-improving harness
A self-improving harness that scores higher is not always a better harness. These five papers show how to tell the difference; the first of them is the source of the warning at the end of Part 18.
Builds on Part 16 (run-to-run differences), Part 18 (self-improving harnesses)
Rethinking the Evaluation of Harness Evolution for Agents
Connects to Part 18 (self-improving harnesses)
Under matched budgets on Terminal-Bench 2.1, harness evolution does not beat simply trying each task several times and does not generalize, but it helps on long-horizon games.
The problem. Earlier papers skip matched-budget comparisons with simple task-level search and search with unit tests from the benchmark they report on. The paper tests whether gains come from better harness design or from repeated attempts.
What they did. They compare four ways to spend the same budget. Parallel sampling draws independent attempts. Sequential refinement revises the previous attempt. Harness evolution lets a meta agent edit one shared harness across tasks. Harness scaling edits the harness per task. Feedback is either unit tests or only the agent's own judgment.
- Parallel samplingindependent attempts
- Sequential refinementrevise the last attempt
- Harness evolutionone shared harness, edited across tasks
- Harness scalingthe harness edited for each task
- Same budget, held-out tasksmatched budgets; evolved harnesses scored on unseen tasks
See Figure 1 from the paper

How they tested it. Terminal-Bench 2.1 (89 tasks) with Claude Opus 4.6, GPT-5.4, and GPT-5.4 mini, two runs. Then ARC-AGI-3 and five EdgeBench game tasks with Claude Opus 4.8 and GPT models.
What they found.
- Without unit tests, average pass@1 was 68.2 for direct sampling, 72.3 for parallel sampling, and 67.4 for harness evolution.
- With unit tests, parallel sampling averaged 82.0 and harness evolution 69.7, against 67.6 for direct sampling.
- On 34 held-out test tasks, the evolved harness averaged 63.2, the same as the initial harness.
- On ARC-AGI-3 with Claude Opus 4.8, harness scaling of the full harness reached 77.5 against 43.3 for sequential refinement; on EdgeBench it beat sequential refinement by 13.3%.
Limits. The authors offer reasons for the Terminal-Bench result without testing them. The game runs optimize each task alone, so they do not show transfer.
Takeaway. A harness evolution gain needed a matched-budget baseline and held-out tasks before it could be read as better design.
RRSI: Regularized Recursive Self-Improvement of Agent Harnesses
Connects to Part 18 (self-improving harnesses)
RRSI adds limits on how much the harness may change during automatic evolution so that evolved harnesses keep more of their gains on benchmarks the search never saw.
The problem. Harness evolution keeps edits that raise the score on a small evolve set. The authors argue this overfits, so gains can shrink or vanish on other benchmarks.
What they did. RRSI keeps every harness part editable and constrains the search loop. A budget caps how many edits one candidate may bundle and shrinks over the rounds. A critic rejects diffs that encode task names or answers. A candidate must stay within a measured noise band, extra token cost must be paid for by score gain, and a pruner deletes components that stop helping.
- 1Proposean edit budget that shrinks over rounds
- 2Criticrejects diffs that encode task names or answers
- 3Selectwithin a noise band; extra tokens must pay off
- 4Pruneremove parts that stopped helping
How they tested it. Claude Opus 4.8 as the frozen policy (Gemini 3.5 Flash in one test; sizes not given). Harnesses were evolved on one suite per domain and run unchanged on held-out benchmarks, across eight benchmarks, against four prior methods.
What they found.
- On agentic workspace tasks, RRSI averaged 43.6 over three out-of-distribution benchmarks, against 39.7 for the unevolved harness; AHE and TTHE ended below it.
- SWE-bench Verified, never scored during search, gained 1.8 points after evolving on Terminal-Bench 2.1.
- Removing both groups of limits gave the highest evolve score (92.8) but an out-of-distribution average of 40.3, at 3.80 million tokens per trial against 2.42.
Limits. The study uses frozen backbones only. The authors say broader validation is needed on other agent architectures, tool ecosystems, and longer runs.
Takeaway. Limiting edit size, screening for leakage, and charging for tokens kept more gain on unseen benchmarks than selecting on the evolve score alone.
Trustworthy Recursive Self-Improvement with Statistical Guarantees
Connects to Part 16 (run-to-run differences), Part 18 (self-improving harnesses)
TRUST decides whether to keep a harness update with a statistical test that limits how many kept updates are worse, rather than accepting any higher validation score.
The problem. A greedy gate keeps any candidate that beats the current harness on validation. Noise and reused validation tasks can let worse updates through, while strict gates can reject useful ones.
What they did. TRUST replaces the gate. It defines the false evolution rate (FER), the expected share of accepted updates that cause an unacceptable loss. It spends one error budget across rounds with online multiple hypothesis testing (many tests, one overall error limit). Each test asks whether a candidate is worse than the current harness by more than a tolerance, and it corrects for reused validation tasks. An LLM reads the history to set the evidence each candidate needs.
- 1Candidate updateto the harness
- 2Set the testing levelone error budget for all rounds; an LLM reads the history to set how much evidence to ask for
- 3Test the candidateworse than the current harness by more than a tolerance?
- 4Accept or reject
How they tested it. DeepSeek-V4-Flash and Qwen-3.8-Flash on HotpotQA, DROP, and APPS (200 validation, 300 test examples each), 30 rounds, 5 seeds, against Greedy, PACE, and two SGM gates.
What they found.
- Mean accepted inferior updates fell from 45.59% for Greedy to 2.78% for TRUST, and the mean largest drop fell from 4.963 to 0.047 points.
- TRUST had the highest mean final gain, 24.84 points.
- SGM-B never accepted an update and SGM-H accepted three across all runs.
- With the LLM allocator, final HotpotQA/DeepSeek-V4-Flash score was 44.91%; without it, 43.78%.
Limits. The authors leave open how to pick the overlap correction strength. The guarantee can be conservative, and the LLM allocator can misjudge candidates.
Takeaway. A gate with an explicit error budget kept gains that a greedy gate lost, while strictly controlled gates accepted almost nothing.
Harness Continual Learning: Continual Adaptation Beyond Model Parameters
Connects to Part 18 (self-improving harnesses)
HCL updates a harness over a stream of tasks around a frozen model and commits an update only if it does not break earlier behavior.
The problem. Agents can adapt through prompts, memory, skills, and routing instead of weights. The authors ask how to keep improving the harness without breaking earlier behavior, which they call harness-level forgetting.
What they did. HCL versions four parts as one state: a Task Interface (prompts, parsing), Experience Memory, a Capability Map (tools and skills), and an Adaptive Router. A Continual Optimizer proposes a candidate harness from feedback. A Continual Evaluator commits it only if it improves current validation tasks, loses at most a set number of earlier solved anchor examples, and passes validity checks. Anchors never reach execution.
- 1Propose an updateto prompts, memory, tools or routing
- 2Better now?on current validation tasks
- 3Old tasks kept?lose no more than a set number of earlier solved examples
- 4Commitif it also passes validity checks; otherwise reject
harness:
updates_enabled: true
top_k_memory: 5
top_k_strategies: 3
candidate_pool_size: 20
raw_memory_capacity: 500
anchors_per_task: 5
min_current_score: 1.0
max_anchor_regression: 0.0
gate_enabled: trueHow they tested it. Frozen Qwen3.5-9B on ALFWorld (134 evaluation episodes), DeepSeek-V4.1-Flash on a four-task text stream, and Qwen3.6-27B on a four-task multimodal stream, against RAG, MemP, and MemRL.
What they found.
- On ALFWorld, Plasticity-HCL (no retention limit) reached 62.98% with 10.94% forgetting; Stability-HCL (no anchor loss allowed) reached 61.74% with 2.64%. MemRL scored 60.68%.
- On the text stream, Plasticity-HCL scored 76.10% against 63.65% zero-shot and 68.85% for MemRL.
- In a retention sweep, 0 lost anchors gave 0.39% forgetting; 1 gave the best accuracy (63.46%); no limit gave 60.13% and 3.45% forgetting.
- Qwen3.6-27B proposing updates for Qwen3-4B raised accuracy from 35.10% to 45.75%.
Limits. The budget counts regressions only on sampled anchors, so a budget of zero does not guarantee zero test-set forgetting.
Takeaway. Checking each update against hidden earlier examples cut forgetting, and a small tolerance gave the best accuracy in one sweep.
Are Self-Evolving Agents Continual Learners?
Connects to Part 18 (self-improving harnesses)
The paper tests whether self-evolving agents keep old skills while learning new ones, and finds that more learning goes with more forgetting and interference.
The problem. Self-evolving agents rewrite their prompt, memory, or skills while weights stay frozen. Whether one shared harness can keep learning across changing tasks without losing earlier gains was not examined.
What they did. No new harness. The authors study three evolvers (methods that update the harness). ReasoningBank retrieves one stored memory item by query similarity. GEPA rewrites a strategy section of the system prompt. Meta-Harness edits prompt, memory, skills and controller code behind a validation gate. Plasticity is the gain on the group being trained; stability is interference before a group arrives plus forgetting after.
- 1A changing task streamtopic, workflow or domain drifts
- 2The harness updatesReasoningBank, GEPA or Meta-Harness
- 3Measuregain on the group being trained; interference before a group arrives and forgetting after
How they tested it. Gemini 3.6 Flash in a ReAct loop on four drifting streams (topic, workflow, domain, compound) from BIRD, BFCL, and ScienceWorld, 50 training tasks per group.
What they found.
- Averaged over streams, plasticity was +6.2 for GEPA and +3.3 for ReasoningBank, and stability was -4.3 and -1.9.
- On topic drift, BIRD-F1 rules fell from 100% of GEPA's prompt to 40.2% by position 150, and BIRD-F1 accuracy went from +7.5 to -2.0 over the seed.
- On workflow drift, GEPA's clarification rate on BFCL-Miss fell from 29.8% to 11.2% after the BFCL-Base block.
- With ReasoningBank on compound drift, 52% of BFCL-Miss episodes retrieved a memory from the opposite workflow.
Limits. The paper has no limitations section. The tests use one base model and three methods.
Takeaway. A shared prompt or workspace overwrote earlier rules, and similarity retrieval could not separate near-identical queries that need opposite workflows.
What these papers show together
Together they give a checklist for reading any harness-evolution result. Did it beat an agent that simply tried more times at the same budget? That is the test behind the warning in Part 18. Did it hold on unseen tasks? An evolved harness did no better than its starting point on held-out tasks, and RRSI traded a lower score on its search tasks for more gain on unseen benchmarks. Was a kept change really better? TRUST showed that a gate accepting any gain lets through many updates that are worse. Do old tasks still pass? A harness edit can break what worked before, which is why Harness Continual Learning tests each update on hidden earlier examples.
Up next Section 10: Training the model together with its harness
Section 10 Training the model together with its harness
Most papers so far keep the model fixed and change the harness. But the model and the harness meet at every step, so training one changes how the other works. These six papers train the model inside, or around, its harness. Part 18 mentions the first one.
Builds on Part 14 (a harness in files), Part 18 (self-improving harnesses)
Language model harnesses can be Compositional Generalizers
Connects to Part 8 (history), Part 18 (self-improving harnesses)
The authors train models inside harnesses that keep context outside the prompt and call sub-agents. The Recursive Language Model harness carries short-task training over to longer tasks.
The problem. Standard harnesses keep appending to one context, so the model must handle long, unfamiliar histories. The paper tests whether controlling what each call sees makes RL pay off more.
What they did. They compare the plain model, Pi (a ReAct loop with compaction and sub-agents), CodeAct (a code REPL with offloaded context) and the Recursive Language Model (RLM). The RLM keeps context in the environment and calls sub-agents from code, so each call sees a small slice. They also propose surrogate harness training: the root model learns task decomposition on synthetic tasks, some with fake sub-calls.
- 1Context in the environmentkept outside the prompt
- 2Sub-agents called from codeeach call sees a small slice
- 3RL on short taskstested on longer ones
- 4Surrogate harness trainingsynthetic tasks with fake tool or sub-calls
See Figure 2 from the paper

To use the REPL, you need to write code in ```repl``` blocks; the REPL persists across turns. Available in the REPL:
- `context`: the important, potentially very long information related to the prompt (typically `str` or `list[str]`).
- `llm_query(prompt: str, model: str | None = None) -> str`: a single sub-LLM completion. Use for extraction, summarization, or Q&A over a chunk of text. Sub-LLM context window ≈ 500K chars.
- `llm_query_batched(prompts: list[str], model=None) -> list[str]`: concurrently call several LLM calls in parallel over a list of prompts; same order out as in.
- `rlm_query(prompt, model=None)` / `rlm_query_batched(prompts, model=None)`: recursive RLM sub-calls. Fall back to `llm_query` / `llm_query_batched` when recursion is disabled.
- `SHOW_VARS() -> str`: list every variable currently in the REPL.
- `answer`: dict initialized to `{{"content": "", "ready": False}}`. To submit, set `answer["content"]` to the final answer and `answer["ready"] = True` inside a ```repl``` block.How they tested it. Qwen3-30B-A3B-Instruct-2507 with GRPO on short splits of six long-context environments, tested on longer splits. Qwen3.8-27B for surrogate training, scored on eight held-out benchmarks.
What they found.
- In the RLM harness, RL on short tasks raised the Qwen3-30B-A3B average by 7 points but the Qwen3.8-27B average by only 2.4.
- RLM-27B, trained on synthetic tasks, averaged 58.5 on eight benchmarks against 46.1 for Qwen3.8-27B in the same harness (+12.4 points), with 3x fewer turns and 6x fewer root input tokens.
- On four chained tasks, RLM-27B fully solved 55.2% of chains. Recursive sub-harness training raised this to 77.5%. A recursion hint alone gave 47.2%.
Limits. No separate limitations section. Gains depended on the starting model; the synthetic tasks were built with knowledge of the target task families.
Takeaway. Offloading context and delegating to sub-agents let short-task training carry over to longer tasks.
OpenForge RL: Train Harness-native Agents in Any Environment
Connects to Part 14 (a harness in files)
An open framework that trains models inside real harnesses such as OpenClaw and Codex. Trained models beat open baselines of similar size on most benchmarks.
The problem. Real harnesses run nested, multi-process loops that open RL code cannot express. Open work often trains in a simplified harness, so training and deployment differ.
What they did. The framework trains through a harness without changing it. A proxy serves the harness's model calls and records them as samples for a standard RL codebase (veRL). A Kubernetes orchestrator runs each rollout in its own container. Rollouts get a wall-clock timeout, not a turn cap, and samples from errored runs are dropped. Training used ReACT, ZeroClaw, OpenClaw and Codex.
- 1One container per rollouta Kubernetes orchestrator starts a remote sandbox
- 2Real harness runs insideunchanged, e.g. OpenClaw or Codex
- 3Proxyintercepts the harness's model calls and records them
- 4RL trainera standard codebase (veRL)
See Figure 2 from the paper

# openforgeenvs/<name>/env.py — all a Pipeline env needs
def create_env(sandbox):
return MyEnv(sandbox)
class MyEnv:
async def run(self, **env_run_config) -> EnvCallResult:
... # set up the pod, run the harness against llm_args,
# verify, and return {"reward": ..., ...}How they tested it. OpenForge-Claw (Qwen3-30B-A3B-Thinking, SFT then GRPO) on ClawEval, QwenClawBench and MCPAtlas. OpenForge-GUI (Qwen3-VL-8B-Thinking) on OSWorld-Verified, Online-Mind2Web and WebVoyager.
What they found.
- OpenForge-Claw(SFT+RL) scored 31.7 pass^3 on ClawEval, against 14.3 for the untrained base and 21.7 after SFT alone.
- OpenForge-GUI(SFT+RL) scored 37.7, 63.0 and 72.3 on the three GUI benchmarks, up from 34.4, 57.4 and 61.5 after SFT alone.
- Training on ZeroClaw alone gained +3.3 on OpenClaw and +4.6 on Codex over the base. Training on all three gained +9.5 and +20.3.
- RL cut generic shell calls from 22.6% to 13.9% of tool calls on ZeroClaw. Error recovery stayed weakest.
Limits. The behaviour analysis covers the Claw models on ClawEval only, with 100 trajectories per checkpoint. Credit assignment for failed rollouts is left to future work.
Takeaway. A proxy plus remote containers allows training in the deployment harness; training on one harness carried over to unseen ones, and training on all three gave the largest gains on each.
Harness Scaling for Generalizable Agentic Reinforcement Learning
Connects to Part 14 (a harness in files)
The authors train a model through many varied harnesses, picked by a balanced design, so it works on unseen harnesses. It beat single-harness RL in their tests.
The problem. RL through one fixed harness may make a model fit that harness and transfer poorly. The authors ask how to build and organise harness variety.
What they did. A harness is split into five parts: system prompt, tool interface, observation, context management and workflow, each with three versions made by Opus-4.7. This gives 243 harnesses. A balanced design picks 18 for training, so every pair of versions appears equally often. Each task is trained under K = 2 harnesses that differ little. The RL algorithm is unchanged.
- 1Five parts, three versions each243 possible harnesses
- 2Balanced designpicks 18 for training
- 3Traineach task under two similar harnesses
How they tested it. Qwen3-4B-Instruct and Qwen3-30B-A3B-Instruct on ClawGym-Task (13.5K tasks), with GRPO and PPO. Tested on ClawGym-Bench, JobBench-Easy and PinchBench, on 18 held-out harnesses and on Claude Code, averaging three runs.
What they found.
- Over single-harness RL, held-out harness scores rose by 9.80 (GRPO) and 3.57 (PPO) points on the 4B model, and by 5.21 and 4.90 on the 30B model.
- On Claude Code, unseen in training, Harness Scaling averaged 37.22 (4B) and 41.20 (30B). Black-box SFT scored 35.08 and 38.08; black-box RL scored 33.38 and 36.28.
- The 18-harness design beat Random-18 and training on all 243. Random task assignment lost 2.32 points on ClawGym-Bench in-space.
- On the base harness the score moved by 0.19 points.
Limits. No limitations section. Results use two Qwen3 models, one training set and harness variants generated by one model.
Takeaway. How harness variety was chosen mattered more than how many harnesses were used.
Self-Evolving Coding Agents via Harness-Policy Optimization
Connects to Part 18 (self-improving harnesses)
Self-HPO alternates harness edits and reinforcement learning, with the model proposing its own harness changes. It beat harness-only and policy-only baselines.
The problem. Coding agents are tuned either by editing the harness around a fixed model or by training the model under a fixed harness. The paper tests whether alternating the two gives more.
What they did. Self-HPO repeats two steps. In the H-step, the model reads its failed runs and proposes K = 6 changes to the harness prompt or code; the best on a search set is kept. In the P-step, the model is trained with RL under that harness. Tasks never solved become the next search set. The seed is mini-SWE-agent. Evolved code added budget warnings, an empty-patch check and a git-diff fallback (guards, stopping rules).
- 1H-stepthe model proposes six harness changes; keep the best
- 2P-stepRL under that harness
- 3Repeatunsolved tasks become the next search set
See Figure 2 from the paper

except Submitted as e:
submitted_files = self._get_submitted_files_from_sandbox()
submitted_count = len(submitted_files)
touched_count = len(self._touched_files)
missing = self._touched_files - submitted_files
audit = f"""
[Full Files Auditor - Coverage Check]
----------------------------------------
You touched {touched_count} files during exploration: {sorted(self._touched_files)}
Your submitted patch has {submitted_count} files: {sorted(submitted_files) if submitted_files else '(none)'}
{'FOUND GAP: ' + str(len(missing)) + ' touched files NOT in your patch:' if missing else 'Coverage check: all touched files appear in patch.'}
"""How they tested it. Qwen3.5-35B-A3B, 2,484 Python training tasks, two rounds. Tested on SWE-Bench Verified (500 tasks), Multilingual (300) and Pro (642), averaged over three runs.
What they found.
- The average resolve rate rose from 57.8% (base) to 64.8%. Training the model alone (RLVR, reinforcement learning with checked rewards) reached 61.9% and harness-only Self-Harness 60.1%.
- On SWE-Bench Verified, Self-HPO reached 69.5% against 61.0% for the base. Opus 4.8 as the proposer gave 71.6%.
- The new harness alone gave 64.5% and the new policy alone 64.4%. Together 69.5%, 1.6 points above the sum of the two gains.
- pass@8 on Verified (solved in at least one of 8 tries) rose from 80.0% to 84.8%; pass@1 on already-solved tasks fell 2.2 points.
Limits. No limitations section. All runs use one base model, Python training tasks and two rounds.
Takeaway. Harness edits and training helped each other, since the harness targeted the model's remaining failures.
Harness-Aware Distillation for Small Language Model Agents
Connects to Part 11 (guides and sensors)
Harness-Aware Distillation (HAD) trains a small agent to act on harness information, and beat four baselines in the authors' text-game tests.
The problem. The harness stays in place when a large teacher agent is distilled (copied into a smaller student). The authors argue that standard distillation does not teach the student to act on harness information.
What they did. The harness is hand-built. It adds text to observations: state tracking (available actions, location, inventory, step counter) and behavior monitoring (failed actions, stall reports). It never blocks actions. HAD changes training only. At each state the student visits, the same teacher is queried with and without the harness text, and the student learns to prefer the action chosen with it. A validity check drops pairs that contradict the harness records.
- 1Teacher, with and without harness textat each state the student visits
- 2Prefer the harness-informed actiondrop pairs that contradict harness records
- 3Train the studentsmall model, same harness
See Figure 3 from the paper

How they tested it. Qwen3-1.7B from Qwen3-8B on ALFWorld, Qwen3-0.6B from Qwen3-30B-A3B on WebShop and ScienceWorld. Baselines used the same harness.
What they found.
- With the harness, HAD reaches 63.4% on unseen and 51.4% on seen ALFWorld tasks, against 47.0% and 41.4% for the best baseline.
- HAD avoids stalls in 75.9% of ALFWorld episodes (at most 64.6% for the others) and escapes 59.7% of its stalls, against 46.8% for the untrained student.
- Twice the teacher budget lifts two standard distillation methods (OPD and SOPD) only from 43.5% to 46.7% and 46.8% on ALFWorld, against 57.4% for HAD.
- Without the harness at test time, HAD falls from 63.4% to 40.3% (unseen).
Limits. Students had up to 2B parameters and teachers up to 30B, in text-based environments only. The harness is hand-made.
Takeaway. Training on the decisions the harness changes worked better than imitating the teacher's full output.
Harness-Zero: Harness Distillation via Agent-as-Harness
Connects to Part 18 (self-improving harnesses)
Harness-Zero copies the behavior of an evolved harness into model weights, so a 9B model beat its own harness-equipped self after the harness was removed.
The problem. Optimized harnesses help, but the gain stays tied to the harness at deployment. The authors ask whether that behavior can move into the model weights.
What they did. Harness-Zero moves tools, skills, memory and guard code into weights. The student runs under a minimal harness: mini-SWE-agent with one Bash tool. During data collection, a harnessing agent reviews each student response before it runs, using the evolved harness rewritten as review guidance. It passes sound responses or corrects them minimally. The student is fine-tuned on these reviewed rollouts, then deployed without the evolved harness or the harnessing agent.
- 1Student actsminimal harness: one Bash tool
- 2Harnessing agent reviewswith the evolved harness as guidance
- 3Pass or correctminimal fixes
- 4Fine-tunedeploy without the harness
| Student-side h* (acts around the student) | Teacher-side K (advises the harnessing agent) |
|---|---|
| `tools/*.py` -- StructuredTool in the student's action space | `tool/<name>.md` -- **action recipe**: how to construct an equivalent action the student can execute through h |
| `middlewares/*.py` -- inspects state / blocks the loop | `middlewares/*.py` -- **review middleware**: detects the condition from the proposal + visible trajectory, privately hints the teacher |
| `skills/<name>/SKILL.md` -- workflow instructions for the student | `skill/<name>.md` -- **review guidance**: diagnose the current step; construct a student-native replacement when needed |
| `memory.md` -- recurring failures and practices | `memory.md` -- **failure patterns**: each failure becomes a recognizable review condition + targeted intervention |
| (nothing) | `teacher_prompt.md` -- optional **domain prompt**: the domain's review policy, appended to the teacher's system prompt |How they tested it. Student Qwen3.5-9B, harnessing agent GPT-5.6 Sol, LoRA fine-tuning (small trained add-on weights). Tasks: SpreadsheetBench Verified, AppWorld and USPTO Retrosynthesis, single run each.
What they found.
- On two frontier models without training, the review agent with the adapted guidance averages 81.1% over six settings, against 78.1% for meta-harness code and 68.6% for mini-SWE-agent.
- Under the minimal harness, the distilled model raises macro-average success from 23.3% to 44.3%, above the 41.7% of the base model with the evolved harness attached.
- On USPTO, training on harness-guided reviews gives 30.0% pass@1, against 12.0% for teacher rollouts and 15.0% for reviews that saw the answer.
- It recovers 82.3% of harness-exclusive behaviors, averaged over 28 patterns.
Limits. The method needs a capable harnessing model, and weaker ones can make review harmful. Collection raised mean USPTO latency 2.4 times.
Takeaway. In these three domains, recurring procedures moved into weights more easily than domain knowledge.
What these papers show together
Training can carry over between harnesses: in OpenForge RL, a model trained only on ZeroClaw still improved on the unseen OpenClaw and Codex harnesses. In Harness Scaling, training across many varied harnesses transferred better to held-out harnesses than training in one, and the choice of harnesses mattered more than their number. Training can also take over harness work. Harness-Zero moved an evolved harness's behaviour into the weights of a small model, while the student in Harness-Aware Distillation lost much of its score when its harness was removed. Self-HPO found that harness edits and training together gained more than the sum of each alone.
Up next Section 11: Beyond coding
Section 11 Beyond coding
Harness ideas are not only for coding agents. These last two papers take them elsewhere.
Builds on Part 4 (what the model reads), Part 18 (self-improving harnesses)
RoboArchitect: Automating the Design of Robotic Agents with Persistent Memory
Connects to Part 18 (self-improving harnesses)
RoboArchitect lets a coding model write and revise the harness around a frozen robot policy, raising held-out success in simulation without any weight updates.
The problem. Adapting a robot policy usually needs new demonstrations and fine-tuning. Hand-built harnesses around a frozen policy help. The authors ask whether the design loop can be automated.
What they did. The harness is a program between observations and low-level action commands. It starts as a pass-through to the frozen policy. A coding model reads logged rollouts, diagnoses failures and proposes a revision, kept only if it beats the current harness on training episodes, for at most 5 iterations. It can call the policy, vision tools or command the arm itself, and write a persistent memory with no schema given.
- 1Frozen robot policystarts as a pass-through harness
- 2Coding model reads rolloutsand diagnoses failures
- 3Revise harness codecall the policy, vision tools or the arm; write its own memory
- 4Keep if betteron training episodes, up to 5 rounds
How they tested it. Seven policies, including OpenVLA-7B and X-VLA, on five simulated benchmarks. The coding model was claude-opus-5 in Claude Code. Scores come from held-out scenes and tasks.
What they found.
- Average success rises from 9.7% to 43.3% on unseen scenes and from 12.7% to 40.2% on unseen tasks, against the bare policies.
- On VLABench and SimplerEnv WidowX (unseen scenes), the harness around the general policy beats the fine-tuned weights. It falls short on WidowX unseen tasks.
- For general X-VLA on WidowX, the harness stops using the policy and acts from vision: 87.5% on unseen scenes and 66.7% on unseen tasks.
- Iterative refinement beat the one-shot design on the training set in every setup.
Limits. Runs were capped at 5 iterations, and all evaluations are in simulation.
Takeaway. In these simulations, code and memory written from failure traces moved frozen policies past their fine-tuned versions in some settings.
EnvOpt: Automated Optimization for Agent Environments
Connects to Part 4 (what the model reads)
EnvOpt has a coding agent restructure the files and tools an agent works in, cutting cost 48% on average across five benchmarks.
The problem. Only the model and harness are usually optimized. The authors ask whether a stationary environment (one shared by many tasks) can be optimized too.
What they did. EnvOpt leaves the harness unchanged and edits the environment: what it holds and how it is exposed (tools). A research agent (a coding agent such as Claude Code) runs the target agent on training tasks, reads the trajectories and edits the environment directory. Edits include text conversion, cheatsheets, an index, a database and new tool endpoints. Training tasks have no verifiers, to prevent reward hacking. A validation set stops the loop if cost rises or pass rate drops.
- 1Target agent runstraining tasks, no verifiers
- 2Research agent reads the runsa coding agent
- 3Edit the environmentcheatsheets, index, database, tools
- 4Validationstop if cost rises or pass rate drops
How they tested it. Five benchmarks, including AutomationBench (200 test tasks). There the research agent was Claude Opus 4.8 and the target Claude Haiku 4.5.
What they found.
- On AutomationBench, Haiku 4.5 cost falls 72.7% and pass rate rises 14.34%. The same environment cuts Opus 5 cost by 68.1%.
- EnvOpt beats Meta-Harness by 9.67% pass rate with 15% of its cost. On top of Meta-Harness, it cuts cost a further 83.4% and adds 11.17% accuracy.
- Across the five benchmarks, cost on unseen test sets falls 48% on average, with higher or similar pass rates.
- A big all-values file and a search tool returning many files were rejected, since both made the agent explore more.
Limits. The paper has no limitations section. It covers stationary environments only.
Takeaway. In these tests, reshaping what the agent reads cut cost and helped pass rate without changing the harness.
What these papers show together
RoboArchitect changes the control code around a robot policy, and EnvOpt changes the environment the agent reads; both leave the model itself unchanged.
Up next Section 12: All papers at a glance
Section 12 All papers at a glance
Every paper this blog discusses, in one table: first the 37 that only Section 1 discusses, then the 50 reviewed in Sections 3 to 11 (7 of these also appear in Section 1). The name opens the paper; the second column jumps to where this blog discusses it. Code links were checked only for the 50 reviewed papers.
| Paper | Where in this blog | In one line | Code |
|---|---|---|---|
| Discussed in Section 1 | |||
| OpenHands | Part 1, Part 19 | OpenHands is an open platform for agents that write code, use a command line and browse the web, with sandboxed code execution. | – |
| How Do AI Agents Spend Your Money? | Part 4 | Coding-agent tasks burned about 1,000× the tokens of code chat, and repeat runs of one task varied up to 30× in tokens. | – |
| Anatomy of eleven harnesses | Part 6 | Reading the source of eleven production coding harnesses, the authors mapped seven subsystems and found SKILL.md skills (9/11) ahead of MCP (8/11). | – |
| execute_code only | Part 6 | A lone execute_code tool matched or undercut the cheapest tool-rich setup's cost in 3 of 4 settings, with similar pass rates. | – |
| The Devil Is in the Interface | Part 6, Part 20 | Across six tool designs, a Python code tool solved tasks about as well as bash alone while using 56.3% fewer tokens. | – |
| Tool Recommendation for Multi-Step Agents | Part 6, Part 20 | Tool Recommendation, which suggests tools on demand, cut the bill up to 40% versus a fixed 100-tool list, with unchanged task completion. | – |
| Same Model, Different Harness | Part 8 | Changing only the harness (trimming old tool results, reacting to stalls) raised complete solutions from 43 to 72 under tight context. | – |
| The Complexity Trap | Part 8 | Hiding old tool outputs halved agent cost versus the raw agent on SWE-bench Verified, while matching LLM summarization's solve rate. | – |
| When the harness decides success | Part 8 | When a dropped fact could not be looked up again, cutting old context pushed one model's success to chance in a test. | – |
| Agentic Coding in the Wild (Copilot) | Part 9, Part 20 | In production GitHub Copilot traces, cache hit rates averaged 90% within a turn but dropped across turns and further after model switches. | – |
| Context Has a Price | Part 9, Part 20 | When cached input costs one tenth of new input, adding retrieved code or removing old outputs could make agent runs cost more. | – |
| Token Reduction Is Not Cost Reduction | Part 9 | The heaviest tool-output compression for Claude Code removed 38.4% of those tokens yet raised billed cost 6.8%; prompt-cache traffic dominated input cost. | – |
| TokenPilot | Part 9 | TokenPilot keeps the start of each request unchanged and trims old context in batches, cutting cost 56% to 87% on two benchmarks. | – |
| TraceLab | Part 9, Part 20 | TraceLab released 4,300 coding-agent sessions from the authors' own use, showing long contexts, short outputs and high but imperfect cache hit rates. | – |
| HarnessSecurity-Bench | Part 10 | HarnessSecurity-Bench tested nine security mechanisms in six coding harnesses; turning on auto-approve lifted the attack success rate from 29.2% to 95.6%. | – |
| SWE-Bench Pro V2 | Part 10 | SWE-Bench Pro V2 repaired or retired 480 tasks and limits network access to the model endpoint, so agents cannot retrieve upstream fixes. | – |
| How Do Agent Harnesses Create Value? | Part 11, Part 17, Part 20 | A cheap end-of-run checker rejected 61% of invalid runs but also held back 17% of correct ones; fixed task plans raised success. | – |
| SWE-agent | Part 14, Part 19 | SWE-agent designed an interface for language models, with tools to view, search and edit files and run tests, reaching 12.5% on SWE-bench. | – |
| Better Harnesses, Smaller Models | Part 15 | Automatically adapting harnesses from failure trajectories let the best small model recover 89.7% of large-model performance at 4% of the cost. | – |
| Beyond the Model | Part 15 | Of five harness parts tested, structured tools and task-specific subagents gave the steadiest gains on ProgramBench; context compression could hurt. | – |
| Don't Blame the Large Language Model | Part 15 | Holding the model fixed, 35 Qwen Code releases showed no clear success gain, while tokens per task rose. | – |
| Finding the Right Fit | Part 15 | Across 66 model-harness setups, model rankings flipped between harnesses, and a model's own vendor harness was not reliably its best. | – |
| Harness or Model? | Part 15 | With the same model, vendor and neutral harnesses solved similar shares of tasks; the billed cost ordering is unresolved. | – |
| Stop Comparing LLM Agents Without Disclosing the Harness | Part 15 | For similar frontier models on long tasks, changing the harness moved scores more than changing the model, so comparisons should name the harness. | – |
| AgentLens | Part 16 | AgentLens grades how agents work, not just results; in its 47-task set, 10.7% of passes were lucky (blind retries, no checking). | – |
| Agents Are Systems, Not Models | Part 16, Part 20 | Repeat runs of an unchanged agent setup accounted for about 54% of outcome variance; task information mattered more than model size. | – |
| On Randomness in Agentic Evals | Part 16, Part 20 | Across 60,000 SWE-bench Verified runs, a single run's score could differ by 2.2 to 6.0 points; the authors advise several runs. | – |
| Predictable Agentic Systems | Part 16, Part 20 | Checking plans against a fixed format made repeat runs identical in 3 of 4 setups, on two synthetic tasks and two models. | – |
| Darwin Gödel Machine | Part 18 | The Darwin Gödel Machine rewrites its own agent code and keeps an archive of versions, raising SWE-bench scores from 20.0% to 50.0%. | – |
| DarwinX | Part 18 | DarwinX improves harnesses for an unchanged model and drops any version that scores lower; about 17 points gained across four benchmarks. | – |
| MILO | Part 18 | MILO automatically rewrites whole harnesses and improves its own search method, reaching 86.1% on Terminal-Bench 2.1 with 26% fewer tokens. | – |
| Agentless | Part 19 | Agentless replaced the agent loop with three fixed steps (localize, repair, validate) and solved 32% of SWE-bench Lite at a cost of $0.70. | – |
| AI Harness Engineering | Part 19 | AI Harness Engineering splits a harness into eleven jobs, like context selection, verification and permissions, plus a four-level ladder of runtime support. | – |
| CodeAct | Part 19 | CodeAct had agents act by writing executable Python code instead of fixed-format JSON or text, with up to 20% higher success. | – |
| ReAct | Part 19 | ReAct had language models interleave reasoning steps with actions, such as Wikipedia lookups, instead of only reasoning or only acting. | – |
| EarlyEval | Part 20 | EarlyEval makes agent evaluation cheaper by stopping runs once classifiers predict pass or fail, cutting 13%-26% of steps at 89%-97% accuracy. | – |
| Cost-Inefficient Behaviors | Part 22 | Coding agents showed three cost-wasting habits, such as regenerating similar scripts and re-running tests; developer-designed skills cut cost by up to 41.73%. | – |
| Reviewed in Sections 3 to 11 | |||
| From Model Scaling to System Scaling | Section 3 | A position paper (an argument, with no experiments) saying that agent progress depends on scaling the harness around the model, with a framework, an evaluation agenda and a reference harness. | yes |
| Code as Agent Harness | Section 3 | A survey that treats code as the shared medium of an agent harness and sorts the literature into interface, mechanisms and multi-agent scaling. | yes |
| Natural-Language Agent Harnesses | Section 3 | Harness rules written as editable natural-language documents and run by a shared runtime gave task scores similar to code harnesses; adding one module at a time to a basic version showed which parts helped. | yes |
| Harness as a Language | Section 3 | JAZ, a minimal harness built on one primitive called invoke, matched or beat specialised memory and self-improvement harnesses with prompting alone. | yes |
| What Does a Harness Buy? Tokens, Mostly | Section 4 | Seven models were run in three coding harnesses with reruns; swapping the harness changed about as many task outcomes as rerunning, but changed cost a lot. | yes |
| An Empirical Study of Harness Design for Coding Agents | Section 4 | Controlled ablations of context management, planning and tool set in one coding harness show each component's effect depends on model, budget and task. | no |
| The Harness Effect | Section 4 | Engineers at Writer swap a conventional agent loop for their own harness across six models; cost per task falls 41% while quality stays level. | no |
| It’s Not the Capability | Section 4 | A 432-run test of three prompt harnesses on six models finds no single best level: strict helps one reasoning model and hurts one chat model. | no |
| Scaling Laws for Agent Harnesses via Effective Feedback Compute | Section 4 | The paper proposes Effective Feedback Compute, a count of useful tool feedback, and reports that it predicts harness success better than tokens or cost. | no |
| Model or Harness? An Interaction-Centric Taxonomy for Localizing Agent Failures | Section 4 | The paper proposes 41 agent failure modes, each tied to a pair of components and a fault side, and checks them with four LLM judges. | no |
| Automata from Agent Traces | Section 4 | The paper builds small finite-state machines from agent traces and uses them to predict the next step and task failure on twelve public datasets. | no |
| Is Grep All You Need? How Agent Harnesses Reshape Agentic Search | Section 5 | A study of grep versus vector search inside four agent harnesses: grep usually won, and moving to another harness changed accuracy about as much as swapping the search tool. | no |
| Context as Infrastructure | Section 5 | Compiled claim-evidence pairs in a RAGFlow search harness cut query tokens 38% on average on FRAMES, with no detectable accuracy gain. | yes |
| PRO-LONG | Section 5 | PRO-LONG gives a coding agent a searchable log of its past; on ARC-AGI-3 it matched or beat specialized harnesses while using 4.2 to 5.8 times fewer tokens. | yes |
| Harness-1 | Section 5 | Harness-1 trains a 20B search agent with reinforcement learning while the harness keeps its search state, reaching 0.730 average curated recall on eight benchmarks. | yes |
| AutoCompact | Section 5 | AutoCompact trains a coding agent to choose when to compact its context and what to keep; pass rates rose 9.2 and 5.0 points. | no |
| Evolving Agent Interfaces | Section 5 | Agent S4 evolves interfaces for a computer-use agent from synthetic task runs; Qwen3.8-27B with them reaches 21.30% binary success on OSWorld V2. | yes |
| JevAgentHarness | Section 5 | A harness hands routine multiple-choice steps to a small decision model when it is confident; a fitted threshold keeps task success while cutting cost. | yes |
| Harness-IF | Section 6 | Harness-IF scores coding agents on one rule at a time across instruction surfaces; all 12 models do worse on rules that oppose their defaults. | no |
| Rethinking Verification in Agent Harnesses | Section 6 | The paper compares 17 ways to add verification to a coding harness; a separate critic that reviews the work gave the best accuracy for its cost. | no |
| VeriHarness | Section 6 | VeriHarness lets a model check its own sampled outputs against the workspace; in the authors' tests it beat voting and judging baselines on five benchmarks. | yes |
| Mid-Harness | Section 6 | Mid-Harness samples several next commands and lets a verifier pick one before it runs; in the authors' tests, verifier quality decides the gain. | no |
| Think Before You Act | Section 6 | JevAct checks selected tool calls against compiled policy checks before they run; in the authors' tests it helped most on Telecom and was mixed on Airline. | no |
| Harness-of-Harness | Section 7 | Harness-of-Harness (HoH) wraps an existing coding harness in repeated plan, code and test loops, and in the authors' tests it beat the plain harness on three benchmarks. | no |
| Harness Engineering for Software Engineering via Modular Executable Dev-Primitives | Section 7 | HERMES gives each repository file its own resident LLM agent; in the authors' tests it raised resolution rates over matched baseline harnesses by 12.4 points on average. | no |
| AutoHarness | Section 8 | Gemini-2.5-Flash writes its own code harness for 145 text games, which stops illegal moves and lets it beat larger models. | no |
| Meta-Harness | Section 8 | A coding agent searches over harness code while reading all earlier candidates' code, scores and traces; it beats hand-built harnesses on three tasks. | yes |
| Agentic Harness Engineering | Section 8 | AHE splits a coding agent's harness into files that another agent edits, predicting what each edit will fix; ten rounds lifted Terminal-Bench 2 from 69.7% to 77.0%. | yes |
| Self-Harness | Section 8 | A model mines its own failures, proposes small harness edits and keeps only edits that pass regression tests; all nine model-benchmark pairs improved. | no |
| ParetoSaddler | Section 8 | ParetoSaddler optimizes agent harnesses for quality and cost together by keeping candidates that improve either one; it raised quality and cut cost on two benchmarks. | no |
| SoL-Pi | Section 8 | An AI researcher searched for ways to cut a coding agent's token use; four kept mechanisms cut token traffic 44.7-49.0% at similar scores. | yes |
| HarnessMM | Section 8 | HarnessMM stores actions the model already decided and runs them when tool results allow; on HumanEval it cut tokens by 29.54% (Codex) and 87.93% (DeepSeek Harness). | yes |
| LongCapHarness | Section 8 | LongCapHarness has a strong model build reusable harnesses for long-context tasks; small models run them without training and beat trained baselines on average. | no |
| Harness-R1 | Section 8 | A 9B model is trained with reinforcement learning to patch another agent's runtime; average success on three benchmarks rises from 44.3% to 53.6%. | yes |
| Exo | Section 8 | Exo lets an agent edit its own harness during a task, behind a protected core; model cost fell 12–53% versus Codex and Pi in game runs. | yes |
| Prime Agent | Section 8 | Prime Agent is an open-source harness with a persistent Python REPL and recursive subagents; the authors report it matches or exceeds other harnesses on long tasks. | yes |
| Harness Handbook | Section 8 | A behavior-organised map of a harness's code helps a coding agent find where to edit; plans won more often and used fewer planner tokens. | yes |
| Rethinking the Evaluation of Harness Evolution for Agents | Section 9 | Under matched budgets on Terminal-Bench 2.1, harness evolution does not beat simply trying each task several times and does not generalize, but it helps on long-horizon games. | yes |
| RRSI | Section 9 | RRSI adds limits on how much the harness may change during automatic evolution so that evolved harnesses keep more of their gains on benchmarks the search never saw. | yes |
| Trustworthy Recursive Self-Improvement with Statistical Guarantees | Section 9 | TRUST decides whether to keep a harness update with a statistical test that limits how many kept updates are worse, rather than accepting any higher validation score. | no |
| Harness Continual Learning | Section 9 | HCL updates a harness over a stream of tasks around a frozen model and commits an update only if it does not break earlier behavior. | yes |
| Are Self-Evolving Agents Continual Learners? | Section 9 | The paper tests whether self-evolving agents keep old skills while learning new ones, and finds that more learning goes with more forgetting and interference. | no |
| Language model harnesses can be Compositional Generalizers | Section 10 | The authors train models inside harnesses that keep context outside the prompt and call sub-agents. The Recursive Language Model harness carries short-task training over to longer tasks. | yes |
| OpenForge RL | Section 10 | An open framework that trains models inside real harnesses such as OpenClaw and Codex. Trained models beat open baselines of similar size on most benchmarks. | yes |
| Harness Scaling for Generalizable Agentic Reinforcement Learning | Section 10 | The authors train a model through many varied harnesses, picked by a balanced design, so it works on unseen harnesses. It beat single-harness RL in their tests. | no |
| Self-Evolving Coding Agents via Harness-Policy Optimization | Section 10 | Self-HPO alternates harness edits and reinforcement learning, with the model proposing its own harness changes. It beat harness-only and policy-only baselines. | yes |
| Harness-Aware Distillation for Small Language Model Agents | Section 10 | Harness-Aware Distillation (HAD) trains a small agent to act on harness information, and beat four baselines in the authors' text-game tests. | no |
| Harness-Zero | Section 10 | Harness-Zero copies the behavior of an evolved harness into model weights, so a 9B model beat its own harness-equipped self after the harness was removed. | yes |
| RoboArchitect | Section 11 | RoboArchitect lets a coding model write and revise the harness around a frozen robot policy, raising held-out success in simulation without any weight updates. | yes |
| EnvOpt | Section 11 | EnvOpt has a coding agent restructure the files and tools an agent works in, cutting cost 48% on average across five benchmarks. | no |
Up next Section 13: What is still open
Section 13 What is still open
This section updates the open questions in Part 20 with what the 50 papers in Sections 3 to 11 add; each paper name links to its write-up. One status changed: measuring a harness is now partly answered, because a measure has been proposed and tested.
| Question | Status now | What the 50 papers add | Still missing |
|---|---|---|---|
| How much does the cache save or lose when old content changes? | Partly answered | In PRO-LONG, compacting the history sooner nearly halved input tokens but not the bill, because less input came from the cache. SoL-Pi compacts when the saving beats the cost of rewriting the cache, or when the history nears the window limit. | Cache cost, call by call, of adding or changing tools mid-run. |
| Does loading tools on demand beat loading all of them? | Partly answered | No direct test. An Empirical Study of Harness Design compares its full tool set with a smaller bash-based one, not on-demand loading; which did better depended on the model and benchmark. | A direct test on SWE-bench-style tasks, priced with the cache. |
| How does adding one tool change the agent's path, step by step? | Partly answered | EnvOpt rejected a search tool that returned many files, because it made the agent read more. In What Does a Harness Buy?, an audit found that some models, when able to reach the internet, often fetched the real fix, and those runs passed more often. | A planned test that adds one tool at a time and traces each run. |
| How much do repeat runs differ? | Answered | What Does a Harness Buy? confirms it (Section 4). Harness searches now allow for it: ParetoSaddler keeps a change only if repeated runs show a credible gain, and RRSI rejects a costly change whose gain is within its rerun spread. | Nothing major. |
| Which harness parts cause the difference between repeat runs? | Open | An Empirical Study of Harness Design varied real parts on real coding tasks but ran each setting once, so it cannot say which parts cause rerun differences. | Repeated runs of real harness parts on real coding tasks. |
| Can a cheap early score judge a harness without full runs? | Partly answered | Automata from Agent Traces ranks failing runs above passing ones from a partial run, but only weakly, and it judged single runs. In AHE, the editing agent predicted which tasks an edit would fix well above chance, but named few of the tasks it would break. | An early score that ranks harness candidates, including what an edit will break. |
| Does harness search beat simpler methods? | Partly answered | RRSI, Self-HPO, Self-Harness and AHE compare against the starting harness, other search methods or training alone; none compares against plain retries at the same budget. | That check on SWE-bench-style tasks, scored on tasks the search never saw. |
| How do we check that a fix behaves correctly? | Open | The checks that worked best in Section 6 (Rethinking Verification, VeriHarness, Mid-Harness) were judged by how much they raised the pass rate, not by how often the checker itself was right. In EnvOpt, an added test check rejected some correct bug fixes. | A checker for code fixes, measured on bad fixes caught and good fixes wrongly rejected. |
| How do we measure how good a harness is? | Partly answered | Scaling Laws for Agent Harnesses proposes a measure, useful feedback per unit of cost, that predicted success well on real runs, but only for seven harnesses its authors built. Model or Harness? sorts failures by where the fix belongs but does not count them. | A measure that other groups adopt and test across many harnesses. |
New questions the papers raise
- How can a harness that keeps changing learn new tasks without losing old ones? Re-checking a sample of old tasks reduces the loss but cannot rule it out. (Are Self-Evolving Agents Continual Learners?, Harness Continual Learning)
- How do we stop a self-improving harness from keeping changes that raise its score but not its work, such as a saved shortcut? (Prime Agent, RRSI, EnvOpt)
- How far do training gains carry to harnesses a model never trained in, and which behaviour belongs in the weights rather than in harness code? (OpenForge RL, Harness Scaling, Harness-Aware Distillation, Harness-Zero)
- Does a harness built for one model work with another, and how capable must a model be to improve its own harness? (AHE, SoL-Pi, Exo, LongCapHarness)
- What may a harness change about itself, what must an edit pass before it goes live, and how is a bad edit undone? (Code as Agent Harness, Exo, Prime Agent, ParetoSaddler, TRUST)
Update log
- November 29, 2026. Section 12 now lists every paper in the blog, including the ones only Section 1 discusses. Added Section 13, which updates Part 20's open questions with the 50 papers, and a short "Start here" path.
- November 29, 2026. Added a diagram for each of the 50 papers, icons to the diagrams and to Figures 2, 6 and 7, 20 short code excerpts from the authors' repositories, 20 figures from the papers (CC BY 4.0, credited in each caption), and a credits list.
- November 29, 2026. Added Sections 2 to 12: how the papers were chosen, write-ups of 50 papers in nine topic sections, and a table of all 50. These sections replace the first version's reading list.
- November 29, 2026. First version: the guide (Section 1), 7 figures, and a reading list of 43 papers.
Credits
- Icons in the diagrams and figures: free icons by Magnific from Flaticon, used under the Flaticon licence, which asks for this credit. Each icon links to its page: Balance, Books, Box, Chat, Check, Checklist, Code, Cogwheel, Column, Compass, Database, Diskette, Document, Error, Eye, Folder, Game console, Industrial robot, Link, Log, Magnifying glass, Money bag, Mortarboard, Note, Padlock, Paper, Pencil, Process, Puzzle, Repeat, Rise, Robot, Ruler, Shield, Stopwatch, Test tube, Toolbox, Trophy, Wrench.
- Figures marked "from the paper" belong to their authors and are reused under the licence named in each caption.
- Code excerpts are copied from the authors' repositories; each caption links the exact file and names its licence.
- The starting list of papers: DAIR.AI's weekly paper roundups.
- Share, arXiv and GitHub icons: Font Awesome Free and Academicons; the X logo is drawn in the page.
Memory
Context
Skill routing
Orchestration loop
Verification and governance
Interface layer
Mechanism layer
Scaling layer
Harness as a document
Child agents do the work
Exact steps stay in code
Self-improvement
Compare
Cost
One small loop
176 settings
24 tasks checked with git
Read each trace
Predict success
A failure
Find the edge
Fault side
Many traces
Small state machine
Search tool
Result path
Compile first
Trained by RL
L1: reminders
Planner
Tester
Dev-Primitives
Play
Choose at the end
Protected core
Continual Harness
Limits
Set the testing level
Frozen robot policy