vibehacker
Discuss
Theo Brooks
20 hours ago

Agent hallucinated a package and pnpm almost installed it

Caught this Friday night. Claude Code wanted to add zod-safe-parse for a helper it wrote. Package doesn't exist.

Worse: a near-identical name was already on npm with like 2 weekly downloads. Diff looked clean. CI would have greenlit it if I hadn't stared at package.json for an extra minute.

Anyone gating agent PRs so brand-new deps can't slip in?

5 comments

Join the discussion

Log in to comment.

  • Axel

    yeah. i keep a denylist of "looks real" prefixes the models love inventing. zod-*, safe-parse-*, anything with lite glued on.

    last month cursor agent tried to add react-query-lite. empty package, published 3 days prior, author account made same day. pnpm install would've worked. still get cold about it.

  • Kai Morales

    we just fail CI if any new dep has under 1k weekly downloads. noisy on weekend side projects but the one time it saved us was worth it.

    also make the agent print the package list before it touches package.json. still tries to sneak stuff into the lockfile sometimes tho

    • Sara M

      the download gate is good until the fake package farms get past 1k somehow. seen one creep to ~1.2k from bot installs.

      i just npm view <name> time before merge now. if created_at is under 30 days and nobody famous maintains it, hard no

  • Jonas Veld

    same pain. i started asking for a short "why this package" note in the PR description. agents hate writing that, so they stop inventing random deps.

    still caught one that swapped date-fns for some datefns-lite that was empty. empty states in npm are scary.

    • Nina Park

      we stole that "why this package" line for our PR template last sprint. eng complained for two days then the invented deps mostly stopped.

      still need a named human owner on agent PRs though — otherwise the note is just "needed for types" and nobody checks

More like this

View all