All patterns · 05 of 13 · Structure
Agentic patterns: Exception lane
Rules settle most of the invoices. Only what no rule covers goes to a model, and you can watch what the alternative costs.
Twenty-four invoices. Most match their order, their goods receipt and their bank account. A few carry a remark, a typing error or a credit note. Watch the same batch handled three ways.
Demo: Twenty-four invoices, three ways. Recorded on 26 November 2026 with Claude Opus 5.5 and Claude Haiku 5.5: the model’s answers are real, replayed here. The suppliers, orders and invoices are a small simulation.
What you just saw
What the exception lane demo shows
The principle
What is an exception lane?
An exception lane is an agentic pattern in which a decision table settles every case it has a rule for and passes only the remaining cases to a model, with a person as the last resort.
Most of a business process is routine, and routine has rules. A decision table applies them in microseconds, gives the same answer every time and can name the row that decided. What it cannot do is read: a remark in free text, a mistyped reference or a credit note mentioned in passing falls outside every row.
The exception lane keeps both strengths. Rules go first and settle what they can. The remainder, usually a small share, goes to a model that reads the case against the same policy and returns a typed decision. In the demo all three designs reach the same 24 decisions. They differ in price by a factor of almost a hundred, and in what each can show an auditor.
Where it applies
- Invoice matching, claims intake, payment screening: high volumes where most cases are plain
- Processes that already have a rule engine and a manual queue for whatever it rejects
- Cases where the unusual part sits in free text: remarks, emails, attachments
- Any process where you must be able to say which rule decided
Where it does not
- Work with no stable rules, where every case needs reading
- Volumes so low that a person handling the exceptions is cheaper than building the lane
- Exceptions that call for authority, such as a waiver: a model can explain one and has no power to grant it
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, 54 steps were done: 47 by code, 6 by a model, 1 by a person.
All code
A decision table settles what it can and queues everything else for people. Nothing is guessed, and the queue grows with every unusual case.
- Cost
- Free
- Speed
- Instant
- What the auditor gets
- The rule that decided, by number
Hybrid shown above
Rules take the plain cases, a model reads the remainder against the same policy, and a person gets what the model will not decide.
- Cost
- $0.04 of model calls in the run above
- Speed
- Instant for 18, seconds for 6
- What the auditor gets
- A rule for most cases, a written reason and a policy rule for the rest
All agents
An agent with tools handles every case. In the demo it reaches the same answers, with 49 model calls where the hybrid needs 6.
- Cost
- $0.49 for the same 24 invoices
- Speed
- 92 seconds of model time
- What the auditor gets
- A transcript per invoice
codemodelagentperson
What it costs
The price of each run, and of ten thousand
All three designs decide the 24 invoices correctly. What separates them is the bill, the waiting time and the kind of proof each leaves behind. The small model is the cheapest of all; the rules are what make most decisions instant and provable.
Measured from the runs recorded with Claude Haiku 5.5 and Claude Opus 5.5 on 26 November 2026. Model calls only: people’s time and infrastructure come on top.
| Run | Model calls | Cost per invoice | Per 10,000 invoices |
|---|---|---|---|
| Rules first, a model for the rest | 6 | $0.0015 | $15.17 |
| A small model reads everything | 24 | $0.0002 | $2.12 |
| An agent handles everything | 49 | $0.020 | $202 |
In a regulated process
What the auditor gets
For three quarters of the invoices the evidence is one line: this rule, these values. For the rest the model returns its decision with the policy rule it applied and a reason, and both are stored. An auditor can sample the exception lane and can see its size over time. A lane that keeps growing means the rules are out of date.
Lineage
Where the shape comes from
Banks have run straight-through processing with an exception queue for decades: the routine goes through untouched and people handle what falls out. Enterprise Integration Patterns calls the split a Content-Based Router. The new part is who works the queue. A model can now read most of what used to wait for a person.
Also known as Routing (Anthropic) · Content-Based Router (Enterprise Integration Patterns) · Straight-through processing with an exception queue (banking operations) · Decision table (software engineering)
Advice
Questions I ask before using it
- What share of cases do the rules settle today, and what is in the remainder?
- When the model decides an exception, which policy rule does it cite, and do we store that?
- Which exceptions go to a person whatever the model says?
- Who turns a frequent exception into a new rule, and how often?
Asked often
Exception lane: short answers
What is an exception lane?
An exception lane is an agentic pattern in which a decision table settles every case it has a rule for and passes only the remaining cases to a model, with a person as the last resort.
When should you use an exception lane?
Typical uses: invoice matching, claims intake, payment screening: high volumes where most cases are plain; processes that already have a rule engine and a manual queue for whatever it rejects; cases where the unusual part sits in free text: remarks, emails, attachments. It is a poor fit for work with no stable rules, where every case needs reading.
Does an exception lane need an AI agent?
No. In the demo the exception step is a single model call with the policy and the records in the prompt. An agent with tools reached the same decisions at thirteen times the cost.
Is a small model enough for the exceptions?
Often. In the demo Claude Haiku 5.5 decided all 24 invoices correctly for half a cent. The case for rules is speed, repeatability and proof, more than price.
How do you decide what becomes a rule?
Watch the exception lane. When the same kind of case keeps arriving and the model keeps deciding it the same way, write the rule and take the case out of the lane.
What does an exception lane cost to run?
In the demo, model calls cost between $0.0002 and $0.020 per invoice, which is $2.12 to $202 per 10,000 invoices. All three designs decide the 24 invoices correctly. What separates them is the bill, the waiting time and the kind of proof each leaves behind. The small model is the cheapest of all; the rules are what make most decisions instant and provable. Measured from the runs recorded with Claude Haiku 5.5 and Claude Opus 5.5 on 26 November 2026.
The demo in detail
The run in words “Rules first, a model for the rest”, step by step
A Dutch wholesaler receives 24 supplier invoices. Most match their purchase order, goods receipt and bank account. A few carry a surcharge note, a mistyped order number or a credit note. The same batch is handled three ways: rules first with a model for the remainder, a small model for every invoice, and an agent with tools for every invoice.
- INV-01, Noordzee Logistics, €4,200: order, receipt and bank account match. A rule settles it: pay.
- INV-02, Lumen Office Supplies, €318.40: order, receipt and bank account match. A rule settles it: pay.
- INV-03, Brouwer Packaging, €2,760: order, receipt and bank account match. A rule settles it: pay.
- INV-04, Van Dijk Transport, €12,480: there is a note in free text, so no rule fits. It goes to the model.
- Claude reads INV-04 from Van Dijk Transport. 4% above PO, covered by fuel surcharge clause 7.2 cap of 5%. Decision: pay.
- INV-05, Polder IT Services, €9,800: order, receipt and bank account match. A rule settles it: pay.
- BP-2207, Brouwer Packaging, €3,150: it was paid before. A rule settles it: hold.
- INV-07, Hanze Cleaning, €1,450: order, receipt and bank account match. A rule settles it: pay.
- INV-08, Kade Staalhandel, €6,000: there is a note in free text, so no rule fits. It goes to the model.
- Claude reads INV-08 from Kade Staalhandel. Open credit note CN-88 of V05; 6400 minus 400 equals 6000; all else matches. Decision: pay.
- INV-09, Delta Print, €890: order, receipt and bank account match. A rule settles it: pay.
- INV-10, Noordzee Logistics, €5,100: order, receipt and bank account match. A rule settles it: pay.
- …
- INV-24, Brouwer Packaging, €1,890: order, receipt and bank account match. A rule settles it: pay.
- Done. Rules settled 18 invoices and the model read 6. All 24 match the policy, for under four cents.
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: a decision table in plain Python settles what it can, and the Claude API reads the rest. 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. A decision table returns either a decision or None. None is the exception lane: only those invoices are sent to a model, with the policy and the records in the prompt and a typed decision as the answer.
- Framework
- Plain Python and the Claude API (anthropic SDK 2.10)
- Licence
- MIT
- Model
- claude-opus-5-5, claude-haiku-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.