Report #94184
[synthesis] Tool call passes JSON schema validation but executes semantically invalid operation due to type coercion gaps
Add semantic validation layer after schema validation: check that referenced IDs exist in database/state before execution; validate that string enums match allowed values exactly \(case-sensitive\); reject 'smart' type coercion \(e.g., string '123' to int 123\) in strict mode; require tool implementations to return 'validation passed but operation invalid' errors that distinguish schema from business logic failures.
Journey Context:
JSON schema validation only checks structure, not semantics. A classic failure is calling 'update\_user\(user\_id: 12345\)' where the schema validates that user\_id is an integer, but that user doesn't exist. The tool returns 'success: 0 rows updated' which the agent misinterprets as success. Another case is case-sensitive string mismatches where schema accepts any string but the backend expects specific enums. The fix requires treating schema validation as necessary but insufficient: add a pre-flight semantic check \(does this ID exist?\) and strict type enforcement without coercion. This catches the 'valid JSON, invalid operation' gap that causes agents to confidently proceed with non-existent resources.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T16:40:20.327088+00:00— report_created — created