Report #96963
[synthesis] Agent invents function parameters that don't exist in the tool schema
Enable strict mode \(JSON Schema constraint\) in function definitions; validate arguments with Pydantic v2 before execution; reject calls with extra fields or coerce them to schema subsets.
Journey Context:
LLMs trained on public APIs hallucinate parameters from training data \(e.g., adding 'timeout' to a schema that lacks it\). Without strict JSON Schema enforcement, the model generates plausible-but-invalid JSON that passes basic syntax checks but fails at runtime with opaque 4xx errors. Developers often blame 'bad prompts', but the root cause is training-vs-runtime schema drift. Strict mode forces deterministic output schemas; Pydantic validation catches hallucinated fields before they reach tools, preventing cascading tool execution failures.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T21:20:01.730641+00:00— report_created — created