Assemble context
Task, rules, memory, last result.
01 · Opening
The harness around the model decides what the model can do.
20 minutes. Engineers and leadership.
01 · Opening
01 · Opening
A harness is the loop, tools, context, memory, evals and guardrails around a model.
02 · Anatomy
loop — the turn cycle
Model call, tool run, observation, repeat. It ends when the model stops or a turn limit fires.
02 · Anatomy
Task, rules, memory, last result.
One action at a time.
Name, arguments, intent.
Inside the boundary.
Output, exit code, error.
Trim, then next turn.
The last observation becomes the next turn's first input.
02 · Anatomy
The world supplies raw state.
The harness builds the turn.
The model returns one next step.
03 · Why they fail
Sharp early. Deep into the run, it contradicts its own decision.
Every token competes for attention; recall fades as the window fills.
Compact the history, clear stale tool output, load files on demand.
The same tool twice, or the near-identical one beside it.
Overlapping tools create ambiguous choices and eat the window.
Fewer tools, one verb each, named for what they return.
It reports done. The trace shows that no check ran.
With no check, looks done is the only stop signal it has.
A verify step that returns pass or fail, inside the loop.
A new session walks back into last week's dead end.
State lives in the window, and the window is discarded.
Notes on disk, read at start, small enough to be read.
03 · Why they fail
One tool. No scope, no check, no exit condition.
// the whole interface: one tool, no rules
{
"name": "shell",
"description": "Run any command.",
"input_schema": { "command": "string" }
}
// loop: run it, append output, repeat until "done"
Three scoped tools. One verify gate it cannot skip.
// three tools, one verb each
read(path, range) // read-only
edit(path, old, new) // exact match or fail
verify(cmd) // exit code is the truth
// loop: plan -> act -> verify
// verify fails: read the error, fix, verify again
The model is identical in both runs. Only the tool schema and the loop changed.
03 · Why they fail
SWE-bench Lite, 300 tasks · GPT-4 Turbo in all four runs · Yang et al., SWE-agent, NeurIPS 2024 (Tables 1 and 3)
Same model: 2.7% to 18.0% resolved. Third bar is that agent with its edit linter removed.
03 · Why they fail
tasks, from your own repo
$ harness-eval run --suite ./evals # 42 tasks
pass@1 0.78 → 0.71 regression
cost/success $0.38 → $0.44
merge blocked
Example run. The suite runs on every pull request that touches the harness.
04 · Cost and risk
Anthropic API pricing, Claude Sonnet 5.5: $2 input / $10 output per MTok. Read 24 Oct 2026.
Each step waits for the one before it. Two extra model calls are two more round trips on every task.
A retriever that runs on every turn is a tax. One that runs when the model asks is a tool.
A passing check is attached to every diff. The reviewer reads the change, not the transcript.
Pays in review minutes, now.
The reviewer reconstructs intent from a log. Defects arrive as incidents, with a customer attached.
Pays in incident time, later.
A cheap model with a good harness can beat an expensive model with a bad one. opinion
Same model. Different harness. Different score.
04 · Cost and risk
Files, logs, test output.
path allowlistEdits to tracked files.
sandboxBuild, test, migrate.
approval gate forAPIs, registries, the open web.
egress allowlistMove right only when the task needs it.
Prompt injection is an input-trust problem, not a model-behaviour problem.
05 · Team and process
owns the loop and the tool layer
owns the task suite and the gate
owns what enters the window
owns the trust boundary: tools, permissions, data
owns which workflows get a harness
Two or three people can start this, part time.
05 · Team and process
Pick a failed trace
Name the harness cause
Change one harness part
Rerun the suite
Keep or revert
One change per run, or you learn nothing.
05 · Team and process
Twenty real tasks. Pass or fail, by hand.
A full trace of every run.
One verification step. One scoped tool set.
The suite in CI. A regression gate.
One named owner. A weekly trace review.
05 · Team and process
The tell
Your score climbs. Production does not.
The harness learned the tasks, not the work.
The countermeasure
Hold out ten tasks. Rotate them each quarter.
Report the held-out number, never the tuned one.
The tell
Every incident adds a paragraph. The rules start to cancel out.
Nothing is wrong with any single line.
The countermeasure
Prune to rules that change behavior. Move hard rules into hooks.
Hooks are deterministic; prose is advisory.
The tell
The failure leaves the dashboard. The bug stays in the product.
The suite is green because the suite was edited.
The countermeasure
Grade on a check the agent cannot edit.
Then read the trace, not the summary.
The tell
One private harness beats the team's. Nobody can reproduce it.
It skips the review path everyone else uses.
The countermeasure
Check the harness in. Every run lands as a reviewed diff.
Same tasks, same tools, same review.
06 · Payoff
06 · Payoff
The model will keep changing. The harness is the part you own.