Learn · How agents work
What is an agent harness?
A model by itself only writes text. The harness around it gives it tools, checks its math in code, and tells it your team’s rules. Add each piece and watch an invoice audit go from guessing to catching a $1,420 overbill.
Free lesson, about five minutes. Updated
Parts of the harness around the model
- File and ledger tools
- Code math check
- Written team skill
Six steps in a supplier invoice audit
- Read the invoice lines from the PDFCompleted
- Look up the agreed contract price in the ERPCompleted
- Check unit-of-measure (box of 12 vs single unit)Needs Written team skill
- Verify line totals and tax in codeNeeds Code math check
- Cite the exact contract clause on any mismatchNeeds Code math check and Written team skill
- Draft the dispute note and hold for approvalCompleted
- Steps passed
- 3 of 6of the audit
- Harness parts
- 1 of 3enabled now
- Model
- Standardinside the harness
- Result
- Missed box-vs-case erroron this invoice
-
1 PredictWhat fixes the missed pricing error?
An AI agent is checking a supplier invoice against your signed contract. It can read the PDF and the ERP, so it passes 3 of the 6 audit steps, yet it misses that the supplier billed per unit instead of per box of 12 and skips verifying the line math. What fixes the remaining 3 steps?
Pick one first. A guess that turns out wrong teaches the most.
Locked in. Now test it.
-
2 TryUpgrade the model, then add the harness parts
First try turning on the model Twice as large. Then turn on Code math check and Written team skill.
Model size
Harness parts
- Steps passed
- 3 of 6
- Result
- Missed box-vs-case error
-
3 ObserveWere you right?
Commit to a prediction first.
-
4 ExplainWhy does it come out this way?
A model is the engine; the harness is the steering, brakes and checklist around it. Without tools, a model cannot read the invoice or the contract. Without a code check, it guesses at arithmetic instead of computing it. Without a written skill from the people who do the job, it does not know that Supplier A quotes per box of 12 while billing per unit.
When an agent fails in production, swapping in a bigger model rarely fixes the miss. Adding the missing check or domain rule to the harness fixes it permanently for every run that follows.
-
5 ApplyA new case
Your engineering team uses an AI coding agent to update client websites. Once a week, the agent edits a layout that looks fine in the code diff and breaks on narrow phone screens. What do you add to the harness?
Even the largest model cannot see rendered pixels from raw CSS text alone. It will still guess at how a headline wraps on a 320-pixel phone screen.
Right. When the harness opens the page in a real browser at phone and desk widths and fails the step whenever a heading overflows or wraps onto three lines, the agent sees the exact fault and fixes it before a person ever reviews the pull request.
A prompt warning changes nothing when the model has no way to see the rendered page. Give the harness a test that measures the page instead.
How the harness model works
- A bare model with no tools can only draft text from its training data, passing 1 of the 6 audit steps (writing a draft email with guessed figures).
- File and ledger tools let the model read the PDF invoice and query the ERP contract table, unlocking steps 1 and 2.
- A code math check runs deterministic arithmetic on every line item and tax total outside the model, unlocking step 4.
- A written team skill records how your accounts payable staff check unit-of-measure conversions and contract clauses, unlocking steps 3 and 5.
- Read how we build self-improving harnesses in our research papers on A harness that learns how good engineers work and Inside Harness².
How agents work
Three lessons on what sits around a model, why agents lose track of long tasks, and how AI search engines score your pages.
- 1What is an agent harness?This lesson
- 2Why do AI agents forget mid-task?5 minutes
- 3Why do clear headings get your site cited by AI?5 minutes