# Package Install-Safety Preflight Check

> Package Install-Safety Preflight Check is a paid API for AI agents from api.agentstools.dev, paid per call via x402, $0.03/call, status unknown (last checked 2026-10-11).

Runs a pre-install safety check on an npm or PyPI package, returning a verdict (safe/caution/block) based on OSV malware flags, typosquat detection, hallucination corpus matching, and freshness metadata.

## Facts

- Endpoint: GET https://api.agentstools.dev/pkg/preflight?utm_source=zero.xyz
- Price: $0.03/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-11
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/package-install-safety-preflight-check-158dcbb9
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_yZhh1nVj8i3uBTVWo3LGk

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 package-install-safety-preflight-check-158dcbb9
```

Example prompt: Before I run pip install langchain-openai, can you do a preflight safety check on that PyPI package — tell me if it's safe, a possible typosquat, flagged for malware, or just a hallucinated name?

## When to prefer this

Use this endpoint when an AI agent is about to suggest or execute a `pip install` or `npm install` command and needs a fast supply-chain safety gate before proceeding. Ideal for agentic coding workflows where hallucinated package names or typosquatted dependencies are a real risk. Prefer this over a generic vulnerability scanner when you need a single-call preflight that fuses existence, malware, typosquat, and hallucination signals in one verdict.

## Known failure modes

- Unknown or unsupported ecosystem name — ecosystem must be 'npm' or 'pypi'
- Package name missing from query — 400-level error returned
- Registry lookup timeout causing incomplete verdict
- OSV database temporarily unavailable, resulting in partial signal
- Very new package with no metadata may return low-confidence freshness result

## How this service works

Install-safety preflight for one dependency BEFORE pip install / npm i. Returns a safe / caution / block verdict fusing existence, OSV malware flags, typosquat distance to a popular package, a known-hallucination corpus, and freshness metadata. Supply-chain indicators, not a guarantee.

## Output

A JSON object containing a verdict field (safe, caution, or block), OSV malware flag status, typosquat distance score relative to popular packages, whether the package name appears in a known AI-hallucinated package corpus, freshness/existence metadata, and a note that these are supply-chain indicators rather than guarantees.

## 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": [
      "ecosystem",
      "name"
     ],
     "properties": {
      "name": {
       "type": "string",
       "description": "Package name to screen"
      },
      "ecosystem": {
       "enum": [
        "npm",
        "pypi"
       ],
       "type": "string",
       "description": "Package ecosystem (aliases: pip/python, node)"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/package-install-safety-preflight-check-158dcbb9/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.agentstools.dev](https://www.zero.xyz/host/api.agentstools.dev/llms.txt)
