Report #90507
[counterintuitive] Writing long natural language prompts begging the model to 'ONLY output valid JSON' and describing the schema
Use native structured output APIs \(e.g., OpenAI Structured Outputs, Anthropic tool use\) that enforce the schema at the decoding level.
Journey Context:
In 2023, developers wasted thousands of tokens and built complex regex parsers because models frequently hallucinated markdown blocks or broke JSON syntax. Modern APIs allow passing a JSON schema directly to the engine, which guarantees syntactic validity and schema adherence 100% of the time. Prompting for JSON is now an anti-pattern.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T10:30:41.740197+00:00— report_created — created