
How to choose dependency security software for AI-written code
Summary
Good dependency security software for AI-written code covers every repo and ecosystem, matches new advisories fast, groups findings by the upgrade that fixes them, flags malicious packages as well as CVEs, and can hand fixes straight to a coding agent.
AI coding agents raise the stakes because models hallucinate package names attackers can register, and 2026's npm attacks relied on malicious versions that CVE matching alone won't flag.
How does AI-written code change dependency risk?
Coding agents add packages the way they write code: quickly, and without asking anyone. That speeds up shipping, and it also widens the paths for a bad package to get in.
1. Models invent packages that don't exist
A USENIX Security 2025 study tested 16 code-generating models and found 19.7% of the packages they recommended were hallucinated, with 205,474 unique fake names. The hallucinations repeat, too. When researchers reran prompts, 43% of hallucinated names came back in all 10 runs.
That makes them predictable. An attacker can register a name a model keeps suggesting and wait for an agent to install it, an attack known as slopsquatting.
2. npm attacks hit a new pace in 2026
Phoenix Security counted 37 npm supply chain campaigns hitting 497 packages in the first half of 2026, against 14 campaigns in all of 2025. In June, one attack compromised at least 32 packages under a single trusted namespace, and Unit 42 tracked the first malicious npm packages carrying valid SLSA provenance.
3. Malicious versions usually have no CVE
A malicious package version isn't a known vulnerability, so CVE matching alone won't flag it. Teams need controls for both: known flaws in real packages, and bad packages that should never have been installed.
What should dependency security software do?
1. Cover every repo and ecosystem
Security gaps hide in the service nobody owns and the language only one team uses. You need every package, across every repo, in one view.
2. Match new advisories fast
New CVEs land every day. The tool should check your packages against new advisories as they're published, so you aren't the last to know.
3. Group findings by fix
One upgrade often clears several advisories at once. A list of 300 advisories is overwhelming. A list of 20 upgrades is a plan.
4. Flag malicious packages, as well as CVEs
Ask how the tool handles malicious package versions and brand-new releases. That's where 2026's npm attacks did their damage.
5. Hand fixes to developers or agents
The fastest upgrade is the one a coding agent makes for you. Look for findings that can go straight to an agent with the target version attached.
Which controls should you add alongside a tool?
Some of the strongest protection is free. Since July, npm 12 blocks dependency install scripts by default, with an allowlist committed to package.json. npm was the last major package manager to make that change, so pnpm, Yarn Berry and Bun users already have it.
- Commit lockfiles and install from them in CI.
- Add a release-age delay, so brand-new versions wait a few days before they can install.
- Review new dependencies in PRs. Check the package exists, has a history and is the one you meant.
- Freeze the packages your agents launch, too. MCP servers launched with npx can pull a different dependency set on every start.
How should AppSec leaders choose a dependency security tool?
Run a two-week trial on your real repos and ask each vendor the same questions.
How does Dam Secure fit?
Dam Secure Dependency Security checks every open source package across your repos against known advisories, with turnkey support for 10 ecosystems. Findings are grouped by package and the version that fixes them, so upgrading one package clears every advisory it carries.
Your team can triage by package or send a finding straight to a coding agent to make the upgrade.
FAQ
What is slopsquatting?
Slopsquatting is when an attacker registers a package name that AI models hallucinate, then waits for a developer or coding agent to install it. Because models repeat the same fake names, the attack is predictable.
Do SCA tools catch malicious packages?
Not always. SCA tools match your packages against known vulnerability advisories. A malicious package version usually has no CVE, so it needs malware detection or install-time controls.
Does npm still run install scripts by default?
No. Since npm 12 shipped in July 2026, dependency install scripts are blocked unless you allow them in package.json.
How do I prioritize dependency vulnerabilities across many repos?
Group them by the upgrade that fixes them, then start with the upgrades that clear the most serious advisories across the most repos.
Want to see it on your own PRs? Speak to our team.
.webp)


.webp)