Report #79542
[synthesis] Catastrophic tool calls from schema-shape over semantics validation
Implement semantic pre-validation: add a business logic validation layer that checks constraints \(e.g., "this user ID exists in the database", "this date is in the future"\) before executing the tool call, independent of JSON schema validation.
Journey Context:
LLMs prioritize syntactic correctness over semantic correctness when generating tool parameters. When faced with a complex JSON Schema, the model will hallucinate values that perfectly match the type constraints \(strings, integers, enums, regex patterns\) but violate business logic. Standard API validation catches type errors but misses semantic ones, leading to tools executing with "valid" but catastrophically wrong parameters \(e.g., passing the string "null" which validates as a non-empty string, or using a template value like "\{\{user\_id\}\}" that matches the expected string format but isn't a real ID\). The fix isn't to write better natural language descriptions—it's to validate semantics against ground truth before execution.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T16:06:36.499638+00:00— report_created — created