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

  1. Read the invoice lines from the PDFCompleted
  2. Look up the agreed contract price in the ERPCompleted
  3. Check unit-of-measure (box of 12 vs single unit)Needs Written team skill
  4. Verify line totals and tax in codeNeeds Code math check
  5. Cite the exact contract clause on any mismatchNeeds Code math check and Written team skill
  6. 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. 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?

  2. 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. 3 ObserveWere you right?

    Commit to a prediction first.

  4. 4 ExplainWhy does it come out this way?

  5. 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?

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.

  1. 1What is an agent harness?This lesson
  2. 2Why do AI agents forget mid-task?5 minutes
  3. 3Why do clear headings get your site cited by AI?5 minutes

Next, see what happens on step 25. Why do AI agents forget mid-task?

Next lesson