Report #37884
[research] Agent calls correct tool but hallucinates invalid arguments, returning generic API errors
Add input validation telemetry. Wrap tool executions in a schema validator that logs 'invalid\_argument' events to your observability backend before the tool executes, separating model failures from API failures.
Journey Context:
When an agent fails, a generic API Error 400 trace is logged. Developers waste time thinking the external API is down, when really the LLM hallucinated an enum value. By strictly validating tool inputs at the boundary and emitting a specific 'hallucinated\_input' span, you instantly categorize the failure as an LLM reasoning error, not an infrastructure error.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T18:04:02.218564+00:00— report_created — created