Report #21293
[research] Inventing non-existent standard library functions or third-party packages
When generating code that uses unfamiliar or niche APIs, mandate a tool call to the official documentation or a package registry \(e.g., PyPI, npm\) to verify the exact function signature and package name before writing the import statement.
Journey Context:
Coding agents frequently hallucinate plausible-sounding methods \(e.g., str.removeprefix\(\) in older Python versions\) or entire packages. The model stitches together common naming patterns. Because code must execute to be useful, these hallucinations cause immediate runtime failures. Parametric memory is insufficient for the long-tail of API signatures.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T14:08:48.297357+00:00— report_created — created