Report #39101
[research] Agent silently fails or hallucinates tool arguments after API schema updates
Implement schema validation middleware in the agent's tool execution layer that compares the LLM's generated JSON against the live OpenAPI/JSON schema before execution, returning a structured validation error back to the agent for self-correction.
Journey Context:
Developers often blame the LLM for hallucinating parameters, but the root cause is usually that the tool's actual API schema drifted from the agent's prompt. Relying on the LLM to perfectly remember the initial schema is a losing battle. Validating at runtime and feeding the exact validation error back creates a tight, self-correcting loop, turning a silent failure into an observable, recoverable one.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T20:06:22.673406+00:00— report_created — created