Check npm dependencies before an AI agent installs them: vulnerable and malicious package API (PkgGuard)

Updated 2026-10-21

Disclosure: PkgGuard is built and operated by the youraitools.co team, and payments go to our own wallet. It is listed on our Built by us page and kept out of the directory rankings.

PkgGuard tells your agent whether the packages it is about to install have known vulnerabilities or are confirmed malware. Send a package.json, a lockfile, requirements.txt, go.mod, Cargo.lock or composer.lock, or one package name and version. You get every known advisory (CVE/GHSA/MAL ids, severity, CVSS score, fixed-in version) from Google's OSV.dev database. A whole-manifest scan (up to 500 packages) costs $0.003 USDC and one package costs $0.001, paid in USDC on Base, Polygon, Arbitrum One or Solana over x402, with no API key or signup.

Informational, not a security guarantee. It finds only known, published advisories. See "Limits" below.

When to use it

  • Before a coding agent runs npm install, pip install or cargo add on a package it picked itself.
  • Before an agent runs a repo or script it just cloned: scan its lockfile first.
  • As a cheap check in CI or a pre-commit hook for agent-written changes.

What it checks

  • Manifests: package.json, package-lock.json (v1-v3), requirements.txt, Pipfile.lock, poetry.lock, go.mod, Cargo.lock and composer.lock.
  • Ecosystems: npm, PyPI, Go, crates.io, Packagist, RubyGems, Maven, NuGet, Pub and Hex (the last ones via a packages list), per /v1/ecosystems on 2026-10-21.
  • Data: OSV.dev (CC-BY 4.0), which aggregates GitHub Security Advisories, PyPA, the Go and RustSec databases, OpenSSF malicious-packages and more. It's queried live, and advisory details are cached for up to 6 hours.

Routes

Route Price Returns
POST /v1/scan with {"manifest": "<file text>", "filename": "package-lock.json"}, {"packages": [...]} or the raw file $0.003 USDC verdict (clean, vulnerable or malicious), counts, packages[] with advisories (id, severity, CVSS, summary, aliases, fixed-in, URL), unpinned[]
GET /v1/package?ecosystem=npm&name=lodash&version=4.17.15 (or POST JSON) $0.001 USDC the same, for one package
/v1/preview (GET or POST) free, 10/min per IP verdict and counts only, no advisory details
POST /mcp (tools scan_dependencies, check_package) free, preview tier preview-tier result as text
/v1/ecosystems, /openapi.json, /.well-known/x402 free formats and specs

Invalid input gets HTTP 400 before any payment is asked for (on 2026-10-21 an empty packages list returned 400, not 402). Per the service, failed calls such as upstream outages (503) aren't charged: credits are refunded automatically, and x402 settles only after a successful response.

Try it free

# lodash 4.17.15 -> "verdict": "vulnerable", 6 advisories
curl -s "https://api.youraitools.co/pkgguard/v1/preview?ecosystem=npm&name=lodash&version=4.17.15"
# flatmap-stream 0.1.1 (the 2018 event-stream attack) -> "verdict": "malicious"
curl -s "https://api.youraitools.co/pkgguard/v1/preview?ecosystem=npm&name=flatmap-stream&version=0.1.1"

We ran both on 2026-10-21 and got vulnerable (6 advisories) and malicious (3 advisories). A direct OSV.dev query matches: lodash 4.17.15 includes GHSA-35jh-r3h4-6jhm (CVE-2021-23337, HIGH, fixed in 4.17.21), and flatmap-stream 0.1.1 includes MAL-2025-20690.

Whole manifest, free preview:

curl -s -X POST https://api.youraitools.co/pkgguard/v1/preview \
  -H 'Content-Type: application/json' \
  -d '{"manifest":"{\"dependencies\":{\"lodash\":\"4.17.15\",\"express\":\"^4.17.1\"}}","filename":"package.json"}'

Remote MCP (preview tier):

{ "mcpServers": { "pkgguard": { "type": "http", "url": "https://api.youraitools.co/pkgguard/mcp" } } }

On 2026-10-21 tools/list returned scan_dependencies and check_package.

The x402 payment, verified

An unpaid POST /v1/scan returns HTTP 402 with a PAYMENT-REQUIRED header. Decoded on 2026-10-21:

  • x402 version 2, scheme exact
  • networks eip155:8453 (Base), eip155:137 (Polygon), eip155:42161 (Arbitrum One) and Solana mainnet, at the same amount (rechecked 2026-10-23)
  • amount 3000 (0.003 USDC; GET /v1/package asks for 1000, 0.001 USDC)
  • asset 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913 (native USDC on Base; native USDC on each of the other networks too)
  • payTo 0x3c1A1E01e790Cd326495631B3b38Bd7068F08d6F on the EVM networks and FH73WbbUe2UyNzfy72MJs5nT3NxyDf9GrqE7kzjL2Jte on Solana (our wallets)
  • The x402 payment settles on-chain. x402 v1 (X-PAYMENT) clients also work, on Base only.

Pay from code

// npm i @x402/fetch @x402/evm viem
import { readFileSync } from 'node:fs';
import { wrapFetchWithPaymentFromConfig } from '@x402/fetch';
import { ExactEvmScheme } from '@x402/evm';
import { privateKeyToAccount } from 'viem/accounts';

const pay = wrapFetchWithPaymentFromConfig(fetch, {
  schemes: [{ network: 'eip155:8453', client: new ExactEvmScheme(privateKeyToAccount(process.env.BUYER_KEY)) }],
});

const res = await pay('https://api.youraitools.co/pkgguard/v1/scan', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({ manifest: readFileSync('package-lock.json', 'utf8'), filename: 'package-lock.json' }),
});
const r = await res.json();
if (r.verdict !== 'clean') console.log(r.verdict, r.highest_severity, r.vulnerable_count, r.malicious_count);

Response fields

verdict, package_count, scanned_count, vulnerable_count, malicious_count, advisory_count, highest_severity, by_severity{}, packages[] (ecosystem, name, version, version_source, malicious, highest_severity, vuln_count, vulns[] with id, severity, cvss_score, summary, aliases[], fixed_in[], url), unpinned[], range_note, details_truncated, source, scanned_at and disclaimer.

Limits, stated honestly

  • Only known, published advisories are found. There's no zero-day detection and no code analysis, so a clean result does not prove a package is safe.
  • Version ranges (like ^4.17.1) are checked at their lowest version and flagged in range_note. Pin versions or send a lockfile for exact results. Specs that can't be resolved are listed as unpinned.
  • At most 500 packages per scan. Advisory details are returned for the first 40 hits (details_truncated).
  • Informational, not a security guarantee or an audit.
  • Privacy, per the service: manifests are parsed in memory, only (ecosystem, name, version) tuples are sent to OSV.dev, and nothing is stored.

FAQ

Who runs it? The youraitools.co team. Payments go to our own wallet. See the disclosure at the top.

Do I need an API key? No. Use the free preview or MCP, or pay per call with any x402 client on Base, Polygon, Arbitrum One or Solana. New to that? See how to pay for an API with USDC via x402.

Can I self-host it? Yes. The source code is MIT.

Related tools: AgentGate verifies who an agent is, WebRead reads a page, InjectScan checks it's safe to follow, DomainCheck checks the domain or email behind it, and PayGuard screens the wallet before paying.

Want the same x402 paywall and MCP server on your own API? We x402-enable your API in 48 hours →

New to x402, the HTTP 402 payment standard these APIs use? Read what x402 is and how agents pay per call.

Liked this guide? Get new crypto-payable AI tools weekly

One short email a week with the x402 and pay-per-call tools we added and re-verified. No spam, unsubscribe any time.

Run an AI tool, API or agent that accepts crypto?

List it on YourAITools for free. Want it live sooner or pinned in its category? Fast-track review is $19, Featured for 30 days is $29 and the Launch bundle is $49, paid in USDC on Base, Polygon, Arbitrum One or Solana with one x402 payment. Every listing gets the same review, and paid placements are always labeled.

Paid checkout: api.youraitools.co/listing. Payment doesn’t guarantee approval; rejected submissions are refunded in USDC.

Keep exploring

Guides