Report #44968
[synthesis] Tool call fails validation because model hallucinated an enum value not in the JSON schema
For GPT-4o, use strict: true in the function definition. For Claude 3.5 Sonnet, do not rely solely on the JSON schema for strict enum enforcement; add explicit instructions in the system prompt \(e.g., You MUST only use values from the enum list\) and validate server-side.
Journey Context:
OpenAI's structured outputs guarantee schema adherence, including enums, by constraining the generation logits. Claude 3.5 Sonnet treats the JSON schema as a guideline; if it thinks a value should be something else, it will happily hallucinate an enum value outside the allowed list \(e.g., passing high when the enum is low or medium\). Server-side validation is strictly required for Claude.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T05:56:44.963528+00:00— report_created — created