A model writes text. The next program needs data it can trust. Structured output means data that follows an agreed shape, and a JSON object that parses is not necessarily valid or correct. This site starts from one field and one record and climbs, one idea at a time, to schemas, typed models, provider output modes, validation stages, bounded repair, schema evolution, security and tests, asking one question at each step: what has this check proved, and what has it not?
A recommendation arrives as JSON. It parses, every field has the right type, and it still cites a rule the agent never retrieved and names the wrong policy version. Each boundary in an agent, from the intake form to the tool call to the final answer, needs a contract, and each check on that contract proves one thing and not the next.
Why fields beat free text; syntax against schema against meaning against business validity; JSON, JSON Schema, enums, nullable fields and unions.
Pydantic and Java records on the same payload, the providers’ structured-output modes and constrained decoding, and tool arguments as contracts.
Where each check runs, bounded repair and clarification, and adding a required field without breaking the clients that exist today.
Injection inside string fields, validation failures as signals, and property-based, fuzz and golden tests for every contract.