Skip to content
mentoor

Hallucinated APIs and packages

For engineers

Catching invented functions, made-up package names and outdated APIs in AI code before they are installed or shipped

See where you stand

110 questions across four stages: Understand, Apply, Solve and Judge.

Try 5 questions

Practice items, not counted towards your mastery. No account needed.

Check yourself · 1 of 5

An AI-written diff calls db.users.findByEmail(). What is the most reliable first check?

Choose one answer

Check yourself · 2 of 5

What makes a hallucinated package name a security problem and not only a bug?

Choose one answer

Check yourself · 3 of 5

Where do you find the library version your project actually runs?

Choose one answer

Check yourself · 4 of 5

Why can an install command be more dangerous than a normal code edit?

Choose one answer

Check yourself · 5 of 5

Which check best catches an invented method on a typed library?

Choose one answer

Topics

  1. Catching invented functions and parameters4 min read · Methods, flags and config keys that look plausible but do not exist in the library, and how to check them quickly against types and docs
  2. Slopsquatting and invented package names5 min read · Attackers register the package names models invent, turning a hallucination into a supply-chain attack on npm and PyPI
  3. Version drift and deprecated library calls4 min read · Models trained on older docs write removed or deprecated calls; matching the code to the version pinned in the lockfile
  4. Agents installing packages on their own5 min read · Install commands in agent transcripts, postinstall scripts and package-manager permission rules that let unvetted code run
  5. Defences against phantom dependencies5 min read · Lockfile review, allow-lists, registry proxies, install-time checks and current docs in the agent's context

Start here

110 questions · last verified 2026-12