AyoubTadlaoui/npmguard
GitHub: AyoubTadlaoui/npmguard
npmguard 是一款以单一 Rust 二进制形式在 npm install 前拦截恶意包和 typosquat 仿冒包的供应链安全工具,支持通过 MCP 和 CLI 保护 AI 编程助手。
Stars: 2 | Forks: 0
# npmguard
**我开发这个工具是因为,如今太多凭感觉写代码的开发者直接让 AI 处于自动模式,随便它想装什么就装什么。npmguard 会在任何 install 脚本运行之前对它们进行筛查。**
Claude Code、Cursor 和 Codex 会自动运行 `npm install`。没人会停下来问一句:“等等,`supabase-mcp-helper` 这玩意到底存不存在?”我开发了 npmguard,它作为一个 MCP server 和 CLI,会对每个包进行评分(基于 OSV 恶意软件数据、typosquat/slopsquat 检测、install-script 分析),并在生命周期脚本触发前返回判定结果。
它以单个 Rust 二进制文件的形式发布,完全位于 npm *之外*。这很重要:守门员不能被它所守护的供应链下毒。
[](https://github.com/AyoubTadlaoui/npmguard/actions/workflows/ci.yml)
[](https://github.com/AyoubTadlaoui/npmguard/actions/workflows/release.yml)
[](https://github.com/AyoubTadlaoui/npmguard/releases/latest)
[](LICENSE)
[](https://codecov.io/gh/AyoubTadlaoui/npmguard)

`npmguard install lodahs` 是一个针对 `lodash` 的真实 typosquat 包,在生命周期脚本运行之前就被拒绝了: