All patterns · 12 of 13 · Structure

Agentic patterns: Agent at design time

The agent writes the decision table, tests prove it and a person signs it. Then plain code decides the invoices, with no model in the loop.

A policy of nine rules. An agent turns it into a decision table, has to pass 24 test cases, and needs a signature before anything runs.

Demo: The agent writes the rules. Recorded on 26 November 2026 with Claude Opus 5.5: the model’s answers are real, replayed here. The policy, the test invoices and the records are a small simulation.

What you just saw

What the agent at design time demo shows

The principle

What is an agent at design time?

An agent at design time is an agent that writes or maintains the rules, workflow or code of a process, which are then tested, approved by a person and executed without a model.

There are two places to put an agent. At run time it handles each case as it comes, and every case costs a model call and carries a chance of a different answer. At design time it reads the policy once and produces the thing that will handle the cases: a decision table, a workflow definition, a piece of code. That output can be tested, reviewed by a person, versioned and rolled back.

In the demo an agent turns a nine-rule policy into a decision table, runs it against 24 test invoices, repairs the one that fails and hands it in. Code re-runs the tests, a person approves, and the engine then decides the invoices with no model in the loop. Writing the table cost ten cents. When the policy changes, the agent proposes an edit, and the change goes through the same tests and the same signature.

Where it applies

  • Policies and procedures that exist as text and have to become executable rules
  • High volumes where a per-case model call costs too much or varies too much
  • Regulated decisions that must be explained by pointing at an approved rule
  • Keeping rules up to date when the policy changes

Where it does not

  • Cases that need reading or judgement each time: those belong in an exception lane
  • Rules nobody can test because no examples with known outcomes exist
  • Teams with no review step: an untested table written by an agent is still untested

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, 29 steps were done: 27 by code, 1 by an agent, 1 by a person.

All by hand

An analyst reads the policy and writes the table. This is how it has always been done, and it takes weeks where the agent takes minutes.

Cost
An analyst’s time
Speed
Days to weeks
What the auditor gets
A table and the analyst who wrote it

Hybrid shown above

An agent writes the table, tests prove it, a person approves it and code runs it.

Cost
$0.10 of model calls in the run above
Speed
Minutes to write, microseconds to run
What the auditor gets
The table, the tests it passed, and who approved it

Agent at run time

The agent reads the policy for every case and decides. No table to maintain, a model call for every case, and no approved rule to point at.

Cost
A model call for every case
Speed
Seconds per case
What the auditor gets
A transcript per case

codemodelagentperson

What it costs

The price of each run

The cost is paid once. Writing the table cost ten cents and changing it cost ten more. After that, deciding an invoice costs no model call at all, whether there are 24 of them or ten million.

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.

RunModel callsModel cost
Write the rules from the policy4$0.10
The policy changes3$0.096

In a regulated process

What the auditor gets

Everything an auditor asks of a rule engine is here: the table, its version, the test cases with expected and actual results, and the person who approved it. The agent’s part is visible too, as the author of a change that went through the normal change process. No decision on any invoice was made by a model, so there is no model decision to explain.

Lineage

Where the shape comes from

Decision tables go back to the 1960s and have an OMG standard, DMN, that business analysts can read. Compilers, code generators and rule-mining tools have long produced executable logic from descriptions. The new part is the author. An agent can read a policy written for people and produce the table, and the old disciplines of testing and sign-off make its output safe to run.

Also known as Workflows, as opposed to agents (Anthropic) · Decision Model and Notation (Object Management Group) · Decision table (software engineering) · Factor 8: own your control flow (12-factor agents)

Advice

Questions I ask before using it

  • Where do the test cases come from, and who vouches for their expected outcomes?
  • Who approves the table, and can they read it?
  • What does the table refuse to decide, and where do those cases go?
  • When the policy changes, how small is the diff, and is it tested before it is live?

Asked often

Agent at design time: short answers

What is an agent at design time?

An agent at design time is an agent that writes or maintains the rules, workflow or code of a process, which are then tested, approved by a person and executed without a model.

When should you use an agent at design time?

Typical uses: policies and procedures that exist as text and have to become executable rules; high volumes where a per-case model call costs too much or varies too much; regulated decisions that must be explained by pointing at an approved rule. It is a poor fit for cases that need reading or judgement each time: those belong in an exception lane.

What is the difference between an agent at design time and at run time?

At run time the agent handles each case and is called for every one. At design time it produces the rules or code that handle the cases, once, and that output is tested and approved before it runs.

Why not let the agent decide every case?

Cost and consistency. A table costs nothing per case and gives the same answer every time. An agent per case costs a model call each time and can vary on the borderline ones.

What if the agent writes a wrong rule?

The tests catch what the test cases cover, and the reviewer catches what they can read. That is the same protection a rule written by a person gets, which is why the tests and the review matter more than the author.

What does an agent at design time cost to run?

In the demo, the model calls of a run cost between $0.096 and $0.10. The cost is paid once. Writing the table cost ten cents and changing it cost ten more. After that, deciding an invoice costs no model call at all, whether there are 24 of them or ten million. Measured from the runs recorded with Claude Opus 5.5 on 26 November 2026.

The demo in detail

The run in words “Write the rules from the policy”, step by step

The accounts payable policy has nine rules. An agent reads it and writes the decision table for the rule engine, runs it against 24 test invoices, and repairs what fails. A person approves the table, and the engine then decides the invoices without any model call. In the second run the policy changes and the agent proposes the smallest edit.

  1. The agent reads the policy and the facts the engine can compute, and writes a decision table.
  2. Attempt 1: 1 of 24 test cases fail.
  3. The agent repairs the table. It now has 8 rows and passes all 24 tests. Writing it cost $0.10.
  4. Code runs the 24 tests again itself. The agent’s word is not taken for it.
  5. The table waits for a person. Nothing is deployed until the process owner signs.
  6. The process owner approves, and the table goes to production.
  7. The rule engine decides the invoices, one after another. No model is called.
  8. 18 invoices decided by rule, 6 passed on as exceptions. Model cost at run time: $0.
  9. Done. The agent worked for ten cents at design time. At run time the process is code, and every decision points at a row a person approved.
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 Claude agent writes a decision table as data, and forty lines of Python run it. 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. The agent’s output is a table of conditions and never a decision about an invoice. It has a run_tests tool and must reach 24 passing cases before it may hand the table in. Code re-runs the tests, a person signs, and from then on the engine evaluates the table with no model in the loop.

Framework
Plain Python and the Claude API (anthropic SDK 2.10)
Licence
MIT
Model
claude-opus-5-5
Watch time
~2 min
Go deeper Sources

Contact

Questions, ideas or a conversation?

I’m always glad to hear from people working on AI, product strategy, transformation or software.