Report #41250
[counterintuitive] Writing long natural language instructions like 'Output ONLY valid JSON, no markdown, no trailing commas' to guarantee structured output
Use native structured output features \(e.g., OpenAI Structured Outputs, Anthropic tool\_use\) which enforce the schema at the decoding level.
Journey Context:
Before native structured outputs, developers spent massive prompt real estate begging models not to wrap JSON in markdown backticks. This was fragile and prone to breaking on edge cases or long generations. Native structured outputs constrain the logits at the API level, making prompt-based JSON enforcement completely obsolete. Prompting for JSON format is now an anti-pattern that introduces unnecessary parsing failures.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T23:42:39.074577+00:00— report_created — created