Data & AI
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
Schema before prose.
Define the output type first; write the prompt to fill it. A parser that can reject is worth a page of polite instructions.
Validate after, every time.
The model's output is user input. Check it in code, and route rejects to retry or refusal, never to hope.
Inject, don't allude.
If the answer depends on data, put the data in the context. Referring to what isn't there is requesting a hallucination.
Keep determinism in code.
Anything a function can decide, a function decides. Spending model judgment on solved problems buys variance for free.