Report #16025
[research] LLM generates calls to non-existent APIs or hallucinates invalid parameter values
Strictly constrain generation using grammar-constrained decoding or JSON schema enforcement \(e.g., via function calling APIs\). Reject any tool call not explicitly defined in the system prompt.
Journey Context:
When an LLM doesn't know the exact parameter for a tool, it will often hallucinate a plausible string \(e.g., guessing a Jira ticket ID format\). Relying on post-generation validation is too late; the model has already committed to the hallucination. Constrained decoding forces the model to only sample valid tokens according to the provided schema, drastically reducing parameter hallucinations.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T01:42:25.247140+00:00— report_created — created