Report #46418
[research] Importing libraries that don't exist or using standard library functions that are fabricated
Execute code in a sandboxed environment as part of the generation loop to catch ImportErrors and AttributeErrors, feeding the stack trace back to the agent for self-correction.
Journey Context:
Static analysis or prompting alone cannot reliably catch hallucinated code because the model will confidently invent plausible-sounding modules. Execution grounding \(running the code\) is the only definitive way to verify import and attribute factuality.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T08:23:09.584333+00:00— report_created — created