The short version
- The harness is the software that runs the agent loop and controls what the model can see and do.
- It holds the tools, the permissions, the memory, the budgets and the record of every step.
- The same model with a better harness gives a better agent. This is where your engineering effort should go.
The idea
An agent is a model plus a harness. The model reasons. The harness does everything else:
- Runs the loop. It calls the model, runs the tools and feeds the results back.
- Manages context. It decides what is in the window at each step and compacts it as it grows.
- Provides tools and checks every tool request before running it.
- Enforces permissions. It decides what is allowed, what needs approval and what is forbidden.
- Sets budgets. It limits steps, time and cost.
- Keeps memory between steps and sessions.
- Records everything, so each run can be reviewed.
A racing driver is only as good as the car, the pit crew and the track rules. The harness is the car and the crew: steering, brakes, fuel limits and the radio that says “come in now”. A great driver in a car with no brakes is a danger.
- Model: reasoning
- Harness: loop, context, tools, permissions, budgets, memory, logs
- Your systems
The central trade is autonomy against control. More freedom lets the agent solve more, and lets it do more damage. The harness is where you set that dial, task by task. An agent may be free to read and search, required to ask before it writes, and blocked from deleting.
An example
Two teams build a service agent on the same model. Team A gives the model tools and a prompt. It works in demos and then fails in production: it loops on errors, fills its context and sometimes issues credits it should not. Team B builds a harness with a step limit, summarized context after ten steps, an approval gate on credits above a set amount, and full traces. Team B’s agent solves fewer flashy cases and is the one that stays in production.
Common mistakes
- Putting rules in the prompt that should be enforced in code. A prompt is a request. A permission check is a guarantee.
- No budget, so one bad run can cost hundreds of dollars.
- Building a custom harness when a proven one would do.
- No record of what the agent did and why.
What to do this week
- List the controls your agent’s harness enforces in code, and those that exist only in the prompt.
- Move the critical ones, such as money, data deletion and external messages, into code.
- Confirm that every run is recorded from start to finish.
The terms, in plain language
| Term | What it means |
|---|---|
| Harness | The software around the model that runs and controls the agent |
| Permission gate | A check that allows, blocks or asks for approval |
| Budget | A limit on steps, time or cost |
| Trace | The full record of one agent run |
Further reading
Section 6.4 of the AI Engineering Guide · Last reviewed November 2026




