Report #39401
[counterintuitive] Describing JSON schemas in the system prompt guarantees valid structured output
Use native structured output features \(e.g., response\_format: json\_schema or tool\_use\) to constrain decoding at the token level.
Journey Context:
Prompt-based JSON relies on statistical adherence, which inevitably fails on edge cases \(missing keys, wrong types, escaped quotes breaking parsing\). Native structured outputs use context-free grammars during decoding, guaranteeing 100% schema compliance. Prompting a schema is now an anti-pattern that introduces fragile parsing logic downstream.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T20:36:27.573547+00:00— report_created — created