# SignGate Swap Preflight — x402 Agent Buyer Risk Check

> SignGate Swap Preflight — x402 Agent Buyer Risk Check is a paid API for AI agents from base-agent-preflight.bytoken2023.workers.dev, paid per call via x402, $0.01/call, status unknown (last checked 2026-09-15).

Performs a pre-purchase risk and governance check on a token swap before an AI agent spends USDC via the x402 protocol on Base.

## Facts

- Endpoint: GET https://base-agent-preflight.bytoken2023.workers.dev/v1/x402/agent-risk/swap-preflight
- Price: $0.01/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/signgate-swap-preflight-x402-agent-buyer-risk-check-e1aed770
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_AJDKi2e3n4PuE67PBepoV

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 signgate-swap-preflight-x402-agent-buyer-risk-check-e1aed770
```

Example prompt: Before you swap USDC for token 0x4ed4E862860beD51a9570b96d89aF5E1B0Efefed on Base mainnet with a max slippage of 50 bps, run the SignGate preflight check to make sure the risk level is acceptable.

## When to prefer this

Use this endpoint when an AI agent is about to execute a token swap on Base via the x402 protocol and you need a lightweight, paid governance signal (risk score + flags) before committing funds. Prefer this over generic on-chain simulation when you specifically need buyer identity and policy alignment checks rather than execution simulation. Best suited for agentic pipelines that enforce a preflight gate before any DeFi spend.

## Known failure modes

- Missing required query parameters (chain, token_in, token_out) results in a 400 Bad Request
- Invalid Ethereum address format for token_in or token_out returns a validation error
- Unrecognized or unsupported chain identifier returns an error response
- Service unavailability on Cloudflare Workers returns a 503
- Payment of $0.01 USDC via x402 fails if agent wallet lacks sufficient balance

## 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 JSON object containing the network identifier, product type ('swap-preflight'), and an assessment block with a numeric risk_score, a categorical risk_level (e.g. 'low', 'medium', 'high'), and a flags array listing any specific governance concerns detected. An empty flags array with risk_level 'low' indicates the swap is cleared for agent execution.

## 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": [
      "chain",
      "token_in",
      "token_out"
     ],
     "properties": {
      "chain": {
       "type": "string",
       "pattern": "^[A-Za-z0-9:_ -]{2,80}$"
      },
      "token_in": {
       "type": "string",
       "pattern": "^0x[a-fA-F0-9]{40}$"
      },
      "token_out": {
       "type": "string",
       "pattern": "^0x[a-fA-F0-9]{40}$"
      },
      "amount_usdc": {
       "type": "string",
       "pattern": "^[0-9]+(?:\\.[0-9]{1,6})?$"
      },
      "max_slippage_bps": {
       "type": "string",
       "pattern": "^[0-9]{1,5}$"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "properties": {
      "network": {
       "type": "string"
      },
      "product": {
       "type": "string"
      },
      "activity": {
       "type": "object"
      },
      "identity": {
       "type": "object"
      },
      "assessment": {
       "type": "object"
      },
      "provenance": {
       "type": "object"
      }
     }
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "network": "eip155:8453",
  "product": "swap-preflight",
  "assessment": {
   "flags": [],
   "risk_level": "low",
   "risk_score": 0
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/signgate-swap-preflight-x402-agent-buyer-risk-check-e1aed770/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)
