Report #95441
[synthesis] Downstream Pydantic validation fails because model added extra fields not defined in the tool schema
Do not rely solely on \`additionalProperties: false\` in the JSON schema for output validation. Implement application-level Pydantic validation with \`model.model\_dump\(exclude\_unset=True\)\` or strict stripping, and explicitly tell Claude in the prompt: 'Do not add any fields not explicitly defined in the schema.'
Journey Context:
GPT-4o strictly adheres to \`additionalProperties: false\` in JSON schemas for structured outputs. Claude 3.5 Sonnet often ignores this constraint, adding extra fields or nested objects it deems helpful to fulfill the request. This causes hard crashes in strictly typed agent frameworks that expect the schema to be perfectly honored.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T18:46:33.025523+00:00— report_created — created