Hallucinated packages

    What are hallucinated packages?

    SHORT ANSWER

    Hallucinated packages are software add-ons that an AI tool suggests but that do not exist. Attackers watch for these invented names and publish real packages under them, filled with malicious code. The next person who installs what the AI recommended pulls the attacker's code into their app. This is sometimes called slopsquatting.

    Also called: Slopsquatting

    ON THIS PAGE

    What it means

    AI models sometimes make up plausible-sounding package names, the way they sometimes make up facts. The same invented names tend to come up again and again.

    Installing a package runs its code on your machine and ends up inside your app, so a malicious one can steal keys or data.

    Why it matters for vibe-coded apps

    Running the install command the AI gave you feels routine, and it takes seconds.

    IF THIS IS WRONG IN YOUR APP
    • Your secret keys and environment files can be stolen during install.
    • Malicious code ships to your users inside your app.
    • The package may look normal because the AI named it confidently.

    Example

    The AI tells you to install a helper package.

    ✕ RISKYInstalled straight away, never checked
    npm install some-package-the-ai-made-up
    ✓ SAFERLooked up first
    npm view express-rate-limit
    # Check: who publishes it, how many weekly downloads, how old it is,
    # and whether it links to a real code repository

    A very new package with few downloads and a name matching exactly what the AI said is a warning sign.

    How to check if your app has this problem

    1. 1Look at the dependencies in package.json or requirements.txt and find any name you do not recognise.
    2. 2Search each one on npmjs.com or pypi.org. Check its age, downloads and repository link.
    3. 3Run a full check, which looks at your packages for known problems.

    The quicker way: LetMeCheck tests for this automatically, from the outside, the way an attacker would.

    Run a free scan →

    How to fix it

    1. 1Remove any package you cannot account for, and rotate any keys that were on a machine where it was installed.
    2. 2Before installing a new package, look it up and confirm it is real and widely used.
    3. 3Commit your lock file so the exact versions are fixed.
    4. 4Prefer a well-known package, or a few lines of your own code, to an obscure one.
    FIX PROMPT · PASTE INTO YOUR AI TOOL

    List every dependency in my project's package.json (or requirements.txt) with its version. For each one, tell me whether it is a well-known, widely used package, and flag any that look unfamiliar, very new, or have a name that looks like a typo of a popular package. Don't install or remove anything.

    Check if your app has this problem

    Paste your website and we'll check for hallucinated packages issues and other common issues in AI-built apps. Free, about a minute, and nothing on your site is changed.

    Last updated