Evaluate your harness so you can maintain it
🤔 A question to start with: if you add a line to your AGENTS.md, does your agent work better, or worse?
For a long time, nobody on the team could answer. So we debated it, and ended up adding nothing, for fear that it would be useless or, worse, that it would degrade the agent's work.
So we decided to find out for sure: what does one more line in AGENTS.md actually change?
Use betterleaks (config: root `.betterleaks.toml`) for any secret / API key check. Never rely on ad-hoc `grep`
We picked this line, which mentions betterleaks, our secret scanner, and a task where it can help: add our database connection string, then commit. The string contains a password, a secret that has no business being in git. Same repository, same agent, same task: 20 runs without the line, 20 runs with it.
In both sets of runs, the agent refuses to commit the secret. But without the line, it only thinks of the team's tool 3 times out of 20, compared with 20 out of 20 with it. And that tool is exactly the one we want it to use. One line was enough to change its behaviour, and it made us want to measure the whole harness.
AGENTS.md takes the agent from 3 runs out of 20 to 20 out of 20.Coming up:
- What the harness is, and why measure it.
- Why test it as a whole, rather than skill by skill.
- How we measure it.
- What we got out of it, and how to get started yourself.
🧩 The harness, and why measure it #
A coding agent already has its own harness: the one its vendor ships (Claude Code, Codex, Warp…). It is the loop that calls the model, the tools, the system prompt. It is called the agent harness, or inner harness.
On top of it, each team builds its own. Birgitta Böckeler calls it the user harness, Shawn Wallace the outer harness: “a second harness wrapped around the first”. It includes the instructions (AGENTS.md and skills, written procedures the agent loads on demand), the automated checks (hooks, tests, linters), and the code itself. Its structure and conventions guide the agent as much as any instruction: it imitates what it finds.
For us, that means:
- an
AGENTS.md; - about forty skills;
- a pre-commit hook that runs the build, tests, coverage and a secret scan on every commit;
- code organised by business use case.
Birgitta Böckeler had already pointed out what was missing:
“We need a way to evaluate harness coverage and quality similar to what code coverage and mutation testing do for tests.”
As long as you don't measure, it stays uncertain. The agent rereads AGENTS.md in every session: one more useless line means wasted tokens. One line fewer may mean a behaviour you lose without noticing. And when a new model version comes out, the agent can behave differently with the same harness. So without measurement, it's gut feeling…
🔍 Why not evaluate skills one by one? #
We already evaluate some of them in isolation, and that has its uses. A skill has its own behaviour, but for the harness, it is an internal part: evaluating it alone means testing an implementation detail (one element of the harness), not its use case.
With code, we learned to test what the user sees: the unit under test is the use case, not the class. Ian Cooper argues this in TDD, Where Did It All Go Wrong: a class has behaviour too, yet we don't test it on its own. The harness is no different. What matters is that the agent delivers the right PR given everything it reads at once: AGENTS.md, several skills, the existing code, the hook messages. A perfect skill can be contradicted by another instruction, or never be loaded at all.
And like a test too tightly coupled to the implementation, a skill evaluation breaks as soon as you reorganise, even though the outcome hasn't changed. A use-case test survives refactoring. That is what we are after: being able to move an instruction, merge two skills or slim down AGENTS.md without breaking anything.
📏 How we measure #
For us, evaluating means answering two questions: does the harness do the job, and how much does it cost in time and tokens. A harness that works but takes an hour will be unusable day to day.
First, we always give the same task to an agent starting from scratch: a small change, already specified and reviewed. It doesn't know what we are going to check. It sees the task through to opening a PR, just as it would for real. (The PR is simply what the workflow under evaluation produces, the one that builds a feature. Another workflow would have another output to check.)
Then we compare what it produced against a checklist: the right level of review (did the agent ask for a human review when it should have?), the right files touched, tests and coverage, every check green, a description that states the business intent. A script checks almost all of it, and we use AI only for the non-deterministic checks.
At first, we only looked at the PR. We quickly realised that wasn't enough: a clean PR doesn't tell you whether the deterministic checks (in our case, the .NET analyzers) ran, nor how much time and how many tokens it took to get there. So we turned on tool traces, to observe how the run unfolds as well.
Finally, we rerun it several times: with a system that never answers the same way twice, a single run doesn't tell you much.
📈 What we got out of it #
🔁 Reliability
Being reliable means giving the same result every time, under the same conditions.
Five reruns of the same case, without changing anything: four pass, the fifth fails. The coverage check measured 1.6 points less on code the agent hadn't touched. The culprit: our coverage tool, which is flaky.
We measure this with two numbers: pass@k, the probability that at least one run out of k succeeds, and pass^k, the probability that they all succeed. Here, pass@5 is 1 but pass^5 is 0: the harness can do it, but we can't yet count on it every time. A single run would never have shown us that.
Rerunning several times lets us tackle these problems thoroughly, instead of discovering them one by one as random failures turn them up. The workflow becomes more predictable, and therefore more reliable.
🛡️ Robustness
Being robust means still working when conditions change: another folder, another machine, another model.
The evaluation now runs after every merge. We expected failing tests. What we mostly find are configuration problems.
For example: our pre-commit hook crashed in a git worktree, but worked in the repository's main working tree. And the agent always works in a worktree. A single evaluation surfaced several defects of this kind.
Another condition that changes: the model. We reran our case on several models. It also passes with models more than twenty times cheaper, and fails with others. If the harness holds up with a small model, it is solid.
💰 Cost and speed
More than 120 reruns in three weeks gives you real data. Looking at it, we saw that each step of our workflow started with about 70,000 tokens of tool and skill lists it never used. Trimmed down, the steps start with about 8,000 tokens. That trimming alone cut the cost in half. With other fixes, the median run time also went from 16 to 11 minutes.
🔌 Decoupling
By rerunning over and over, we also saw where the agent drifted: on steps where there was nothing to decide, like creating the branch or ticking a box. We moved those steps out of the AI into a program, which only calls the agent for what requires judgement. As a result, we pick the agent and the model at launch, and we can compare them on the same case: some pass, others don't.
📊 Everyday confidence
We trust what the agent produces more, so we hand it more: its workflow opened 2 to 3 PRs a week before October; since then it has opened more than 20 a week. Not all of it is down to the evaluation, but the team's impression points the same way.
🪜 Getting started yourself #
You don't need all our tooling. Start small, and climb one step at a time:
- One session, one prompt. The shortest prompt that gets the agent to carry a real task through to the end. You look at the result yourself.
- An evaluation skill. It runs that prompt in a fresh session, waits for the run to finish, then runs one check.
- Automation. The skill runs on its own, for example after every merge.
- A program. Once the steps are stable, code replaces the instructions. That is what our workflow has become.
Each step builds on the previous one. Start with the first.
For the first check, keep it simple: a maximum duration for the run or, less prone to false positives, checking that the tests did run before the agent opened the PR.
It is quick to set up. The reruns are what cost money: $2 to $4 each, so a few hundred dollars for our 120. Rerunning with a smaller model helps a lot: that is what we do after every merge, for about $0.18 a run.
🚧 The limits, and what we take away #
We have only one case and six weeks of experience: it's a start. And two limitations will matter more as we add cases.
Cost. Every rerun has a price. After every merge, we already run on a small model, for about $0.18 a run. Ideally, a free model would let us evaluate without worrying about the bill.
Duration. A single case already takes about ten minutes. Each new case adds that much again to the feedback loop. Hence the value of a fast model, but also of choosing your cases well: few of them, each going through a part of the harness the others don't cover.
Others are exploring this question too, with approaches that can complement ours: Anthropic on building agent evaluations, Cortex on measuring every change to the harness, removals included.
Our main takeaway is that we have taken back control of the agent's runs. We waste less time on drift we never intended and, above all, we can see it, so we can fix it. Because evaluation isn't only about blocking a behaviour: every run produces data, and looking at it is how we found most of our improvements.
The reflex, at least, seems to have stuck: before touching the harness, we ask how we'll know it worked.
In a second article, Evolving your harness with TDD, we cover the next step: writing the expectation before changing the harness. And an upcoming article will cover harness observability: what these runs teach us when we look at them closely.
🙏 Thanks to Quentin Pautrat, Florian Metoz and Mehdi Houacine for reviewing this article.
📚 Sources #
- Birgitta Böckeler, Harness engineering for coding agent users, 2 April 2026
- Shawn Wallace, Let's Talk About Harnesses, 6 October 2026
- Anthropic, Demystifying evals for AI agents
- Cortex: Measurement-Gated Evolution and Pruning of Coding-Agent Skills and Rules, October 2026
- Ian Cooper, TDD, Where Did It All Go Wrong, conference talk
- Mark Chen et al., Evaluating Large Language Models Trained on Code, July 2021, which defines pass@k
- betterleaks, the secret scanner used in the opening test
- AGENTS.md, the open instruction format for coding agents
- Agent Skills, Anthropic documentation
- Git, githooks and git worktree
- Microsoft, Code analysis in .NET (analyzers)
- Shunyu Yao et al., τ-bench: A Benchmark for Tool-Agent-User Interaction in Real-World Domains, June 2024, where pass^k comes from