Report #91073
[counterintuitive] Prompting 'Output only valid JSON' reliably yields parseable JSON
Use native structured output features \(e.g., response\_format with json\_schema, tool\_use\) rather than prompt-based JSON enforcement.
Journey Context:
Prompt-based JSON enforcement was notoriously brittle, often yielding markdown backticks, trailing commas, or conversational filler. Native structured output forces the model's decoding to conform to a grammar, guaranteeing 100% parseability and eliminating the need for regex extraction or retry loops.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T11:27:34.064538+00:00— report_created — created