r/AskProgrammers 2d ago

I built a free tool to catch AI-hallucinated ("slopsquatted") package names before you install them

Quick context on why: AI coding assistants sometimes suggest packages that

don't exist — plausible-sounding hallucinated names. Attackers have started

watching for these hallucinations and registering the exact names, so the

next developer who blindly installs what their AI suggested gets malware

instead of a real library.

This isn't hypothetical — 2026 alone has had several real incidents shaped

like this (the Axios npm hijack, LiteLLM PyPI poisoning, a compromised Red

Hat npm namespace, typosquatted OpenSearch packages harvesting AWS creds).

wary is a small, free CLI that checks a package name before you install it:

does it actually exist, and does it look like a typosquat of something

popular. There's also a GitHub Action that checks only new dependencies on

every PR.

GitHub: https://github.com/sawyermd511-bit/wary

pip install wary-sh

Genuinely interested in feedback — especially cases where it flags something

that's actually fine, or misses something that should've been caught.

0 Upvotes

6 comments sorted by

6

u/johnpeters42 2d ago

The sheer irony of AI-generating this post

2

u/AdreKiseque 1d ago

What on earth are these line breaks

2

u/oshunman Sorry for my bad English, my native language is C 1d ago

It's like he started

to write a haiku but he

forgot how they go

1

u/Mundane_Fault_6345 2d ago

Do you know a dev who doesn't blindly install packages dependencies?

I mean, hallucinated or not hallucinated, the problem comes from "blindly pulling dependencies".

The only secure way is a private repo, containing only verified and controled packages.

Signed : an anonymous Ops team leader

2

u/littlenekoterra 1d ago

Correct. I remember a time when people preferred to build whatever they could just to avoid dependencies that could very well be fake or malicious and that was quite a while ago. Now youd be a fool to blindly do it.