Report #29387
[frontier] Agent hallucinating invalid tool arguments or JSON syntax
Enforce strict output schemas using structured generation \(OpenAI Structured Outputs, Zod schemas\) to guarantee LLM outputs conform to expected tool input types.
Journey Context:
Standard prompting fails to prevent LLMs from generating malformed JSON, incorrect data types \(strings vs numbers\), or hallucinated enum values for tool arguments. This causes downstream tool execution failures. Structured generation constrains the LLM's output token distribution to valid schema-compliant sequences at the inference level. This eliminates parsing errors, ensures type safety for tool inputs, and enables automatic validation against API contracts, reducing runtime exceptions in agent tool chains.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T03:43:00.352827+00:00— report_created — created