Arth
Decision 4 of 18

Constrain the generation, then validate it anyway

One decision from Arth, which asks: Can an app understand your money without ever being told what it is?


Model output is forced into valid JSON matching the app's schema using a grammar at generation time — the model cannot emit malformed structure because the grammar will not let it.

And then a schema-validation pass runs afterwards regardless. That is belt and braces, and it is deliberate: a grammar constrains shape, not sense, and model output that is about to be written into someone's financial record is not data I am willing to trust on one guarantee.

Your opinion

Would you have decided this differently?

Where do you stand?

What gets published. I read every opinion and publish substantive ones, including those that disagree with me, as a scroll on this page. I may add a reply. I leave out spam, abuse and anything off-topic, so please include only what you’d be happy to see in public.

Where it goes. I keep your opinion, your stance and, if you allow it, your name in a database run by Neon. I don’t ask for your email or store your IP address, but Netlify, which hosts this site, may log it when it handles your request. To have yours removed, email pkrishna@vaulthai.health. A published opinion is removed from the site, though it can remain in my site’s version history.

Next