Harness

What an AI agent harness is, and how you might design one.

Working definition

A model takes text in and puts text out. A harness is everything around it that turns that into an agent: the loop that calls the model again and again, the tools it can use, the choice of what goes into its context, and the rules for what it may do without asking.

Two harnesses running the same model can behave very differently. Much of what people call "the model" in a coding agent actually comes from the harness.

Parts

This is a first guess at the parts, to be refined:

Loop
Call the model, run any tools it asks for, send back the results, and repeat until it stops. This also covers when to stop and what happens when something fails.
Tools
What the model can do (read files, run commands, search), and how each tool is described to it.
Context
What the model sees on each turn: the system prompt, instructions files, history, tool output. It also covers what gets summarized or dropped as the context window fills up.
Permissions
Which actions run automatically, which need a person's approval, and which are never allowed. Sandboxing belongs here too.
Memory
Anything that lasts beyond one session.
Delegation
Subagents, parallel work, and how their results come back.
Interface
Where a person watches, steers, and interrupts: a terminal, an IDE, a chat window, or nothing at all.

Pages

Open questions