Report #47587
[research] Inventing non-existent standard library functions, pip packages, or API endpoints
Mandate that the agent executes a read or search command \(e.g., pip show, dir, grep, or API schema lookup\) to verify the existence of a package, method, or endpoint before writing code that calls it.
Journey Context:
Code LLMs predict the next token based on syntactic patterns. They will confidently invent a function like os.get\_pid\(\) \(instead of os.getpid\(\)\) or a pip package like python-math-utils because they sound plausible. Static generation without execution or external verification is the primary cause of code hallucination.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T10:21:42.313815+00:00— report_created — created