depguard_guard
Verify npm packages before npm/yarn/pnpm install to block hallucinated names, typosquatting, and security risks, returning allow, warn, or block.
Instructions
MANDATORY: call this BEFORE running npm install, yarn add, or pnpm add — whether the user asked for the package or you decided to install it yourself. Verifies the package exists (blocks hallucinated names), checks for typosquatting, runs security audit, and returns allow/warn/block. If the result is "block" or "warn", do NOT install the package without informing the user.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | npm package name to check before installing, optionally with the version to install (e.g. "express" or "express@4.18.2") | |
| threshold | No | Score threshold for allow decision (default: 60) | |
| targetLicense | No | Project license for compatibility check (default: MIT) |