Report #56129
[synthesis] Model returns extra JSON keys or violates enum constraints in tool call arguments
For Claude, append 'Ensure the output strictly matches the JSON schema. Do not add extra keys.' to the tool description. For GPT-4o, enable \`strict: true\` if schema adherence is critical, but expect higher latency.
Journey Context:
Without strict mode, LLMs often 'helpfully' add extra fields \(e.g., adding a \`status\` field to a \`create\_user\` tool\). OpenAI's strict mode forces deterministic schema adherence via context-free grammar. Claude lacks this native API feature, so the only lever is prompt engineering. Relying on default behavior for strict schema validation will cause Pydantic/validation failures in production.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T00:42:24.141541+00:00— report_created — created