TL;DR: AI coding agents accelerate dependency intake, and Dam Secure shows that hallucinated package names, malicious versions and namespace attacks create gaps that CVE-only scanning will miss. Dependency controls now need to validate whether a package should exist before teams trust advisory matching.
Editorial analysis by NHI Mgmt Group, based on content published by Dam Secure: “How to choose dependency security software for AI-written code”.
By the numbers:
- In a USENIX Security 2025 study, 19.7% of the packages recommended by 16 code-generating models were hallucinated, with 205,474 unique fake names.
- Researchers found that 43% of hallucinated package names came back in all 10 runs.
- Phoenix Security counted 37 npm supply chain campaigns hitting 497 packages in the first half of 2026.
Key questions
Q: Why do malicious packages create more risk than CVE-based scanning usually captures?
A: Malicious packages often have no known CVE because the danger comes from intent, tampering, or suspicious activity rather than a published vulnerability.
Q: What is the difference between dependency confusion and slopsquatting?
A: Dependency confusion is an attack on package resolution, where an internal package name is registered in a public repository so build tools pull the attacker’s package instead of the private one.
Q: How do you stop hallucinated packages from entering software builds?
A: Treat package reality as a gate, not an assumption.
Practitioner guidance
- Validate every new dependency name before install Check that the package exists, has a plausible history and matches the dependency you intended before allowing a PR or agent to introduce it.
- Separate malicious package detection from CVE scanning Use controls that can flag hostile releases even when no vulnerability advisory exists, especially for fresh versions and suspicious namespaces.
- Block install scripts by default Prevent packages from executing install-time payloads unless they are explicitly allowlisted, and keep the allowlist narrow.
Bottom line: AI-written code changes dependency risk by creating a faster path for fake, malicious or unreviewed packages to enter builds.
Glossary terms: Slopsquatting, Hallucinated Package Name, Malicious Package, Dependency Confusion
Explore further
View Full Forum → | NHI Foundation Course → | Our Services → | Read the full analysis →