Agent Harness
Also called Harness, AI harness, LLM harness, Agent scaffolding
Everything around an AI model that turns it into a working agent: its instructions, tools, context handling, memory, sandbox, checks and permissions.
What is an agent harness?
An agent harness is the software wrapped around an AI model that lets it work as an AI agent. The model reads and writes text; the harness does everything else. It gives the model its instructions, runs the tools it asks for, decides what goes into its context window, keeps track of progress between sessions, and stops it from doing things it shouldn't.
A common shorthand is agent = model + harness. Coding agents such as Claude Code and Codex are examples: the same model can behave very differently depending on the harness it runs in.
What does a harness include?
- Instructions: the system prompt and project files the agent reads at the start, such as an
AGENTS.mdfile. - Tools: the actions the agent can take, like running commands, editing files, searching or browsing, often through the Model Context Protocol.
- Context management: trimming, summarising or moving large outputs out of the context window so the agent doesn't lose track.
- State and memory: progress notes, task lists and version history that carry work from one session to the next.
- A sandbox: an isolated place where the agent's commands run safely.
- Feedback: tests, linters and other checks that tell the agent when it got something wrong.
- Guardrails and approvals: permissions, blocked actions and points where a person signs off (human in the loop).
What is it commonly confused with?
- Harness, the company. Harness is also the name of a software delivery (CI/CD) platform. "Agent harness" has nothing to do with it.
- The model itself. Swapping in a better model doesn't fix a weak harness, and a good harness can make an average model far more reliable.
- An agent framework. A framework is a library for building agents; a harness is the specific setup one agent runs in. Frameworks are often used to build harnesses.
- Agent orchestration. Orchestration coordinates several agents; a harness is what surrounds each one.
Why does it matter?
Most failures of AI agents in real work come from the harness, not the model: missing context, no way to check results, or nothing that carries progress forward. Improving the harness by observing failures and fixing what caused them is now called harness engineering. Read more in What is harness engineering?.


