Stockertim Dictionary · Artificial intelligence · Cybersecurity
Package hallucination
Also called slopsquatting
In short
Package hallucination is an AI tool suggesting a software package that does not exist, a name that someone may later register with harmful code.
- Advanced
- Attack or threat
- Checked
In detail
Package hallucination is a software supply-chain risk created by AI coding help. When asked to write code, an AI assistant may tell the user to install a library with a plausible name that does not exist. This is the same tendency that produces invented facts or citations, applied to software names.
The danger comes afterwards. Public package repositories let anyone publish under an unused name. If the same invented names come up repeatedly, someone with bad intent could register one and fill it with harmful code. A developer who copies the install instruction without checking would then download it. Because the name came from a trusted-seeming assistant, it may not raise suspicion.
The defence is to treat every dependency an AI tool suggests as unverified. Check that the package exists, is the one you intended, has a real history and active maintainers, and matches the official documentation of the project you are using. Organisations add technical controls too: an approved list or internal mirror of packages, automated checks on new dependencies, and code review that looks specifically at anything newly added.
The habit applies beyond code: anything an AI tool names as a real product, setting or file should be confirmed before it is relied on.
Worked example
A developer at Lagoon Logistics uses an AI assistant to write a script for reading shipping files.
- The assistant's draft includes an instruction to install a library the developer has not heard of.
- The developer searches the official package repository and finds the name is not the project's documented library.
- The team's internal mirror does not carry the package, so the install would fail anyway.
- The developer uses the well-documented library already on the approved list and reports the suggestion.
The invented package never reaches the firm's systems, and the report helps others spot the same suggestion.
In practice
Engineering teams use approved package lists or internal mirrors, scan new dependencies automatically and require review of every added library. Developers check each AI-suggested package against official documentation.
Watch out
- A package existing is not proof it is safe; a harmful one may have been registered under the invented name.
- This is a form of AI hallucination with security consequences, not only an accuracy problem.
Learn it properly
Official sources
- Top 10 for large language model applications · OWASP Foundation
- Guidelines for secure AI system development · National Cyber Security Centre
Facts last checked on 3 November 2026.
Education, not advice: the Stockertim Dictionary explains what terms mean. It never recommends buying or selling anything.