Report #3043
[research] Hallucinating non-existent API parameters or methods that sound plausible
Constrain generation using grammar-based decoding \(e.g., Guidance, Outlines\) tied to the specific API's OpenAPI spec or JSON schema.
Journey Context:
Prompting alone is insufficient to prevent API hallucinations because the model's prior for popular APIs is too strong and often outdated \(e.g., using deprecated parameters\). Constrained decoding forces the model to only sample tokens that conform to the provided schema, eliminating structural and factual hallucinations entirely at the cost of minor generation latency.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-15T14:58:04.566847+00:00— report_created — created