Build journal

My safety check was stricter than my safety gate

Rekhon2 min read

A check meant to protect a feature silently switched it off instead, and nothing went red.

GuardrailsWar story

Compiled from the repository’s decision records and changelog rather than written as a first-person account. The reasoning is the project’s; the summarising is editorial. The record itself is linked at the end.

Rekhon's on-device model writes a sentence around figures it is given, and two checks stand between it and the screen: DraftSanitiser, then the guardrail engine. ADR-0080, dated 10 October 2026, records how the first of those switched the model off, in a way no test, log or screen would have reported.

Stricter than the gate it protected

DraftSanitiser compared the reply against the literal strings the prompt showed. The prompt shows ₹61,427.00, and a small model told that very often writes ₹61,427. The guardrail, one step later, would have accepted it: its AllowedRenderings had permitted the whole-rupee short form since issue 9.7, because the app writes amounts that way itself.

So the sanitiser refused a reply the guardrail would have passed. A refusal falls back to the template sentence, and the template sentence looks exactly like a phone with no model installed. Someone who had sideloaded 521 MB of weights would have seen them used for almost nothing, with no error anywhere.

One definition of the same figure

The guardrail already knew which renderings of a figure are the same figure, from a rulebook row. That answer is now published as FigureRenderings.of(evidence, rules) and the sanitiser reads it, so the two layers cannot disagree. The fix was to stop keeping two copies, not to loosen one.

  • Now accepted: ₹61,427, ₹ 61,427.00, ₹1.5 lakh for exactly ₹1,50,000, and 3 Nov 2026 for 2026-11-03.
  • Still refused: about ₹61,000, ₹2 lakh for ₹1.5 lakh, ₹61427.00 in western grouping, and ₹1,23,456 for an amount with paise.

Two rates, both held at 100%

A frozen set of 46 cases now measures one thing, whether a reply states exactly the figures it was given, as two rates. Every drifted or invented figure must be refused, and every faithful reply must be accepted. The second rate is the one this record exists for.

A false refusal is invisible: the user silently gets the plainer sentence every turn and the weights are never used.
ADR-0080

The set found the code's mistakes

The cases were written before the code they measure. The first run passed 39 of 43. A model that reads its figure list back passed every digit check while showing the prompt's own scaffolding as an answer, and a misstated amount was reported as silence because the rules ran in the wrong order. After fixes, 43 of 43.

Three more cases were then added, and all three failed. One refused a terse, true sentence that opens with a figure, because a new rule required replies to begin with a letter. The record calls that its own mistake made a second time, and the rule was removed. The final run passed 46 of 46.

One measurement stays open. A device test that runs the model itself has an acceptance floor of 67%, and the record says that floor is a judgement, not a measurement: nothing had run the model on a phone when it was written.