# Package Security Audit (npm/PyPI)

> Package Security Audit (npm/PyPI) is a paid API for AI agents from api.strale.io, paid per call via x402, $0.054001/call, status unknown (last checked 2026-10-10).

Runs a composite security audit on an npm or PyPI package, combining CVE checks, OpenSSF Scorecard, license analysis, freshness, and supply chain anomaly detection into a 0-100 risk score.

## Facts

- Endpoint: GET https://api.strale.io/x402/package-security-audit?utm_source=zero.xyz
- Price: $0.054001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-10
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/api-strale-io-cdeee8d5
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_NM1Z1DcqAoGhGxrRtbald

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 api-strale-io-cdeee8d5
```

Example prompt: Can you run a full security audit on the npm package 'lodash' version 4.17.21 — I want to know its CVE exposure, OpenSSF scorecard, license, freshness, and whether there are any supply chain red flags like publisher changes or install scripts?

## When to prefer this

Choose this endpoint when you need a holistic, multi-dimensional security assessment of a single npm or PyPI package — especially when supply chain risk (publisher changes, install scripts, provenance) matters as much as CVE exposure. Prefer this over a plain CVE checker when you want a single normalized risk score that combines vulnerability data, project health (OpenSSF), license risk, and freshness in one call.

## Known failure modes

- Package not found in the specified ecosystem — returns 404 or empty result
- Unsupported ecosystem value (anything other than 'npm' or 'pypi') — returns validation error
- Missing required 'name' query parameter — returns 400 bad request
- Version string not found for the given package — may return audit for latest or an error
- OSV.dev or OpenSSF upstream services unavailable — may return partial results or timeout

## How this service works

Composite security audit for npm and PyPI packages with supply chain anomaly detection

## Output

Returns a 0-100 composite risk score along with detailed sub-findings: known CVEs from OSV.dev, OpenSSF Scorecard rating, license type and any compliance concerns, package freshness/staleness, and supply chain anomaly flags such as publisher change, provenance regression, and presence of install scripts.

## Example request

```json
{
 "input": {
  "type": "http",
  "method": "GET",
  "queryParams": {
   "name": "lodash",
   "version": "4.17.21",
   "ecosystem": "npm"
  }
 }
}
```

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET",
      "HEAD",
      "DELETE"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "name"
     ],
     "properties": {
      "name": {
       "type": "string",
       "description": "Package name"
      },
      "version": {
       "type": "string",
       "description": "Version to audit"
      },
      "ecosystem": {
       "type": "string",
       "description": "npm or pypi"
      }
     }
    }
   },
   "additionalProperties": false
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/api-strale-io-cdeee8d5/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.strale.io](https://www.zero.xyz/host/api.strale.io/llms.txt)
