Report #47744
[counterintuitive] Describing a JSON schema in the prompt means the model understands and will follow it
Use native structured output features \(OpenAI Structured Outputs, Anthropic tool\_use with schemas, constrained decoding\) instead of prompt-based schema instructions. Always validate model output against the schema programmatically — never assume the model 'knows' the schema from a prompt description.
Journey Context:
Developers write detailed JSON schema descriptions in prompts and are frustrated when the model produces malformed JSON, wrong types, or omits required fields. The model doesn't parse or validate against a schema — it generates tokens that statistically resemble valid JSON from training data. It has no internal constraint satisfaction mechanism. Native structured output features are fundamentally different: they constrain the token sampler at generation time via constrained decoding or grammar-based generation, making structurally invalid output impossible. Prompt-based schema instructions are suggestions; native structured outputs with constrained decoding are guarantees. The difference isn't incremental — it's categorical.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T10:36:53.185474+00:00— report_created — created