What is a harness?
A model on its own can only reply to one request. Everything else an agent appears to do is done by ordinary software wrapped around it. That software is called the harness.
The harness sends the request, reads the reply, runs whatever tool was asked for, adds the result to the record, and calls the model again. It also enforces the rules: which tools exist, what needs permission, when to stop.
Two products using the same model can behave very differently because their harnesses differ. Much of the engineering in an agent is here, not in the model.
Why does a harness matter?
A model alone can only turn text into text. Everything that makes an AI product useful and safe is in the program around it: what the model is shown, which tools it has, what it is allowed to do, when it must stop. That program is the harness. Two products using the same model can behave completely differently because their harnesses differ.
How does a harness work?
- It builds the prompt for each call from instructions, tools, notes and the conversation.
- It runs the loop: call the model, run the tool it asks for, add the result, repeat.
- It checks every action against permission rules before carrying it out.
- It keeps the conversation small enough to fit the model's window.
- It saves progress, records every step and enforces limits on rounds, time and cost.
When should you use a harness?
Use it when
- A model needs tools, memory or more than one step
- Actions must be controlled and recorded
- The same model has to serve a specific purpose reliably
Think twice when
- A single call with a fixed prompt does the whole job
- You would be rebuilding what an existing harness already provides
Where does a harness sit in a real system?
The harness is your own code, running on your server or the user's machine. It sits between the person, the model and every system the model can reach. Nothing passes between them except through it.
What goes wrong with a harness?
- Blaming the model for failures that are really the harness showing it the wrong things.
- Letting the model decide what it is permitted to do.
- Building a harness with no record of what it did.
What does a harness look like in practice?
Asked to remind club members who have not paid, a harness loads its notes, builds a prompt, runs the member lookup the model asks for, holds the twelve emails until a person approves, sends them, saves its state and writes a record. The model was called three times.