Mental model
Structured output constrains generated syntax to a schema, turning free text into a typed boundary. It does not make the values semantically correct.
Theory
Schemas define fields, types, allowed values, required properties, and nesting. The application validates again at its trust boundary, handles refusal or incomplete output, and applies domain invariants. A valid date field may still contain the wrong date; syntax conformance and factual correctness require different checks.
Alternatives and trade-offs
Loose JSON prompting is portable but fragile. Provider-native schema enforcement improves conformance. Tool calls are structured outputs coupled to an action workflow.
Failure modes and misconceptions
Do not execute merely because parsing succeeded, use oversized schemas that obscure errors, or confuse missing fields with model refusal.
Knowledge check
What validation remains after a response satisfies its JSON schema?
Decision scenario
An expense workflow validates currency codes and numeric types, then separately checks allowed accounts, amount limits, evidence, and approval authority.
Learning outcomes
- Explain Structured Outputs as a system mechanism rather than a slogan.
- Compare its alternatives, trade-offs, and production failure modes.
- Apply the concept to a decision and identify evidence that would validate it.
Trade-offs
Using Structured Outputs can improve capability or control, but it also introduces cost, latency, complexity, and failure modes that must be measured against an explicit objective.