Skip to the content
Software Made Clear Diagrams that show the mechanism About

The harness

ANSWER

Every agent reads the same version-controlled instruction set before it does anything, so one edit changes the whole fleet at once. It holds the rules, the conventions, the reference implementations and the order in which they win — and it is the part of a factory you actually author.

IN PLAIN TERMS

Every agent starts its morning like a new contractor handed a folder. Site rules first, then the job sheet, then how this firm does things, then whatever they learned at their last job. The order matters more than the contents — the last page is the one that gets them into trouble.

In a factory the model is a dependency you upgrade. The harness is the thing you write. It is the set of version-controlled instruction files every agent reads before it does anything, and because they all read it, one edit changes the behaviour of the whole fleet — which is an unusual amount of reach for a file with no tests.

What the harness actually is#

Four kinds of thing, and it is worth keeping them apart. Entry-point rules that say how work proceeds at all — research before planning, planning before implementation. Standing rules that must hold across every change: security boundaries, the architecture contract, git conventions, what the tests are for. A map of the system, so an agent looking for the code that handles a thing is not exploring twenty services one grep at a time. And named reference implementations — this is what a well-formed one of these looks like here, copy its shape.

What does not belong is anything true of one work item only. That belongs on the item. The test is whether a statement would still be true next month for a different change; if not, it is context and it goes in the hand-off. Harnesses rot when this line is not held, because every incident produces the temptation to add one more sentence.

The map is worth building deliberately rather than leaving to exploration. A machine-readable file naming each service, the paths it owns, its dependencies, the team accountable for it, its build command and its risk class does two jobs at once: it makes the agent’s answer to which services does this touch a lookup instead of a guess, and it cuts how much of the codebase has to be loaded to answer the question. Both of those show up on the bill.

Precedence, or it is just a pile#

A harness with five sources of truth and no stated order is five sources of truth that will eventually disagree, resolved each time by whichever the model happened to weight most. The order has to be written down, and the useful thing about writing it down is that it forces you to notice where the model’s own knowledge sits.

CONSULTED IN THIS ORDER1Security and architecture rules2The ticket's own acceptance criteria3Written decisions and design records4Gates the build already enforces5Named reference implementations6Whatever the model happens to knowand a finding from the last rung says so, in the finding
Width is authority. The bottom rung is where a general-purpose model starts by default, which is why the other five have to be written down.

Bottom. It sits at the bottom, consulted only where the repository is silent — and a finding that rests on it says so, in the finding. That is the inversion that makes a harness worth having, because the default for a general-purpose model is the opposite: it starts from everything it has read and treats your repository as one more input. A reviewer that flags a pattern as wrong because it is unusual in open-source code, when the codebase has a written decision saying otherwise, has consulted the rungs in the wrong order.

Width in that figure is authority, and the narrowing is the point. Each rung constrains what the rung below is allowed to decide. A security rule does not argue with a local pattern; it removes the question. Which is also the honest reason the top rung exists at all: it is the set of things you are not willing to have decided per run.

The part that regresses#

Here is the thing that catches teams out. When agent quality drops, the instinct is to look at the model — a new version, a different tier, a provider incident. It is usually the harness. The harness is what changes every week, edited by people, with no build failing when a new rule quietly contradicts an old one. The model changes rarely and loudly.

There is a structural reason for it, and Spotify’s write-up names it from the other direction: in their more fragmented codebases, agent performance is measurably worse. Consistency of the surrounding code is the strongest predictor they report. A harness is an attempt to state, in prose, what a consistent codebase would have shown by example — and the more inconsistent the code, the more the harness has to carry, and the more of it there is to contradict itself.

Which leads to the discipline that turns this from a warning into a practice: a harness change is a code change, so it gets a code change’s treatment. It is reviewed. It is versioned, and the version is recorded against every run so that a bad week can be attributed to something. It is rolled out to a few work items before the whole fleet. And it is replayed against a fixed set of already-solved work before it goes live, because that is the only way to find out whether an edit that reads like an improvement actually is one. A model upgrade goes through the same gate, for the same reason: what you are measuring was never the model alone.

The other failure is slower and harder to reverse. Every time an agent gets something wrong there is pressure to add a sentence, and none of those sentences is unreasonable on its own. After a year the file is long enough that no one has read all of it, two rules in it conflict, and the agents are behaving unpredictably for reasons nobody can locate. The counter-pressure has to be deliberate: something is removed or narrowed when something is added, and a rule that has never changed an outcome is deleted. A harness that only grows is a record of past incidents wearing an instruction set’s clothes. The first place that discipline pays off is the step that decides whether work is buildable at all.

IF YOU REMEMBER ONE THING

The model is a dependency; the harness is your source code. It is edited more often, tested less often, and read by every agent you run — which makes it the most likely explanation for a bad week.

Questions people also ask

4 QUESTIONS
What goes in a harness and what does not?

In: rules that must hold across every change (security boundaries, architecture contracts, git and code-style conventions), a map of the system, and named reference implementations to copy. Out: anything specific to one work item — that belongs on the item. The test is whether the statement would still be true next month for a different change. If not, it is context, not harness.

Why does a harness need a precedence order at all?

Because its sources disagree, and without a stated order the model resolves the disagreement itself and you cannot predict how. A security rule and a local pattern in a neglected corner of the codebase will eventually contradict each other; the order is what decides that in advance rather than per run.

How do you stop a harness growing into contradictory instruction files?

By treating additions the way you treat code: something has to be removed or narrowed when something is added, and a rule that has never changed an outcome is deleted. The failure mode is a file that grows every time an agent gets something wrong, until nobody can say what it requires — at which point it is no longer an instruction set, it is a record of past incidents.

Is a model upgrade a harness change?

In practice yes, and it should be run through the same gate. The behaviour you observe is the behaviour of the model and its instructions together, so swapping either one changes the system. Spotify reports the same effect from the other direction: agent performance tracks the consistency of the surrounding code, which is a property of the environment rather than of the model. That is the argument for versioning the harness and replaying a fixed set of work against every change to it.