screen_payment_metadata
Scans x402 payment metadata for PII in resource URL, description, and reason fields, returning redacted strings and entity counts to prevent data exposure before signing.
Instructions
Screen x402 payment metadata for PII before signing the payment.
Call BEFORE sending the payment request. Detects emails, phone numbers, SSNs, names, and other PII in the resource URL, description, and reason fields and returns redacted strings plus per-field entity counts.
No side effects.
Runs in one of two modes:
in_process (default): wraps the local presidio_x402 PIIFilter.
remote: when both PRESIDIO_X402_MCP_REMOTE_BASE_URL and ..._REMOTE_API_KEY are set, POSTs to /v1/screen on that host for centralized audit. On remote failure, returns a structured error dict instead of silently falling back — the caller must decide whether to retry, accept reduced screening, or abort.
Args: resource_url: x402 resource URL the agent is about to pay (max 2048 chars). description: Human-readable description (max 4096 chars). reason: Reason / memo string (max 4096 chars). entities: Optional whitelist of Presidio entity types to detect. If None, all configured entities are scanned.
Returns: On success: dict with keys redacted_resource_url, redacted_description, redacted_reason, entities_found (list of {entity_type, field, count}), and mode (one of "in_process", "remote"). On remote failure: dict with keys error (one of "auth_error", "rate_limit", "unavailable"), detail, optional retry_after (for rate_limit), and mode ("remote").
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| reason | No | ||
| entities | No | ||
| description | No | ||
| resource_url | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||