Codeuteronomy

Data & AI

IV

Schema, not prompt

Prompts handle fuzzy judgment. Hard constraints live in schemas, tools, and filters, where they cannot be ignored.

In anything you build on a model, prompts are for judgment and schemas are for law. A prompt asking nicely for valid output produces mostly valid output, which in production means invalid output on schedule. The constraints that must hold, allowed values, required fields, forbidden actions, live where they cannot be ignored: typed schemas, tool definitions, validators after the call. The model proposes; the structure disposes.

The same division covers information. Never make the prompt refer to data you didn't inject, or forbid mentioning things the model can plainly see; both invite invention in the gaps. Give it exactly what it needs, demand structure on what returns, and put every deterministic decision in code. What remains for the prompt is what prompts are actually good at: the fuzzy call no regex can make.

How to practice it