# Slopsquatting

> Bad code put out under names that AI tools make up.

**Field:** Artificial Intelligence  
**Category:** Safety & Security  
**Also known as:** Package Hallucination Attack, AI Package Hallucination, Hallucinated Package

## Think of it like

It is like a friend who makes up a shop name. A crook opens a shop with that name and waits.

## Definition

Slopsquatting is an attack that uses software packages an AI made up. AI coding tools sometimes suggest a package name that does not exist. Attackers watch for those names and publish real packages under them, filled with harmful code. The next coder who trusts the AI and installs it gets the attacker's code. The name comes from typosquatting, which uses common typing slips. The defence is to check that a package is real and well used before you install it.

## Example

An AI helper tells Emma to install a package with a believable name. It did not exist last month. An attacker has since published it, with code that steals passwords.

## Why it matters

AI tools repeat the same made-up names, so attackers can guess which ones to claim.

## Common mistake

Installing whatever the AI names. Look the package up first: who made it, how old it is and how many people use it.

## Three principles

- **Made-up names.** The AI invents a package.
- **Attackers claim them.** They publish under that name.
- **Check before install.** Is it real, old and widely used?

## Related terms

- [Hallucination (AI)](https://learn.benibix.com/term/ai/hallucination)
- [AI Coding Assistant](https://learn.benibix.com/term/ai/ai-coding-assistant)
- [Tool Poisoning](https://learn.benibix.com/term/ai/tool-poisoning)
- [Supply Chain Attack](https://learn.benibix.com/term/development/supply-chain-attack)
- [Dependency Scanning](https://learn.benibix.com/term/development/dependency-scanning)

![An AI agent in the middle. From the left, two ways in: the tool list, where tool poisoning hides, and a package to install, where slopsquatting waits. On the right, the agent's powers, such as files, money and email; more powers than needed is excessive agency.](https://learn.benibix.com/diagrams/ai4-agent-attacks.svg)

---

Source: https://learn.benibix.com/term/ai/slopsquatting
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-18
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
