Coding with AI tools

Stage 8 · Lesson 2 of 6

Hallucinated packages and new dependencies

Security and licences

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

Practise

Keep handy

  • Scan your repository and its history for leaked keys before you push

  • What common open source licences require, in plain language

Also worth your time

Mark this stage as not done?