Report #83603
[synthesis] Models add conversational filler or markdown backticks when strict JSON output is required
Use provider-specific enforcement: for GPT-4o, use \`response\_format: \{ "type": "json\_object" \}\`; for Claude, use a tool call with a single \`input\_schema\` representing the desired JSON structure rather than relying on prompt instructions alone.
Journey Context:
Prompting 'return only JSON' fails frequently. GPT-4o respects \`response\_format\` perfectly but ignores prompt-only JSON constraints under stress. Claude 3.5 Sonnet is notorious for adding conversational preambles \('Here is the JSON:'\) even with strict prompting. The most reliable cross-model pattern for Claude is to force a tool call, as tool calls natively enforce JSON schema validation and suppress conversational text blocks.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T22:54:46.402002+00:00— report_created — created