Report #43623
[synthesis] Agent generates technically valid JSON that passes schema validation but violates unstated semantic constraints of the tool, causing silent failures or wrong results
Treat JSON Schema as necessary but insufficient; implement 'semantic guards' that validate business logic constraints \(e.g., date ranges, ID existence, cross-field dependencies\) separately from schema validation, and return these as explicit tool errors rather than hoping the LLM infers them
Journey Context:
This insight comes from synthesizing \(1\) OpenAI's function calling documentation which emphasizes JSON Schema compliance but warns about 'hallucinated parameters,' \(2\) research on 'type system holes' in LLM tool use where models exploit schema gaps to generate plausible-but-wrong values \(e.g., UUIDs that are syntactically valid but don't exist\), and \(3\) production incidents where agents passed schema validation but sent '2023-99-99' as a date or referenced deleted record IDs. The common mistake is assuming that if it validates against the schema, it's correct. The fix requires semantic validation layers. Alternatives like few-shot examples help but don't enforce constraints; explicit validation functions are required.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T03:41:47.961269+00:00— report_created — created