← All writing

Keep the model away from the numbers

6 July 2026

There is a simple test for whether an AI system is ready for business data. Ask where the numbers come from.

If the answer is “the model”, walk away.

Language models are extraordinary at language. They are also confident, fluent, and completely willing to produce a figure that does not exist. Not often. Just often enough that the one fabricated number lands in a board pack, someone makes a decision on it, and six months later you are explaining what happened.

The fix is not a better prompt. It is architecture.

The pattern I build to is three layers with a hard boundary between them. The database retrieves. Deterministic code calculates. The model narrates. Every number the user sees was computed by ordinary, testable code from real query results. The model receives finished figures and writes the sentences around them. It is never asked to add, subtract, estimate, or remember a value.

This sounds restrictive. That is the point. When the model cannot touch the numbers, it cannot invent them. Every figure is computed by deterministic code from the query results, so a fabricated number cannot occur.

A few rules that make this work in practice.

Retrieval returns rows, not summaries. If you let a model summarise raw data before calculation, you have already lost the audit trail.

All arithmetic lives in code. Aggregation, currency handling, date maths, percentage changes. Write it, test it, version it like any other production code.

Every figure is traceable. If a number appears in the output, you should be able to point to the query and the function that produced it. If you cannot, it should not be there.

Keep one model call, late. In most operational dashboards I build, the model does one job at the end: turn computed results into a readable narrative. Everything before that is boring, deterministic, and correct.

The irony is that this makes the AI more impressive, not less. Users stop double checking. Trust builds. The system gets used daily instead of demoed once.

The model is a brilliant writer. Let it write. Just never let it near the calculator.