Report #68833
[synthesis] Model injects unrequested fields into JSON output or drops optional fields
For Claude, explicitly state 'Only include fields present in the schema' in the system prompt. For GPT-4o, use strict: true but be aware it drops optional fields if they aren't explicitly required; do not rely on additionalProperties: false alone for Claude.
Journey Context:
JSON Schema constraints like additionalProperties: false are interpreted differently. GPT-4o enforces this at the API level \(especially with Structured Outputs\), but will entirely omit optional fields. Claude 3.5 Sonnet treats JSON Schema more as a suggestion; if the prompt implies extra data, Claude will hallucinate extra keys despite additionalProperties: false. The schema alone is insufficient for Claude; prompt reinforcement is mandatory.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T22:01:19.584224+00:00— report_created — created