AI & Machine Learning

What is an agent harness, and why can it matter more than the model?

Agent = model + harness. What an agent harness is, why the same model can score much higher in a different harness, and how guides and sensors steer an agent.

Erik van de Blaak
Erik van de Blaak
6 min read • 484 views
What is an agent harness, and why can it matter more than the model?

Put the smartest professor in the world in an empty room. No pen, no paper, no computer, and after every conversation he forgets everything. However brilliant he is, he won't finish a project.

That's how a bare language model works. It can reason and write, but it can't open a file, run a test or remember what it did yesterday. Everything that makes those things possible has, since early 2026, increasingly been called the agent harness. And the choice of harness sometimes turns out to matter more than the choice of model.

What is an agent harness?

An agent harness is all the code, configuration and execution logic around a language model that turns the model into a working agent. The formula used by LangChain (March 2026) and Thoughtworks, among others: agent = model + harness. The model supplies the intelligence; the harness decides what the model sees, which actions it can take and what happens with the results.

Claude Code, OpenAI Codex and Hermes Agent are examples of harnesses. Under the hood they all run the same loop: assemble the prompt, call the model, execute the tool calls the model asks for, feed the results back, and repeat until the task is done.

How much does the harness matter?

A popular claim is that "the same model performs up to six times better with a better harness, according to Stanford". That's half right. The Meta-Harness paper (March 2026) by researchers from Stanford and MIT says in its introduction that changing the harness around a fixed model can produce a sixfold performance gap on the same benchmark. That figure comes from earlier work by others. It describes the gap between a bad and a good harness, not a promise that your agent will get six times better.

What the researchers showed themselves is interesting too. They had an AI system search automatically for better harness code. On the coding benchmark TerminalBench-2, Claude Haiku 4.5 scored 37.6 percent in the harness they found, against 27.5 percent in Claude Code. The same small model, a ten-point difference, purely from the code around it.

That makes "which model should we use?" less decisive than it looks. A cheaper model in a good harness can catch up with a more expensive model in a mediocre one.

What's in a harness?

There's no fixed list, but these parts show up in nearly every serious harness:

  • The agent loop. Keeps calling the model and returning tool results until the task is done or a limit is hit.
  • Context management. Decides what fits in the limited context window: what stays, what gets summarised, what gets written out to a file.
  • Tools and skills. Access to files, shell, web, APIs and databases, plus descriptions that tell the model when to use which tool.
  • System prompt assembly. Puts together the instructions, project rules and relevant context for each task.
  • Subagents. Hand subtasks to separate agents, each with its own clean context window.
  • Session persistence. Saves state so an interrupted task can pick up where it left off.
  • Hooks. Fixed points where deterministic code runs, such as a linter after every edit or human approval before a payment.
  • Permissions and sandbox. Decide what the agent may do: which folders, which commands, which network access.

Framework or harness?

In 2023 and 2024 you built an agent with a framework such as LangChain: a box of building blocks you wire together yourself. A harness is the result of that building, ready to use. You give it a goal, and the loop, the tools and the safety rules are already in place.

For people who deploy agents, that shifts the work. You build less and configure more: which instructions, which tools, which checks. That configuring now has a name: harness engineering.

Fewer tools, better agent

Improving a harness doesn't automatically mean adding things. Vercel built an internal agent that answers questions about their data with SQL. After months of work it had a set of specialised tools, heavy prompt engineering and careful context management, and it was fragile and slow. The team deleted nearly all of it and kept one tool: running arbitrary bash commands in a sandbox.

On their own test set of five representative questions, the success rate went from 80 to 100 percent, with roughly 40 percent fewer tokens and steps, and 3.5 times faster. Vercel adds an important condition: it worked because their data definitions were already well documented in tidy YAML files. A simpler harness won't fix a messy data layer.

Five questions is a small test, so don't draw hard conclusions. The pattern is familiar, though: every extra tool is one more thing the model has to think about, and tools that summarise what the model could read for itself mostly add noise.

Guides and sensors: steering an agent

Because a language model isn't fully predictable, you need two kinds of steering. Birgitta Böckeler of Thoughtworks describes them in her article on harness engineering (April 2026) as guides and sensors.

Guides steer beforehand (feedforward). They raise the odds of getting it right the first time: instructions, project conventions, examples, templates.

Sensors check afterwards (feedback). They show the agent its own mistakes so it can fix them before a human looks.

Both can be computational (deterministic and fast, like tests, linters and type checkers) or inferential (a second model that judges; slower and less predictable, but able to catch things a linter can't).

An example: a coding agent works in a PHP project. A guide is an instruction file with the project's conventions: where the classes live, how migrations are named, which functions are off limits. A sensor is a hook that runs PHPStan and the test suite after every change and feeds the errors back to the agent. Without that sensor, you find the bug at review time. With it, the agent finds it itself within seconds.

What this changes when you choose or build an agent

When choosing an agent, don't just compare models, compare what surrounds them: how it handles context, which tools it has, which checks run automatically. And when you put an agent to work in your own project, the quickest improvement is often not a pricier model but a good sensor: a test or linter the agent runs itself after every step.

As of September 2026.

Share this article

Erik van de Blaak

Written by

Erik van de Blaak

AI Solutions Engineer & Full-Stack Developer

Erik van de Blaak is an AI Solutions Engineer and full-stack developer at CareerValue BV. Here he writes about AI coding tools and agents, such as Claude Code.

Comments (0)

Comment on this article

Never published

I read every comment before it goes online.

No comments on this article yet.

Read next