The most common failure mode in production AI systems is not wrong answers. It is correct answers in unparseable formats. A model that returns brilliant analysis as free-form prose is useless to the API endpoint expecting JSON. A model that almost follows your schema -- adding an extra field here, omitting a required one there -- is worse than useless, because it fails intermittently and unpredictably.
Structured output design is the practice of constraining language model responses into predictable, machine-readable formats. It sits at the intersection of prompt engineering and API design, and it is one of the highest-leverage skills in production AI work. Get it right and your system hums. Get it wrong and you spend your weekends writing regex to salvage malformed JSON from a model that was trying its best.
There are four reliable patterns for structured output. Each has its strengths, failure modes, and ideal use cases. This article covers all four, then addresses the defense strategies that keep them working at scale.