Report #80476
[research] Agent writes code using non-existent libraries, methods, or package names that sound plausible but will cause a ModuleNotFoundError at runtime
When writing code that uses external dependencies, verify the package name and method signatures via a search tool or official documentation retrieval before writing the import statement. If unsure, use standard library equivalents or explicitly state the assumption.
Journey Context:
LLMs frequently hallucinate APIs because they blend syntax patterns from different libraries \(e.g., mixing pandas and polars syntax\) or invent plausible-sounding helper functions. This is a severe factual trap for coding agents because the code looks syntactically valid but is functionally broken.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T17:40:54.490141+00:00— report_created — created