secure-coding-package-hallucination-rate-gpt-4 CLM-0144
observationsingle paperReviewed by AI and Russ Miller

GPT-4 recommended non-existent Python and JavaScript packages in only a small percentage of generations — lower than the open models tested in the same study — but the same hallucinated names recurred often enough across runs to be practically exploitable by an attacker who registers them ahead of time.

Capability: Writing secure code and dependencies

Observed on

GPT. 2024, GPT-4 class. Coding agent.

Model cards: GPT-4

Sources

Reviewed by AI and Russ MillerLast checked: 2026-09-03Evidence activityHow much the field cites the sources under this claimheavily cited in the last 12 months80 in 12mo · 106 total — We Have a Package for You! A Comprehensive Analysis of Package Hallucinations by Code Generating LLMs
Either way, bring evidence: a link, or what you saw.

Disagreeing is the most useful thing you can do here. Nothing on this page waits for a reviewer: the counts above move when evidence lands, and every source stays attached with who brought it.

Related claims