en:twine
DEFINITION • AI & automation

What is a harness in AI agents?

A harness is the software around a language model that provides tools, supplies context, keeps track of what happened and limits execution. The model comes up with the next step; the harness determines what that step can be in practice and what actually happens afterwards.

A language model predicts text. It cannot send an email, write an order or open a page. Everything an AI agent does in practice happens because the layer around it makes it available and carries it out. That layer is called the harness. The word comes from engineering practice and is also used untranslated in Dutch, but the image fits: a harness that surrounds something, determines its freedom of movement and that you fit yourself.

What a harness does

A harness does four things:

  • It provides tools: searching, reading, writing or updating a system. A tool is not just a function, but also an agreement about what it is intended for, when it should not be used and what the response means. A large part of an agent’s behaviour lies in that description rather than in the model.
  • It prepares context: which information is provided at each step? That is selection, not storage. Sending too much information makes an agent more expensive and can make its answers less reliable.
  • It keeps track of what happened: the model cannot see whether an action succeeded and only sees what the harness returns. That record is called state and is a common cause of problems in production.
  • It limits execution: how often may the agent retry, when does it stop, what must never happen without approval and who may do what? That should be enforced in the software rather than requested in the prompt, with human approval for irreversible actions.

Why this distinction matters

Two businesses can use the same model and get completely different results. The difference is almost never in the model and almost always in the layer around it: which tools are available, which information is provided and what happens when a step only partly succeeds. That is also the practical reason to own that layer yourself. If you own the harness, you can choose the model for each task, switch providers or move to an open source model without rebuilding the agent. If you do not control the layer, the model becomes a dependency rather than a component.

What this looks like in practice

We have published one ourselves. The Minimal Coding Harness is on GitHub under the MIT licence and has deliberately been kept small. It limits how much information goes to the model, checks locally whether the delivered work is correct and tracks usage separately. That keeps the agent faster, cheaper and easier to check. It is a harness for code. For an agent in your own processes, the contents look different, but the four parts above stay the same. With a CRM agent, for example, the model writes a follow-up while the harness retrieves the right customer data, requests approval, sends the email and records in the CRM what actually happened.

If you want to know what that means when you want to build something yourself, read the guide to building your own AI agent. If you first want to know which process is suitable, start with the AI Readiness Scan.

FREQUENTLY ASKED QUESTIONS

What is the difference between a model and a harness?

The model predicts text and determines what the next step should be. The harness is the software around it that makes that step possible: the tools, the information provided, the record of what has been carried out and the boundaries within which it may happen.

Why is it called a harness rather than just software?

Harness is the working term in the engineering documentation of Anthropic and LangChain, among others, and is also used untranslated in Dutch. We use the word as it is used there: the harness, the layer around the model.

Does ChatGPT have a harness too?

Yes. Web search, reading files and executing code, for example, are not in the model but in the layer around it. That harness is well tested, but it is built for all users at once and does not know your systems, rules or approval points.

What does a harness need at a minimum?

Tools with a clear description and defined permissions, a deliberate choice of which context is provided at each step, a record of what has actually been carried out, and human approval for actions that cannot be undone.

A note on how this was made: our content is AI-assisted. We use AI for research and drafting a first concept. A human reviews and edits the text and takes responsibility for everything we publish. Read how we make our content.

NEXT STEPGET STARTED

Wondering what this means for your business?

The AI Readiness Scan takes 10 minutes and shows which processes to tackle first, with an indication of ROI per use case.