The model never writes a number
An interactive walk through how an LLM can answer questions about your data with CEL expressions and receipts, so every figure can be checked.
Ask a language model for a figure and you get a confident number. Ask again and you may get another one.
Asked three times for the average monthly running distance, a plain model answered 72 km, 61 km and 69 km. The right answer is 66.67 km.
Here is a way to make every figure checkable. Each stage below is live, so try it.
Fetch, plan, check, run, write, replay.
1. Fetch
Data from a tool arrives as a receipt: what came back, where from, when, and a fingerprint of the content.
Receipt r1 holds twelve monthly distances from get_runs, the time they were fetched and a SHA-256 fingerprint of the data.
2. Plan
The model doesn't calculate. It writes a CEL expression and names the receipt each value comes from.
The plan says sum(distances) / months_per_year, with distances bound to r1/months/*/km. There is no number in it.
3. Check
Before anything runs, a policy reads the expression's syntax tree. Numbers have to come from receipts or named constants, and units have to add up. Write your own.
sum(distances) / 12 is refused, because 12 is a number the model typed. sum(distances) / months_per_year passes.
4. Run
Fixed code evaluates the expression and saves the result as a new receipt that points back to its parents.
sum(distances) / months_per_year becomes 800 / 12, then 66.67. Receipt r3 records the expression, its parent r1 and the value.
5. Write
The model writes the words and leaves placeholders for the figures. A guard refuses any number that no receipt backs.
"Your average monthly distance last year was {{r3}}." becomes "Your average monthly distance last year was 66.67 km (calculated from your training log)."
6. Replay
Every figure can be traced to its sources and worked out again. Change the data and see what happens.
Replaying r3 checks r1's fingerprint and recomputes the value. If anyone changes a month's distance, both checks fail.
The model decides what to compute. Code computes it, and the receipts let anyone check the result.