Rules Where You Need Certainty, Models Where You Need Judgment
A fictional two-request patient message shows how to give judgment to a model and certainty to rules, with checks that hold the two together.

A team asks a model to produce a file with the same exact column names every time. It works for weeks. Then on an unremarkable Thursday the columns come back reordered, and the team decides that AI does not work.
Summary: A two-request patient message lets you sort each step of a workflow into work that needs judgment and work that needs certainty. You can then pair a model with ordinary code so that each covers the other’s weakness.
The running example is fictional. A clinic’s shared inbox receives this message: “Can I move my Thursday visit to next week? Also, I have a question about my bill.” It holds two requests, one for scheduling and one for billing, and the clinic wants it read, routed, answered in draft, and approved by a person.
A spreadsheet formula gives the same answer every time. A language model asked the same question twice may word the answer differently, or occasionally reach a different conclusion. Most disappointment with AI traces back to treating the second kind of tool as though it were the first. The rest of this post shows how to avoid that mistake on the one message above.
Nothing here was run against a real inbox. The sorting, the checks and the expected results are a written design. Each expected result is labelled as expected, so you can run it yourself and compare.
Sort each step into judgment or certainty
Rule-based software does what it is told. When it misbehaves, someone wrote the logic wrong, and the fix is to find the bad line. A language model produces the response that best fits its input, wording varies between runs, and there is no line to point at when it goes wrong. Debugging means adjusting instructions, context and checks, then testing again over many examples.

Neither kind is better. They suit different jobs. Models handle what rules handle badly: reading a free-text message and working out what the sender wants, summarizing, drafting, and sorting items whose categories overlap. Rules handle what must not vary: exact formats, required fields, routing, date windows, and anything with a legal or financial consequence. Sort the clinic’s steps as the figure shows.
Read the table one row at a time. Each row is a step in the clinic’s workflow, and the second column says who does it: the model, the rules, a script, or a person. A row with two names in it is a step you have not finished sorting.
Let the model read and the rules route
The first step is the model’s. It reads the message and decides that it contains a scheduling request and a billing question. Ordinary workflow logic then takes over and sends each part to the right queue with the same deadline rules every time.

The split matters because the routing must be identical on Thursday and on every other day. The model supplies the interpretation, and the rules supply the guarantee. The model’s output is a short label list, and the rules accept only labels they know.
Allowed labels: scheduling, billing, clinical, other
Model returns: scheduling, billing
Rules: scheduling goes to the front-desk queue
billing goes to the billing queue
any other label goes to a person
An unknown label is the case teams forget. If the model returns a label that is not on the list, such as “payment-plan,” the rules must not guess. They send the message to a person and log the label. That keeps a creative answer from becoming a routing decision.
Write down the expected output before you run it
Before the first test, record what a correct result looks like for the example message. This is the expected result, not an observed one.
Model finds: one scheduling request, one billing question
Rules route: scheduling queue, billing queue
Draft reply: offers no specific time unless the schedule shows one
Never present: balance amounts or clinical advice
An acceptable run produces two labeled requests, two queues, and a draft that stays inside the listed limits. If the model names a balance, or the routing differs between two runs of the same message, the step failed, and the fix belongs in the instructions or the checks, not in a longer prompt.
Run the same message twice. Expect the wording of the draft to differ and the routing to match exactly. That is the whole idea in one test: variation in the part that may vary, none in the part that must not.
Test the neighbor of the example message
The obvious case is not enough. A rule that works on the example may break on the message next to it.

The near-miss for the clinic is a message that mentions the bill without asking about it: “I need to move my Thursday visit to next week. I will pay the balance when I come in.” It looks like the example, and it has one request, not two. A model that finds a billing question here has invented one, and the billing queue gets noise.
Another neighbor is a message with a clinical question tucked inside: “Can I move Thursday? Also, my knee still hurts.” The rules send the clinical part to a person every time, whatever the model drafts. The model reads the sentence. It does not get to answer it.
For each message in a small test set, write the expected labels first. Then count how many matched. A match count over a handful of messages shows the routing holds on the cases you thought of. It does not show how it behaves on the message you did not think of, so keep adding the odd ones people actually send.
Check the draft with code before anyone sees it
A model drafts the reply. Before it reaches a person, a script confirms that any appointment date matches the schedule, the required wording is present, and no blocked content slipped in. If a check fails, the draft is rejected or sent to a person.

The left panel is free wording, which may vary. The right panel is three checks that may not: the date exists on the schedule, the required sentence appears, and no dollar amount or clinical advice does. A draft that offers “next Tuesday at 3” when the schedule has no 3:00 slot fails the first check and never reaches the front desk.
Teams often respond to a failure by writing longer and stricter prompts. That helps for a while, then fails on some other ordinary day. The assignment was the problem, not the tool. The same pattern fits billing: a model might propose a reason for a denied claim, while a strict check confirms that codes and formats are valid before anything is resubmitted. Healthcare data exchange is full of exact formats where one wrong character causes a rejection, and that is rules territory.
Keep the checks small and dull. A check that tries to judge whether the draft sounds kind is a second model in disguise, and it will vary like the first. A check that asks whether a date appears on the schedule gives the same answer every time, and that is the only kind worth writing in code.
Each check has an owner. The front-desk lead owns the schedule check and the required wording. The billing lead owns the blocked list. When a check is wrong, the person who owns it fixes it, and the model’s prompt stays out of the argument.
Plan for the bad day before it arrives
The Thursday in the opening scene is a bad day: the columns came back reordered. A rule-and-model pair should survive that day without anyone noticing, because the rules refuse what they do not recognize.
Bad day: model returns a label list in a new order
Expected: rules read labels by name, routing unchanged
Bad day: model returns text instead of a label list
Expected: rules reject it, message goes to a person, error logged
Bad day: model service is down
Expected: message waits in the inbox, front desk alerted by 8:00
Notice what these share. Not one of them depends on the model behaving. Each one says what the rules do when it does not. That is the point of putting the exact parts in code: the code does not have a Thursday.
What to count: every week, how many messages went to a person because a rule rejected the model’s output. A rising count means the instructions need work. A count of zero for months is not proof that everything is fine. It may mean the rules are too loose to reject anything, so feed in one deliberately bad output now and then and confirm it is caught.
Keep a person on anything with consequences
For a message about a bill or an instruction about preparing for a procedure, the model prepares and a person signs off. Think of the steps as three levels, shown in the figure.

Wording of a friendly opening line can vary freely. A date and a required sentence are enforced by code. A billing statement is approved by a person. Moving a step up a level should take a reason, and moving one down should take a track record.
Here is what a track record looks like for the clinic. A step moves from “person approves” to “code enforces” only after a run of cases where the person approved every draft unchanged, and only for the narrow kind of draft that run covered. The length of that run is for the owner to set. This post does not supply a number, and a number borrowed from another team would not carry over.
Ask three questions of each step, then ship the split
The deterministic parts wrapped around a model are what harness engineering means in practice: the context given, the instructions followed, the tools allowed, the validations on output, and the tests that measure it. Most of it is ordinary, predictable code, and the model supplies judgment inside a frame that supplies certainty.

For each step in your own workflow, ask where the output can vary without harm, where it must be enforced, and which step needs judgment rather than a rule. Often a step people assumed needed AI only needed a lookup table, and a step they assumed was simple needed a model because the inputs were messy. Take one workflow you plan to build and label every step before writing any instructions.
Resolve “next week” in code, not in the model. The model may read the phrase and say the patient wants a visit in the following week. A script turns that into the actual dates and looks them up on the schedule. If the model wrote the dates itself, they would be one more thing to check, and the check would be the script anyway.
Keep the labeled list with the workflow. It is the document the next person reads to learn why a step is code and not a prompt. When someone asks to change a step, the list tells them which kind of change it is: a rule edit, an instruction edit, or a new approval.
Test the labels the same way you tested the example. Run the near-miss. Run it twice. Confirm that routing is identical and wording is allowed to differ. If a step you labeled “rules” produces different output on the second run, the label was wrong, or the rule was never in code. Fix that before anything reaches a patient.
Label each step. Then run it twice.
About Celera Group
Celera Group is a founder-led practice based in Franklin, Tennessee. We build and run practical AI systems for owner-led businesses, and provide a senior, part-time AI and data lead for mid-size organizations. One workflow at a time, with a person approving the output that matters.