FREE RESOURCE · FROM THE "HARNESS" REEL
Harness engineering: the six layers that make an AI agent reliable, with a checklist for each
By Hammad Yousuf · 1 November 2026
The model suggests actions; the harness decides how, and whether, they run.
In four lines
- The model suggests actions; the harness decides how, and whether, they run.
- Check permissions in the system before any action runs, and give tools the least access they need.
- Verify the real result (tests, records, payments) instead of trusting the model's reply.
- Trace every tool call, error and retry, and feed what you learn back in.
The layers around the model
Agent failing? Don't blame the model yet. Walk the layers in the order a request passes through them. The first six are the ones the audit prompt names; Trusted Result and Rules & Limits are the two frames around them on the diagram.
Layer 01
Context Builder
give the model the right docs, data, history and task state before it starts.
Without it
The model guesses. It cannot see your calendar, your database or the last step unless the harness hands them over, so a missing fact becomes a confident wrong answer.
Checklist
- The model sees the task state, not just the latest message
- The docs and data it needs are in the context, not assumed
- Earlier tool results are fed back in, in order
- Nothing sensitive is in the context that the task does not need
Layer 02
Model
it reads the goal and suggests the next step; it can be wrong.
Without it
Nothing runs. But treating the model as the whole system is the mistake: it suggests, it does not decide, and it will mark work done that it has not tested.
Checklist
- The model's output is treated as a suggestion, not a result
- Every suggested action goes through the layers below before it runs
- A model change is measured against fixed test cases, not vibes
Layer 03
Permission Check
every suggested action is allowed, blocked or sent to a human.
Without it
The model's text becomes an action with no gate in between. A wrong file path, a wrong recipient or a wrong amount runs exactly as written.
Checklist
- Permissions live in the system, not in the prompt
- Each action is one of: allowed, blocked, needs a human
- Sends, payments, deletes and signatures always stop for sign-off
- A blocked action is logged with the reason
Layer 04
Tools & Runtime
tools run with only the access the task needs.
Without it
A tool that can reach everything turns one bad call into a wide blast radius. Least access keeps a mistake inside the task that made it.
Checklist
- Each tool has the least access the task needs (one folder, one account, read-only where possible)
- Tools time out and fail loudly instead of hanging
- A step cap stops a failing call from repeating
Layer 05
Verification
check the real result (tests, records, payments) before calling it done.
Without it
The agent reports success because the model said so. Anthropic's own harness work found agents tend to mark features complete without proper testing unless the harness forces an end-to-end test first.
Checklist
- Done means a check passed, not a reply that said done
- The check reads the real thing: the test run, the record, the payment status
- One feature or task at a time, verified before the next starts
- Progress is written to a file or history the next run can read
Layer 06
Trusted Result
only results that pass the checks leave the harness.
Without it
Unchecked output reaches users, customers or the next agent and the error travels further than the harness can see.
Checklist
- Results carry what was checked and when
- A failed check never leaves as a result; it leaves as a flag
- The next system in line can tell a verified result from a draft
Layer 07
Observability
log tool calls, errors and retries, and feed the lessons back.
Without it
You cannot debug what you cannot see. A retry loop that costs money, or a tool that fails one time in ten, stays invisible until the bill or the complaint arrives.
Checklist
- Every tool call, error and retry is traced with its inputs and outputs
- Retries are counted and capped
- A failure becomes a new test case or a new rule, not just a log line
Layer 08
Rules & Limits
the rules live in the system, not in the model.
Without it
A rule written only in the prompt can be forgotten, overridden or talked around. A rule enforced by the harness holds whatever the model writes.
Checklist
- Guardrails are code, not instructions
- Stopping conditions are set: steps, time, spend
- Human checkpoints exist for the risky actions
Audit your agent's harness
Replace the bracketed part with a plain description of your agent and paste it into Claude or any assistant.
Audit your agent's harness
Here is how my AI agent works: [describe the agent, its tools and what it does]. Audit its harness against six layers: context builder, model, permission check, tools and runtime, verification, observability and feedback. For each layer: what I have today, the biggest risk if it fails, and one concrete fix I can ship this week. Finish with the three fixes that would most improve reliability, in order.Common questions
What is harness engineering?
Designing the layer of code around an AI model that feeds it context, runs its tools, checks permissions, verifies results and logs everything. The model suggests actions; the harness decides how, and whether, they run.
Why not just use a better model?
A better model still only suggests the next step and can still be wrong. Reliability comes from the system around it: permissions checked before any action, results verified against the real thing, and traces that show what happened.
What does verification mean for an agent?
Checking the real result before calling the task done: run the tests, read the record, confirm the payment status. Anthropic's harness for long-running agents has agents test features end-to-end and mark them done only after testing, because they otherwise tend to mark work complete without proper testing.
Where does MCP fit in the harness?
In the Tools & Runtime layer. MCP servers expose tools, resources and prompts to AI applications, so the harness can give the model a standard set of tools while still deciding which calls are allowed and with what access.
How do I use the audit prompt?
Replace the bracketed part with a plain description of your agent, its tools and what it does, then paste it into Claude or any assistant. It returns what you have today, the biggest risk and one fix per layer, then the three fixes to ship first.
Where this comes from
- Anthropic: Effective harnesses for long-running agentswww.anthropic.com/engineering/effective-harnesses-for-long-running-agents ↗
- Anthropic: Building effective agentswww.anthropic.com/engineering/building-effective-agents ↗
- Model Context Protocol (MCP)modelcontextprotocol.io/specification/2025-06-18/server ↗
Sources checked
- Anthropic's harness for long-running agents has agents test features end-to-end and mark them done only after testing, because agents otherwise tend to mark features complete without proper testing; it tracks progress in a file plus git history and works one feature at a time. Source ↗
- Agents are LLMs using tools in a loop based on environmental feedback; they need guardrails, stopping conditions and human checkpoints. Source ↗
- MCP servers expose tools, resources and prompts to AI applications. Source ↗
About the video: the reel has no presenter; it is an animated diagram. The small headshot in it is an AI-generated image of Hammad Yousuf.