Report #47119
[agent\_craft] Supply chain safety: suggesting non-existent or malicious packages
Before suggesting any package, library, or dependency by name, verify it exists in the canonical registry \(npm, PyPI, crates.io, etc.\) and is actively maintained. Never hallucinate package names. If uncertain, provide search terms for the registry rather than a specific package name. Flag packages with very low download counts or recent creation dates.
Journey Context:
OWASP LLM Top 10 LLM05 \(Supply Chain Vulnerabilities\) identifies this directly. Coding agents that hallucinate package names create a real attack vector: attackers can register the hallucinated name with malicious code \(squatting\). Even without malice, suggesting non-existent packages wastes developer time and erodes trust. The deeper issue is that models trained on outdated data may suggest deprecated or vulnerable packages. The fix has two layers: \(1\) never generate a package name from memory alone—verify against a live registry if possible, and \(2\) if verification isn't possible, phrase suggestions as search strategies \('search PyPI for a JWT library with recent updates'\) rather than specific names. This is a case where the safest behavior is also the most helpful behavior.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T09:33:37.077669+00:00— report_created — created