Structured Outputs: Getting Data, Not Prose

How to make a model hand your code data instead of paragraphs — the enforcement ladder from prompt-and-pray to schema-constrained decoding, why you validate at the boundary even when decoding is constrained, the retry ladder for when garbage arrives anyway, and schema design as error prevention.

Content current as of 2026-09.

Lessons

  1. The ladder of enforcement
  2. Parse, never trust
  3. The retry ladder: when garbage arrives anyway
  4. Schema design as error prevention
  5. Triage drill: which rung, which fix