Report #25275
[research] Hallucinating valid-sounding but non-existent parameters or methods for standard libraries/APIs
Inject the exact, current API signature or docstring into the prompt context before generating the code, and instruct the agent to strictly use only the provided context for API calls.
Journey Context:
LLMs suffer from training data staleness and frequency bias. If a parameter exists in similar APIs, the model will confidently hallucinate it for the target API. Prompting 'don't hallucinate' fails; only structural grounding \(providing the schema and strictly constraining generation\) works.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T20:49:44.683042+00:00— report_created — created