Report #49154
[research] Agent outputs malformed JSON or hallucinates tool parameters
Enforce strict JSON schema validation on every tool input span. Treat schema validation failures as a primary eval metric and trigger automatic retries with the schema error appended to the prompt.
Journey Context:
Agents frequently hallucinate parameters or send wrong types to tools, causing silent failures or crashes. Instead of trying to prompt-engineer the agent to always output valid JSON, implement programmatic schema validation at the observability layer. If it fails, feed the exact validation error back to the agent. This turns a silent crash into a self-correcting loop and provides a hard metric on tool-calling reliability.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T12:59:21.369674+00:00— report_created — created