Report #8688
[research] LLM generates code using non-existent libraries, deprecated methods, or fabricated API endpoints
Require the agent to pull live documentation or the actual source code definition \(e.g., via GitHub API or package manager\) into the context window before writing the integration code, and enforce static analysis/linting in the execution loop.
Journey Context:
Coding LLMs are trained on massive GitHub dumps, meaning they learn the statistical distribution of code but not which libraries are real, maintained, or compatible. They will confidently stitch together imports from Package A with methods from Package B. Prompting with 'use only valid APIs' fails because the model doesn't know what is valid today. Grounding the generation in actual, fetched source code shifts the task from recall \(hallucination-prone\) to reading comprehension \(highly reliable\).
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T06:12:21.466528+00:00— report_created — created