What is an agent harness, and what is harness engineering?
Agents and tools · Pro 2
Short answer
An agent is a model plus a harness. The harness is everything around the model: the loop and its stop rules, the tools and their descriptions, how context is managed, state kept on disk, checks such as tests, permissions and budgets. Harness engineering is designing, testing and measuring those parts so the agent works reliably.
Deeper answer
The model only predicts the next message. The harness decides what the model sees, which actions it can take, when its work is checked and when it must stop. Two products on the same model can behave very differently because their harnesses differ.
The main parts are: the agent loop and stop conditions; a small set of well-described tools; context management, such as compaction, resets and fetching files only when needed; memory on disk, such as a progress file, a todo list and git history; verification, such as tests, linters, type checks or a separate evaluator agent; permissions, a sandbox and hooks; sub-agents; and time and cost budgets.
The term follows prompt engineering and context engineering. Prompt engineering shapes one request. Context engineering shapes what goes into the window. Harness engineering covers the whole system that runs the model over many steps. You treat a harness change like any code change: run the same model on the same task set before and after, and compare.
What a strong answer covers
- Agent equals model plus harness; the harness is everything around the model
- Names the loop, stop rules and tools
- Names context management and state on disk
- Names verification, permissions and budgets
- Measures harness changes on a fixed task set with the same model
Answer it out loud in the mock interview about 1.5 min
Follow-ups to expect
- How is harness engineering different from context engineering?
- Which harness part would you add first to a new coding agent, and why?
- How would you know a harness change actually helped?
Common mistakes
- Treating the harness as just the system prompt
- Blaming or switching the model before looking at the harness
- Listing parts without saying how you would measure a change
Learn it
- What are common failure modes of agents, and how do you guard against them?
- What kinds of memory can an agent have, and how do you implement them?
- Your agent ran overnight and ran up a large API bill. What probably happened, and what do you change?
- How would you design a harness for an agent that has to work on one task for several hours?
- What is the difference between an agent and a workflow?
- What are computer-use or browser agents good for, and what are their risks?
- What is context engineering, and why does it matter for agents?
- An agent completes a task correctly most of the time but sometimes goes badly wrong. How do you debug it?
- What makes a good tool for an agent?
- Design an agent that handles refund requests for an online store.
- You changed your agent's harness. How do you prove the change made it better?
- What are verification gates in an agent harness, and how would you add them to a coding agent?
- How does tool calling work?
- When should an AI agent ask a human for approval before acting?
- Explain state, nodes, edges and checkpoints in LangGraph.
- What are planning and reflection in agents, and when do they help?
- Two coding agents use the same model, but one solves far more of your tasks. Why could that be, and how would you find out?
- What is the Model Context Protocol, and why does it matter?
- When is a multi-agent system worth it, and what are the risks?