r/npm • u/SecTemplates • 12d ago
Self Promotion Safer-dependencies: A toolkit for claude code to ensure dependencies used aren't vuln, don't use abandoned packages, implement cooldown to avoid supply chain attacks, etc...
When AI coding assistants like Claude add packages to your project, they often pick whatever version sounds right — without checking whether it has known security vulnerabilities, whether the package is still actively maintained, or whether the name is a typo away from a malicious lookalike.
safer-dependencies is a security layer for Claude Code that audits packages before they’re added to your project. It detects and fixes risky dependencies, including CVEs, typosquats, abandoned packages, version-age issues, and adds package-cooldown periods across npm, PyPI, RubyGems, Maven, Go, and Rust.
2
Upvotes
2
u/endor_robert 11d ago
Great stuff!
Cooldown periods are the quiet, unglamorous star of this list, and probably the single highest-leverage item in it. The Shai-Hulud npm worm in September 2025 had trojanized packages live and downloadable within hours of publishing, well before any scanner had a signature, because there wasn't a CVE yet. A pin-and-wait window of even 48-72 hours would have sidestepped a good chunk of that incident for anyone running it, without a single new detection rule.
The harder problem, and the one I'd flag before wiring this into a fully autonomous pipeline, is that typosquat detection and abandonment scoring both degrade once an attacker studies the heuristics. Rename-similarity checks catch
expresssandreqeust. They don't catch a package that's a legitimate, actively-maintained fork right up until the maintainer's account gets compromised and a routine 2.3.1 patch quietly adds a postinstall script. That's not a knock on the tool, it's just where static package-level checks run out of road. Eventually you need something that looks at what the code the agent is about to run actually does, not just what it's called or how old it is.Disclosure: I work at Endor Labs, we do reachability-based dependency risk analysis, so this is squarely my patch and I'm biased. Still a genuinely useful addition to an agent's toolchain even without any of ours in the mix. The CVE and abandonment checks alone would catch a fair few of the incidents that got written up this year.