# NPM Package Risk Scanner

> NPM Package Risk Scanner is a paid API for AI agents from x402-deployer.x402-deployer.workers.dev, paid per call via x402, $0.030000/call, status unknown (last checked 2026-09-14).

Analyzes an npm package for supply-chain risk, including maintainer count, download stats, install scripts, dependency depth, deprecation, age, typosquat detection, and an LLM-generated risk summary.

## Facts

- Endpoint: POST https://x402-deployer.x402-deployer.workers.dev/package-risk-npm
- Price: $0.030000/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/x402-deployer-x402-deployer-workers-dev-62d7c60a
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_IfdIJrjV3F19f_fZmD6hX

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability x402-deployer-x402-deployer-workers-dev-62d7c60a -d '<json body>'
```

Example prompt: Can you scan the npm package 'colo' and tell me if it looks like a typosquat of 'colors', how risky it is, and whether it has any suspicious install scripts or sketchy maintainer details?

## When to prefer this

Use this endpoint when an AI agent needs to evaluate whether an npm package is trustworthy before recommending or installing it — especially for unfamiliar, newly published, or suspiciously named packages. Ideal for automated dependency auditing workflows, CI/CD security gates, or any scenario where you want a combined heuristic + LLM risk assessment rather than just raw registry metadata.

## Known failure modes

- Package name not found on npm registry — returns 404 or error indicating unknown package
- Network timeout fetching npm registry data — returns 5xx error
- Malformed or empty package name input — returns validation error
- LLM summary generation failure — may return partial data without the risk narrative
- Rate limiting or payment failure — request rejected with payment-required error

## How this service works

npm package risk score / supply-chain scanner / typosquat detector. Maintainer count, weekly downloads, install scripts, dependency depth, deprecation, age, typosquat distance to popular packages. Plus LLM risk summary.

## Output

Returns a structured risk profile including a numeric risk score, maintainer count, weekly download figures, presence of pre/post-install scripts, dependency depth, deprecation flag, package age, typosquat Levenshtein distance to popular packages, and an LLM-generated plain-English risk summary explaining the key concerns.

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/x402-deployer-x402-deployer-workers-dev-62d7c60a/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from x402-deployer.x402-deployer.workers.dev](https://www.zero.xyz/host/x402-deployer.x402-deployer.workers.dev/llms.txt)
