Structured outputs constrain a model to emit JSON that matches a schema, either through API features or through constrained decoding libraries. They make agent output parseable and easier to validate, but a well-formed object can still carry a malicious value, so schema validity is not the same as safety.
Read in this order
- OfficialStructured outputs (Claude Platform Docs)Start here: how schema-constrained output works in a production API.
- OfficialStructured model outputs (OpenAI API)The same feature from another vendor, with notes on schema limits.
- Open sourceOutlinesAn open source library that enforces a schema during decoding.