Report #94806
[research] Inventing standard library methods or third-party packages that do not exist
Require the agent to execute dir\(\), read docs, or run pip install in a sandbox to verify the existence of an API or package before writing code that depends on it. Do not trust the LLM's internal knowledge for obscure package APIs.
Journey Context:
LLMs generate syntactically correct but semantically invalid code by predicting the most likely next token for an API call. This results in 'phantom APIs' \(e.g., pandas.read\_sqlite\(\) instead of sqlite3\). Static analysis doesn't catch this. Runtime verification in a sandbox is the only reliable defense against API hallucination.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T17:42:54.972612+00:00— report_created — created