# x402 Payment Guard Preflight Evaluator

> x402 Payment Guard Preflight Evaluator is a paid API for AI agents from base-agent-preflight.bytoken2023.workers.dev, paid per call via x402, $0.100004/call, status unknown (last checked 2026-10-10).

Evaluates an x402 payment URL before autonomous spending — enforcing budgets, scoring merchant/domain risk, detecting replay, and requiring human approval when needed.

## Facts

- Endpoint: GET https://base-agent-preflight.bytoken2023.workers.dev/v1/x402/payment-guard/evaluate?utm_source=zero.xyz
- Price: $0.100004/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-10
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/x402-payment-guard-preflight-evaluator-b7b79b72
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_S_YNudAJwgMTdYAHNznma

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-payment-guard-preflight-evaluator-b7b79b72
```

Example prompt: Before paying, run a preflight check on https://api.example.com/report.pdf — use session ID 'sess-abc123' and request ID 'req-001', cap any single payment at 0.50 USDC and the daily budget at 5.00 USDC, and block payments to 0xDeAdBeEf0000000000000000000000000000dEaD.

## When to prefer this

Use this endpoint whenever an AI agent is about to autonomously execute an x402 USDC payment and you need to enforce budget caps, block/allow specific recipients, detect replay attacks, score merchant risk, or gate spending on human approval — especially on Base/EVM chains. Prefer this over direct payment execution when operating in autonomous or semi-autonomous agentic workflows where financial guardrails are required.

## Known failure modes

- Missing required query params (url, session_id, request_id) returns 400 validation error
- Budget already exhausted for session returns block decision
- Recipient address on blocklist returns block decision with reason
- Domain risk score too high triggers hold/human-approval decision
- Replayed request_id within session returns replay-detected error
- Invalid URL format or non-https URL rejected by schema validation
- x402 resource unreachable or returns non-402 response causes evaluation failure

## How this service works

Machine-payable service intelligence for discovering, verifying, and monitoring identity, risk, authorization, execution-preflight, and evidence APIs before autonomous agents spend.

## Output

Returns a structured decision object containing: a pay/block/hold decision, a risk score for the merchant and domain, payment details parsed from the x402 resource, budget reservation status, policy compliance results, and human-readable reasons explaining the outcome.

## 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"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "url",
      "session_id",
      "request_id"
     ],
     "properties": {
      "to": {
       "type": "string",
       "pattern": "^0x[a-fA-F0-9]{40}$",
       "description": "Optional transaction destination for intent decoding."
      },
      "url": {
       "type": "string",
       "pattern": "^https?://",
       "maxLength": 2048,
       "description": "Public x402 resource URL to evaluate before payment."
      },
      "data": {
       "type": "string",
       "pattern": "^0x(?:[a-fA-F0-9]{2})*$",
       "maxLength": 8194,
       "description": "Optional EVM calldata."
      },
      "value": {
       "type": "string",
       "pattern": "^[0-9]+$",
       "description": "Optional native ETH value in wei."
      },
      "request_id": {
       "type": "string",
       "pattern": "^[A-Za-z0-9._:-]{1,128}$",
       "description": "Caller-defined idempotency key."
      },
      "session_id": {
       "type": "string",
       "pattern": "^[A-Za-z0-9._:-]{1,96}$",
       "description": "Caller-defined budget and audit scope."
      },
      "allow_pay_to": {
       "type": "string",
       "maxLength": 2048,
       "description": "Optional comma-separated recipient allowlist."
      },
      "block_pay_to": {
       "type": "string",
       "maxLength": 2048,
       "description": "Optional comma-separated recipient blocklist."
      },
      "max_single_usdc": {
       "type": "string",
       "pattern": "^[0-9]+(?:\\.[0-9]{1,6})?$",
       "description": "Maximum allowed price for one payment."
      },
      "daily_budget_usdc": {
       "type": "string",
       "pattern": "^[0-9]+(?:\\.[0-9]{1,6})?$",
       "description": "Maximum reserved spend for this session in one UTC day."
      },
      "session_budget_usdc": {
       "type": "string",
       "pattern": "^[0-9]+(?:\\.[0-9]{1,6})?$",
       "description": "Maximum reserved spend for this session."
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type"
… (truncated)
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "policy": {
   "human_approval": true,
   "budget_enforced": true,
   "mandate_enforced": true,
   "replay_protection": true
  },
  "payment": {
   "pay_to": "0x94F751f04b98507D31b500b7Ed50bE68A1514873",
   "network": "eip155:8453",
   "amount_usdc": "0.01"
  },
  "product": "agent-payment-guard",
  "reasons": [],
  "decision": "ALLOW",
  "evidence": {
   "domain_risk": "low",
   "merchant_risk": "low",
   "transaction_simulation": "success"
  },
  "risk_score": 4
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/x402-payment-guard-preflight-evaluator-b7b79b72/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from base-agent-preflight.bytoken2023.workers.dev](https://www.zero.xyz/host/base-agent-preflight.bytoken2023.workers.dev/llms.txt)
