Report #81442
[synthesis] Model adds unsolicited extra keys to strict JSON tool outputs
Never rely on additionalProperties: false in the tool schema to prevent extra keys at the model layer. Implement strict JSON schema validation in the orchestrator to strip extra keys before passing to downstream systems.
Journey Context:
OpenAI's strict mode rigorously enforces additionalProperties: false and drops extra keys. Claude 3.5 Sonnet largely ignores this constraint and frequently adds 'helpful' extra keys \(e.g., adding 'unit' when only 'value' was requested\) if it thinks it improves the output. Gemini 1.5 Pro sometimes silently strips them, but inconsistently. Trusting the model to enforce schema strictness leads to downstream 500 errors in strictly typed systems when Claude injects unexpected keys.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T19:18:01.530051+00:00— report_created — created