OpenZeppelin Guardian #252 · agentic x402 facilitator module

Threat-model first: make Guardian’s x402 module opt-in, auditable, and policy-gated.

This packet is tailored to OpenZeppelin/guardian#252 and its parent modularization issue. It turns the draft “Guardian as an x402 payment facilitator” idea into a reviewable module boundary before live credentials, private account state, or settlement authority enter the design.

1. Hook boundary

Place x402 in an optional middleware hook with explicit lifecycle points: quote, pre-authorization, verify, settle, receipt, and audit append.

2. Policy gate

Require spending caps, resource allow-lists, expiry, replay protection, chain/token allow-lists, and user-visible approvals before any facilitator path can settle.

3. Receipt contract

Bind each x402 result to Guardian account id, delta/proposal id, resource URL, payment hash, facilitator response, and canonical audit timestamp.

Why this is the safe first paid slice

Guardian already has sensitive private-account state, delta/canonicalization concepts, auth, acknowledger, network, and storage components. An agentic payment module should not be a generic “call facilitator from server” feature; it needs a narrow boundary that preserves Guardian’s existing invariants.

This readback deliberately avoids live keys, private account material, payments, or facilitator credentials. The first implementation should be mocked, fail-closed, and feature-gated until maintainers decide what authority Guardian may hold on behalf of users.

Readiness checklist

Suggested PR split

Relevant proof