Stage 8 · Lesson 2 of 6
Hallucinated packages and new dependencies
Models sometimes suggest packages that do not exist. Attackers watch for names models invent repeatedly and publish malicious packages under them, an attack called . One npm install or pip install of such a package runs a stranger's code on your machine.
So check every new before installing it: does it exist on the official registry, does it link to a real , is it maintained with recent releases, is it widely used, and do you need it at all, since AI often adds a package for something the standard library already does. Run npm audit or pip-audit for known vulnerabilities.
Common trapletting an agent in an mode install packages it chose itself.
A question to check yourself, an AI practice session and 2 cheat sheet entries come when you add the roadmap to your account. Add it
Resources for this stage
Start with· follow one of these
- GuideFreeSecurity-Focused Guide for AI Code Assistant Instructions
OpenSSF · Intermediate
Free guidance from OpenSSF on writing security instructions for AI coding tools
- GuideFreeOWASP Top Ten
OWASP · Intermediate
The most common web security risks, which AI-generated code repeats