Report #71784
[synthesis] Model adds unsolicited safety caveats that break JSON parsing or structured output
Use provider-native structured output enforcement \(OpenAI JSON mode / response\_format, Anthropic tool\_choice with forced tool use\) rather than prompt-only structure requests; always test caveat behavior per model on sensitive-adjacent topics
Journey Context:
Claude models frequently prepend safety caveats \('I should note that...', 'While I can help with...'\) even in contexts where the prompt requests pure JSON output, particularly when the topic touches health, finance, or safety-adjacent domains. GPT-4o in JSON mode \(response\_format: json\_object\) suppresses most preamble but may still refuse entirely. Gemini occasionally adds disclaimers inside the JSON string values themselves. The synthesis insight: prompt-only approaches to structured output are fragile across models because each provider's safety layer operates independently of output format instructions. The safety layer can inject text before, around, or inside your expected structure. Provider-native enforcement mechanisms \(JSON mode, forced tool\_choice\) are the only reliable mitigation because they constrain the output at the generation level, not the prompt level.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T03:04:32.997551+00:00— report_created — created