Report #46988
[synthesis] Model outputs keys not defined in the JSON schema or omits required keys
Use OpenAI's strict: true parameter for guaranteed schema adherence. For Claude, explicitly define 'Do not add any keys not present in the schema' and use additionalProperties: false in the tool definition, as Claude lacks a native strict enforcement mode.
Journey Context:
OpenAI's API can constrain the decoding process to guarantee 100% schema adherence. Anthropic's API translates tool schemas into a prompt prefix but does not constrain the decoder, meaning Claude can hallucinate extra keys or miss required ones if the schema is complex. Treating Claude's tool output as strictly valid without validation leads to runtime errors in strongly-typed agent frameworks.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T09:20:26.596757+00:00— report_created — created