The agent's summary says "Done, tests pass." Then you open the diff and package.json has four new dependencies you have never heard of, one of them pulled in to pad a string.
AI coding agents are great at solving the problem in front of them, and npm install is often the fastest way to do that. Here's the short checklist I'd run before that PR merges, with the tool for each question.
Question 1: Is this package safe?
1. Socket
Socket scans packages for supply chain risk: malware, typosquats, install scripts and other risky behavior, not just known CVEs. Install the GitHub App and it comments on pull requests that add risky dependencies, which is exactly where agent-written PRs show up. The Free plan is $0 for solo devs and small teams; Team is $25 per dev seat a month.
2. OSV-Scanner
Google's OSV-Scanner checks your lockfile against the open OSV.dev vulnerability database. Run it locally after the agent finishes, or in CI so every agent branch gets the same check. It's free and open source, and it's on Homebrew (brew install osv-scanner).
Question 2: Why is this here at all?
3. npm explain
Already on your Mac if you have npm. npm explain <package> (alias npm why) prints the chain of dependencies that caused a package to be installed. If the agent's new dependency drags in a second copy of something you already had, this is where you see it.
4. Knip
Agents add packages, change approach halfway, and forget to remove the first attempt. Knip finds unused dependencies, exports and files in JavaScript and TypeScript projects, with 200+ plugins for tools like Next.js, Vite, Vitest and ESLint so it understands your setup. Free and open source.
Question 3: What does it cost the user?
5. Bundlephobia
For frontend code, paste the package name and Bundlephobia shows the cost of adding it to your bundle. You can also scan a whole package.json. It runs in the browser and is free.
Question 4: Can I afford to have the agent redo it?
6. TokenBar
"Rip that dependency out and write it by hand" is a fair ask, but it costs a chunk of your limit. TokenBar is a Mac menu bar app that shows usage and reset times for Claude, Codex, Cursor, Gemini and Copilot, so you know whether to ask now or after the reset. It's $5 a month for Basic or $15 once for Pro lifetime, needs macOS 14 or later, and gives you no extra quota. It's built on Peter Steinberger's open source (MIT) CodexBar and credits Pixel Agents.
(Disclosure: TokenBar is made by the team behind this account.)
Question 5: Who keeps it updated?
7. Renovate
Every package the agent adds is one you now maintain. Renovate opens pull requests to update dependencies and lockfiles on a schedule you choose, finds package files automatically (monorepos included), and can propose replacements for deprecated packages. Open source under AGPL-3.0, and it works on GitHub, GitLab, Bitbucket and more.
The 60-second version
| Question | Tool | Cost |
|---|---|---|
| Is it malicious or risky? | Socket | Free plan, Team $25/seat/mo |
| Known vulnerabilities? | OSV-Scanner | Free, open source |
| Why is it installed? | npm explain | Built into npm |
| Is anything now unused? | Knip | Free, open source |
| How big is it? | Bundlephobia | Free |
| Room to redo it? | TokenBar | $5/mo or $15 once |
| Who updates it? | Renovate | Free, open source |
Do you let your coding agent run npm install on its own, or does it have to ask first?

![Legged Robot Mechanics and Dynamics — Ch.07: Energy Management [KR]](https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F0orytkfqpv0aqm7xevhr.png)
![Legged Robot Mechanics and Dynamics — Ch.08: Mechanical Design [KR]](https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fyj7esd590kzopbgd8m10.png)
