# Agent Payment Guard — x402 Payment Firewall Policy Creator

> Agent Payment Guard — x402 Payment Firewall Policy Creator is a paid API for AI agents from base-agent-preflight.bytoken2023.workers.dev, paid per call via x402, $0.1/call, status unknown (last checked 2026-09-14).

Creates a payment guard policy that enforces risk scoring, budgets, domain allowlists, human approval thresholds, and replay protection for autonomous AI-agent x402 payments.

## Facts

- Endpoint: POST https://base-agent-preflight.bytoken2023.workers.dev/v1/x402/payment-guard/policies
- Price: $0.1/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/agent-payment-guard-x402-payment-firewall-policy-creator-dca3b9b0
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_pDAgIavs5F0WUqDl8ocl6

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 agent-payment-guard-x402-payment-firewall-policy-creator-dca3b9b0 -d '<json body>'
```

Example prompt: Set up a payment guard policy called 'ProductionAgentPolicy' with a daily budget of 50 USDC, a session budget of 10 USDC, max single payment of 2 USDC, human review required above 5 USDC, only allow payments to domains api.openai.com and api.anthropic.com, fail closed if the guard is unreachable, active from hour 8 to 20 UTC, and send alerts to https://my-webhook.example.com/alerts.

## When to prefer this

Use this endpoint when you need to create a new governance policy for AI-agent autonomous payments using the x402 protocol — specifically when you need budget caps, domain allowlists, human-in-the-loop approval triggers, replay protection, and webhook-based auditing configured as a reusable policy object. Prefer this over ad-hoc transaction checks when you want persistent, named policy enforcement across multiple agent sessions.

## Known failure modes

- Invalid USDC amount strings (non-numeric or negative values) cause 400 Bad Request
- Malformed webhook URL returns validation error
- active_from_hour_utc or active_until_hour_utc outside 0-23 range causes 422 error
- Missing required policy name returns 400
- Duplicate policy name may return 409 Conflict
- Service unavailable on Cloudflare Workers edge returns 503
- Authentication/authorization failure returns 401 or 403

## 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 the created policy record including a policy ID, all configured enforcement parameters (budgets, domain allowlists, human-review thresholds, active hours, webhook), and audit retention settings that the payment guard will apply to subsequent x402 agent transactions.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "name": {
   "type": "string"
  },
  "fail_closed": {
   "type": "boolean"
  },
  "webhook_url": {
   "type": "string",
   "format": "uri"
  },
  "allowed_tools": {
   "oneOf": [
    {
     "type": "string"
    },
    {
     "type": "array",
     "items": {
      "type": "string"
     }
    }
   ]
  },
  "retention_days": {
   "type": "integer",
   "maximum": 365,
   "minimum": 1
  },
  "allowed_domains": {
   "oneOf": [
    {
     "type": "string"
    },
    {
     "type": "array",
     "items": {
      "type": "string"
     }
    }
   ]
  },
  "max_single_usdc": {
   "type": "string"
  },
  "allowed_purposes": {
   "oneOf": [
    {
     "type": "string"
    },
    {
     "type": "array",
     "items": {
      "type": "string"
     }
    }
   ]
  },
  "daily_budget_usdc": {
   "type": "string"
  },
  "session_budget_usdc": {
   "type": "string"
  },
  "active_from_hour_utc": {
   "type": "integer",
   "maximum": 23,
   "minimum": 0
  },
  "active_until_hour_utc": {
   "type": "integer",
   "maximum": 24,
   "minimum": 1
  },
  "human_review_above_usdc": {
   "type": "string"
  },
  "reservation_ttl_seconds": {
   "type": "integer",
   "maximum": 3600,
   "minimum": 30
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "policy": {
   "max_single_usdc": "0.10",
   "daily_budget_usdc": "5.00",
   "session_budget_usdc": "1.00"
  },
  "product": "agent-payment-guard-policy",
  "profile_id": "policy_demo",
  "agent_token": "agent_token_example",
  "owner_token": "owner_token_example"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/agent-payment-guard-x402-payment-firewall-policy-creator-dca3b9b0/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)
