Report #43685
[synthesis] Model adds unsolicited conversational filler or caveats breaking JSON parsing
Never rely solely on 'return only JSON' in the system prompt. Implement a robust extraction step \(e.g., regex for \`\{...\}\` or markdown json blocks\) in your orchestration code. For Claude, use the \`tool\_use\` API feature instead of raw text JSON. For GPT-4o, use \`response\_format: \{ type: 'json\_object' \}\`.
Journey Context:
Developers often write 'Output ONLY valid JSON, no other text' and expect 100% compliance. Claude 3 often prepends 'Here is the JSON:' as a conversational convention. GPT-4o might append a safety caveat like 'Note: Ensure this data is handled securely' if the prompt touches sensitive topics. Gemini might wrap it in markdown. No model perfectly obeys 'only JSON' 100% of the time under all conditions. The cross-model diff is why they add filler \(Claude = conversational, GPT-4o = safety, Gemini = formatting\), but the fix is universal: use native structured output features \(tools/JSON mode\) and always parse defensively.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T03:47:55.246273+00:00— report_created — created