{"uid":"cap_k7-NaFyAmyy58tYv18al2","slug":"agent402-action-gate-pre-flight-safety-spend-validator-58edb664","name":"Agent402 Action Gate — Pre-flight Safety & Spend Validator","description":"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.","url":"https://agent402.tools/api/action-gate","method":"POST","headers":{},"bodySchema":{"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"}}},"responseSchema":{"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":"…"}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.01","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.01/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.01","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.01","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_3hp2v2wXXwEUZp--73f2T","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.01","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Validates a proposed agent action (URL fetch, spend proposal, payload, and action description) for safety, prompt injection, spend authorization, and schema conformance before execution.","exampleAgentPrompt":"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.","exampleUseCases":[{"title":"Pre-flight check before USDC micro-payment","prompt":"Before my agent sends that 0.01 USDC pay-per-call to the external tool API, validate the spend proposal — amount is 1000 atomic units, asset is USDC, counterparty is the tool's address — and make sure the action description doesn't contain any prompt injection signals."},{"title":"Screening third-party API response for injection","prompt":"I just got a response back from an untrusted third-party endpoint and my agent wants to act on it — can you pass the raw text through the Agent402 action gate to scan it for prompt injection before my agent does anything with it?"},{"title":"Schema conformance check on outbound payload","prompt":"My agent is about to POST a JSON payload to an external service — validate it against this bounded schema I've defined (type, required fields, no additionalProperties) and tell me if it passes before we send it."}],"resultDescription":"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.","failureModes":["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"],"whenToPreferThis":"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.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-13T12:59:32.489Z","isFirstParty":false}