Hardware FixRecommendedDevice not working? Your driver may be the problemCheck updates for common hardware issues.Fix DriversOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsPC HealthRecommendedCrashes, freezes, slowdowns? Check your PC nowSpot repairable issues before they interrupt work.Check PC×
Skip to content
World desk3 min

When AI Recommends a Package That Doesn’t Exist: How to Check It

AI-generated code can recommend a package that does not exist—or one an attacker later registers. Learn why existence checks are not enough and how to vet dependencies.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

An AI-generated code sample can name a dependency that is not real in the package ecosystem it implies. That is a package hallucination—not proof of an attack. The risk changes if someone later registers the invented name and publishes malicious code under it. Check both what a package is and whether it is trustworthy; a successful install or registry lookup is not a safety verdict.

What is a package hallucination?

A package hallucination occurs when generated code recommends or references a package that does not exist. A model may produce a plausible name because it has learned patterns from code and documentation, not because it has verified that the dependency exists or is the one the project needs.

As an Amazon Associate I earn from qualifying purchases.

That makes two questions essential: does the exact name resolve in the intended ecosystem, and does it identify a credible project that meets the code’s actual need? These are separate checks.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

What the USENIX study found—and what it did not

Spracklen and co-authors studied 16 coding models across Python and JavaScript using two prompt datasets. They extracted package names from generated responses and compared them with repository master lists. The final paper reports at least 5.2% average hallucinated packages for the tested commercial models and 21.7% for the tested open-source models; it also reports 205,474 unique hallucinated names. The USENIX Association says the study analyzed 576,000 code samples. These are results for that study’s models, languages, prompts and methods—not rates for every model or programming ecosystem today. USENIX Security 2025 paper and study details.

The project began in February 2024, and its first report appeared in June 2024; the paper was later published at the 34th USENIX Security Symposium in August 2025. That timeline matters: the figures are a dated benchmark, not a live measurement of current models. USENIX paper and project timeline explainer.

Different study summaries phrase an aggregate differently: the short USENIX explainer gives an overall average of 19.6%, while the final paper reports separate commercial and open-source averages, and the project repository summarizes 19.7% of recommended packages. Those figures should not be combined into a single universal rate because the summaries describe the aggregate differently. The final paper’s cohort-specific figures are the clearest basis for comparison. USENIX final paper.

How an invented package name can become a supply-chain risk

An invented name is not, by itself, malicious code. But if an attacker registers that name in an open package repository and uploads harmful code, someone who later follows the repeated AI recommendation may install the attacker’s package instead of the intended dependency. The paper warns that a simple existence check can then fail: the name now exists, but that does not make the package authentic, safe or credible. USENIX paper.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The danger is therefore a sequence: a model generates a name without confirming it; an attacker may claim that name; and a developer may install it without verifying its source and history. Existence and trust are different questions.

How to vet an AI-suggested dependency

  1. Confirm the intended ecosystem. Check whether the code expects a Python, JavaScript or other ecosystem package. A name in one registry does not establish that it is the dependency meant by the code.
  2. Verify the exact identity. Search the intended registry for the precise package name, then compare the project’s description, documentation and source with the functionality the code requires. If the name is absent, do not install a similar-looking substitute just because the model suggested it.
  3. Check provenance and credibility. Inspect who publishes the package and whether its history and source correspond to the intended project. A package’s presence in a registry is not evidence that its publisher is legitimate or that its code is safe.
  4. Review the dependency before adding it. Ask whether the project really needs the package and whether the code can use an already trusted dependency or a small implementation instead. Do not let generated code silently expand the project’s dependency list.
  5. Do not treat a successful install as validation. Installation confirms that a package resolver found something under that name; it does not prove the identity, provenance or safety of that code.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

What the study says about reducing hallucinations

The USENIX summary says the authors tested mitigations that reduced hallucinations while preserving code quality, but the available summary does not identify a universally best intervention. The practical implication for developers is to build verification into review and dependency selection rather than assuming a model or installer has already checked a package’s identity and trustworthiness. USENIX study summary.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Outdated Drivers Are Slowing You DownFree scan - exact matches
PC Slower Than It Used to Be?Free scan - under a minute

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.