# Agent402 Action Gate — Pre-flight Safety & Spend Validator

> Agent402 Action Gate — Pre-flight Safety & Spend Validator is a paid API for AI agents from agent402.tools, paid per call via x402, $0.01/call, status unknown (last checked 2026-09-13).

Validates a proposed agent action (URL fetch, spend proposal, payload, and action description) for safety, prompt injection, spend authorization, and schema conformance before execution.

## Facts

- Endpoint: POST https://agent402.tools/api/action-gate
- Price: $0.01/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-13
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/agent402-action-gate-pre-flight-safety-spend-validator-58edb664
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_k7-NaFyAmyy58tYv18al2

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 agent402-action-gate-pre-flight-safety-spend-validator-58edb664 -d '<json body>'
```

Example prompt: Before you fetch that URL and send the payment proposal of 500 USDC atomic units in USDC on Base to that counterparty, run it through the Agent402 action gate first — screen the action description, the payload, and the untrusted text I just got back from the third-party site for prompt injection, and confirm the spend is within mandate.

## When to prefer this

Choose this endpoint when your AI agent needs a deterministic, pre-execution safety gate before taking any action that involves spending USDC, fetching an external URL, or acting on untrusted third-party content. It is especially valuable in agentic pipelines where prompt injection from external sources is a risk, or where a spend mandate must be enforced before any payment is authorized. Prefer it over ad-hoc agent-side checks because it provides auditable SHA256 receipts, structured reason codes, and a single unified decision, all without requiring API keys or signup — the x402 wallet is the identity.

## Known failure modes

- Spend proposal fails if amount_atomic or counterparty fields are malformed or exceed mandate limits — returns spend.status: fail with reason codes
- Prompt injection check flags untrusted_text or action.description containing known injection patterns — returns prompt.status: fail
- Payload fails if it does not conform to the provided bounded JSON schema — returns payload.status: fail
- URL check fails if the target URL is on a blocklist or malformed — returns url.status: fail
- Malformed request body (missing required fields or wrong types) returns a 4xx error
- BigInt parsing errors if spend amounts are passed as floats instead of integer strings

## How this service works

Deterministic preflight check for a proposed AI agent action - a tool call, payment, fetch, or write - before it executes. Evaluates up to four independent checks (prompt-injection scan on action text/untrusted text, URL/hostname validation, a bounded JSON-schema check on a payload, and a spend proposal against a spend mandate) and returns ALLOW, REVIEW, or BLOCK with stable reason codes plus a SHA-256 request/receipt hash pair.

## Output

Returns a JSON object with a top-level `decision` field (ALLOW or DENY), a `checks` object with per-check results (url, spend, prompt, payload each with a status of pass/fail and optional details), an array of `reason_codes` explaining any failures, a SHA256 hash of the request for audit, and a receipt SHA256. Includes a `limitation` notice that ALLOW is a deterministic static result and does not guarantee downstream safety or successful execution.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "url": {
   "type": "string",
   "description": "URL the action would fetch/call, if any"
  },
  "spend": {
   "type": "object",
   "description": "{proposal:{amount_atomic,asset,counterparty}, mandate:{...}, now?} - checked with BigInt, no floats"
  },
  "action": {
   "type": "object",
   "description": "{name, description, effect} - describes the proposed action; description is scanned for prompt-injection signals"
  },
  "schema": {
   "type": "object",
   "description": "Bounded JSON-schema (type/required/properties/additionalProperties) to validate payload against"
  },
  "payload": {
   "type": "object",
   "description": "Data the action would send, if any"
  },
  "untrusted_text": {
   "type": "string",
   "description": "Any additional untrusted text to scan for prompt-injection signals"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "checks": {
   "url": {
    "status": "pass"
   },
   "spend": {
    "status": "pass",
    "allowed": true
   },
   "prompt": {
    "status": "pass"
   },
   "payload": {
    "status": "pass"
   }
  },
  "decision": "ALLOW",
  "limitation": "Deterministic static checks only. ALLOW does not guarantee safety, authorization, or successful execution.",
  "reason_codes": [],
  "receipt_sha256": "…",
  "request_sha256": "…"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/agent402-action-gate-pre-flight-safety-spend-validator-58edb664/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from agent402.tools](https://www.zero.xyz/host/agent402.tools/llms.txt)
