All patterns · 07 of 13 · Assurance
Agentic patterns: Repeatability test
The same invoice, the same agent, twenty runs. Count how many different outcomes come back.
One invoice, twenty runs. A haulier bills 5.2% above the order and says the surcharge was agreed by phone. The contract allows 5%. Nothing changes between the runs.
Demo: Twenty runs of the same invoice. Recorded on 26 November 2026 with Claude Opus 5.5: the model’s answers are real, replayed here. The supplier, the contract and the invoice are a small simulation.
What you just saw
What the repeatability test demo shows
The principle
What is a repeatability test?
A repeatability test is an assurance pattern in which the same case is given to the same agent many times under identical conditions, and the number of distinct outcomes is counted.
A language model samples its answer, so the same question can end differently on another day. For prose that is harmless. For a decision that moves money it means two customers in the same position can be treated differently, and nobody can say why. A single test run will not reveal this; it shows one draw.
A repeatability test is a simple measurement: same case, same instructions, same records, many runs, and a count of the distinct outcomes. In the demo an agent handles one borderline invoice twenty times. Sixteen times it asks the supplier and pays nothing. Four times it pays €8,000 and queries the rest, with the same reasoning in every run. A rule gives one answer twenty times. On a clear-cut invoice the agent also gives one answer twenty times, so the spread sits in the cases the policy leaves open.
Where it applies
- Acceptance testing of any agent that decides, before it goes live
- Finding which case types are safe for an agent and which need a rule or a person
- Evidence for a model risk or audit file that like cases are treated alike
- Comparing two prompts, two models or two designs on consistency as well as accuracy
Where it does not
- Creative or drafting work, where variety is welcome
- As a substitute for checking that the answer is right: twenty identical wrong answers pass this test
- Cases that never recur in a comparable form
Fill the boxes
One shape, three ways to build it
The pattern exists with or without AI. The design decision is which boxes deserve a model, and what that costs in money, speed and auditability. In the first run above, 40 steps were done: 20 by code, 20 by an agent.
A rule decides
Code applies the policy rule. Twenty runs give one outcome by construction, and the test costs nothing.
- Cost
- Free
- Speed
- Instant
- What the auditor gets
- One outcome, by construction
A model reads, a rule decides
A model extracts the facts and code applies the rule. The spread shrinks to whatever varies in the extraction.
- Cost
- One small model call per case
- Speed
- A second or two
- What the auditor gets
- The extracted facts and the rule
An agent decides shown above
The agent reads, looks up and decides. On the borderline invoice in the demo, 4 runs of 20 end differently from the other 16.
- Cost
- $0.50 for the twenty runs above
- Speed
- About five seconds per run
- What the auditor gets
- A count of outcomes: here 16 and 4
codemodelagentperson
What it costs
The price of each run, and of ten thousand
The test itself is cheap: twenty agent runs cost about fifty cents. The expensive finding is the one it prevents, an agent in production that treats the same case in two ways.
Measured from the runs recorded with Claude Opus 5.5 on 26 November 2026. Model calls only: people’s time and infrastructure come on top.
| Run | Model calls | Cost per run | Per 10,000 runs |
|---|---|---|---|
| “Agreed by phone”: the agent decides | 40 | $0.025 | $250 |
| The same invoice: a rule decides | 0 | $0 | $0 |
| A clear invoice: the agent decides | 40 | $0.022 | $223 |
In a regulated process
What the auditor gets
A supervisor expects like cases to be treated alike. This test puts a number on it: for this case type, twenty runs, this many outcomes. Kept per case type and repeated after every change of model or prompt, it is the evidence that the agent is consistent where it is used, and the reason it is not used where it is not.
Lineage
Where the shape comes from
Measurement science has always separated accuracy from repeatability: an instrument can be wrong the same way every time, or right on average and all over the place. Software testing mostly forgot the second, because code repeats itself perfectly. Sampled models bring it back, and model risk rules such as SR 11-7 already ask for ongoing monitoring of outcomes.
Also known as Consistency testing; test-retest reliability (measurement) · Ongoing monitoring and outcomes analysis (model risk management, SR 11-7)
Advice
Questions I ask before using it
- Which decisions must come out the same every time, by law or by policy?
- What counts as the same outcome: the action, the amount, the wording?
- How many runs, and on which cases? The clear ones tell you little.
- When the outcomes spread, do we tighten the policy, move the decision into code, or send it to a person?
Asked often
Repeatability test: short answers
What is a repeatability test?
A repeatability test is an assurance pattern in which the same case is given to the same agent many times under identical conditions, and the number of distinct outcomes is counted.
When should you use a repeatability test?
Typical uses: acceptance testing of any agent that decides, before it goes live; finding which case types are safe for an agent and which need a rule or a person; evidence for a model risk or audit file that like cases are treated alike. It is a poor fit for creative or drafting work, where variety is welcome.
Why does an AI agent give different answers to the same input?
A language model picks each word by sampling from a probability distribution. On a clear case one answer dominates. On a borderline case two answers are both likely, and different runs land on different sides.
How many runs does a repeatability test need?
Twenty is enough to see whether a case type spreads at all. A split of 16 to 4 will not go unnoticed. To put a tight figure on a rare flip you need hundreds.
What do you do when the outcomes differ?
Tighten the policy so the case is no longer open, move the decision into a rule and let the model only extract the facts, or route that case type to a person.
What does a repeatability test cost to run?
In the demo, model calls cost between $0.022 and $0.025 per run, which is $223 to $250 per 10,000 runs. The test itself is cheap: twenty agent runs cost about fifty cents. The expensive finding is the one it prevents, an agent in production that treats the same case in two ways. Measured from the runs recorded with Claude Opus 5.5 on 26 November 2026.
The demo in detail
The run in words ““Agreed by phone”: the agent decides”, step by step
A haulier invoices 5.2% above the order and writes that the surcharge was agreed by phone. The contract allows 5%. An agent with access to the records handles this one invoice twenty times. Then a rule handles it twenty times, and the agent gets a clear-cut invoice twenty times.
- Run 1: the agent pays nothing and asks the supplier. 5.2% surcharge cites no agreement clause and exceeds clause 7.2's 5% cap.
- Run 2: the agent pays €8,000 now and queries the rest. Pay PO value; query 5.2% surcharge: no clause cited, exceeds 5% cap.
- Run 3: the agent pays nothing and asks the supplier. 5.2% surcharge cites no agreement clause; exceeds clause 7.2 5% cap.
- Run 4: the agent pays nothing and asks the supplier. 5.2% surcharge cites phone agreement, not clause 7.2; exceeds 5% cap.
- Run 5: the agent pays €8,000 now and queries the rest. Surcharge cites phone deal, not clause 7.2; exceeds 5% cap. Query surcharge.
- Run 6: the agent pays nothing and asks the supplier. 5.2% surcharge cites phone agreement, not clause 7.2; exceeds 5% cap.
- Run 7: the agent pays nothing and asks the supplier. 5.2% surcharge cites phone agreement, not clause 7.2; exceeds 5% cap.
- Run 8: the agent pays nothing and asks the supplier. 5.2% surcharge cites phone deal, not clause 7.2; exceeds 5% cap.
- Run 9: the agent pays nothing and asks the supplier. 5.2% surcharge cites phone agreement, not clause 7.2; exceeds 5% cap.
- Run 10: the agent pays nothing and asks the supplier. 5.2% surcharge cites phone deal, not clause 7.2; exceeds 5% cap.
- Run 11: the agent pays nothing and asks the supplier. 5.2% surcharge not based on agreement clause; exceeds 5% cap anyway.
- Run 12: the agent pays nothing and asks the supplier. 5.2% surcharge cites phone agreement, not a contract clause; clause 7.2 caps at 5%.
- …
- 20 runs, 2 different outcomes: 16 times ask the supplier, 4 times pay part (€8,000).
- Same invoice, same records, same instructions. Sixteen times nothing is paid, four times €8,000 goes out. The reasoning reads the same in every run.
Building it This demo runs on plain Python and the Claude API: when I would pick it, and when not
This demo uses no agent framework: the same request goes to the Claude API twenty times, and plain Python counts the outcomes. Other frameworks can carry the same pattern; this is when I would pick this one.
Reach for it when
- The process is yours and you want to read every line that touches money
- A decision table, a loop and a few API calls cover the job
- You need the recording and the control points more than a framework’s features
Skip it when
- Runs must survive a crash or wait days for a person: take a durable workflow engine
- Several teams build agents and need one shared way of working
- You would end up rebuilding checkpoints, retries and tracing by hand
In the framework’s own terms. Nothing changes between the runs: same prompt, same tools, same records. The harness groups the answers by action and amount, so two differently worded reasons that lead to the same payment count as one outcome.
- Framework
- Plain Python and the Claude API (anthropic SDK 2.10)
- Licence
- MIT
- Model
- claude-opus-5-5
- Watch time
- ~2 min
Contact
Questions, ideas or a conversation?
I’m always glad to hear from people working on AI, product strategy, transformation or software.