A packages list grouped by fix next to a new dependency added in package.json

AppSec

AI security

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.

ThreatWhat catches it
Known CVE in a dependencyAdvisory matching across every repo, grouped by the fixing version
Malicious package versionMalware feeds plus a release-age delay before new versions install
Hallucinated package nameA check that every new dependency in a PR is real and established
Install-script payloadInstall scripts blocked by default, with an allowlist
Compromised maintainer accountCommitted lockfiles and a delay on brand-new releases

‍

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.

Ask the vendorWhy it matters
Which ecosystems and repos do you cover?Gaps hide in the languages nobody owns
How fast do new advisories show up?New CVEs land every day
Do you group findings by fix?One upgrade can clear many advisories
Do you detect malicious packages?Malicious versions usually have no CVE
Can findings go straight to a coding agent?Agents can make most upgrades in one pass

‍

How does Dam Secure fit?

PackagesGrouped by fix
PackageAdvisoriesUsed in
jsonwebtoken 8.5.1
Fix in 9.0.0
4 advisories
6 repos
lodash 4.17.20
Fix in 4.17.21
2 advisories
21 repos
minimist 1.2.5
Fix in 1.2.6
1 advisory
9 repos

‍

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.

GET STARTED WITH DAM SECURE

Your Security.
Enforced at AI Speed.

Attackers are already using Mythos-level models to find vulnerabilities. Join the teams putting frontier models on your side first.

Trusted by modern engineering teams

Dovetail logo
Pluss Communities logo with stylized purple and pink shapes between words.
Green rounded button with the word 'skip' and two forward arrows above the letter p.
Green rounded button with the word 'skip' and two forward arrows above the letter p.