Skip to content

feat: add x402check action provider (TS + Python) - #1613

Open
nwilliams005 wants to merge 3 commits into
coinbase:mainfrom
nwilliams005:feat/x402check-action-provider
Open

nwilliams005 wants to merge 3 commits into
coinbase:mainfrom
nwilliams005:feat/x402check-action-provider

Conversation

@nwilliams005

@nwilliams005 nwilliams005 commented Oct 31, 2026 •

Copy link
Copy Markdown

Summary

Adds an x402check action provider so AgentKit agents can preflight an x402 seller endpoint before paying (trust verdict + payTo/price/uptime history).

Also exports a drop-in beforePayment helper that returns the exact #1454 decision shape ({ abort, reason?, code? }), so x402check plugs into the neutral pre-payment seat without a second surface. Standalone preflight_check / verify_payto actions remain available.

TypeScript (typescript/agentkit)

  • x402checkActionProvider with preflight_check and verify_payto actions
  • createX402checkBeforePayment — returns #1454's X402BeforePaymentDecision shape (local compatible types until that PR merges; no unmerged imports)
  • Policy: abort on avoid, optional abort on caution, always abort on live payTo ≠ context payTo, fail-closed by default (failOpen opt-in)
  • Schemas, types, utils, README (one-line drop-in example), Jest coverage
  • Changeset: typescript/.changeset/x402check-action-provider.md

Python (python/coinbase-agentkit)

  • Matching X402checkActionProvider + create_x402check_before_payment + schemas + README + pytest
  • Towncrier fragment: changelog.d/1402.feature.md

Design notes

  • Default base URL: https://x402check.dev (overridable)
  • No secrets required for the check itself; paid Exact USDC on Base at the service layer
  • Public client/MCP source: https://github.com/x402check/x402check
  • x402check focuses on live 402 integrity (price / network / payTo vs that URL's history, including payTo-change detection) — complementary to recipient-reputation screens

Test plan

  • Jest for x402check provider + beforePayment (18 tests)
  • pytest for Python provider + before_payment (12 tests)
  • eslint + tsc / ruff clean for touched files
  • Maintainer CI green on this PR

Related: #1402, #1454

Implements the #1454 X402BeforePaymentDecision shape as a drop-in helper; does not land the neutral hook itself (that lives in #1454). Happy for maintainers to review the two PRs separately.

@cb-heimdall

cb-heimdall commented Oct 31, 2026 •

Copy link
Copy Markdown

🟡 Heimdall Review Status

Requirement Status More Info
Reviews 🟡 0/1
Denominator calculation
Show calculation
1 if user is bot 0
1 if user is external 0
2 if repo is sensitive 0
From .codeflow.yml 1
Additional review requirements
Show calculation
Max 0
0
From CODEOWNERS 0
Global minimum 0
Max 1
1
1 if commit is unverified 0
Sum 1

Adds x402checkActionProvider / x402check_action_provider with
preflight_check and verify_payto so agents can trust-check an x402
seller URL (ok|caution|avoid + history) before signing USDC.

Also exports createX402checkBeforePayment, a beforePayment-compatible
helper for the hook in coinbase#1402 / coinbase#1454 (fails closed; provider-neutral).

Billing note: each check is $0.002 Exact USDC on Base via x402 v2;
pass a payment-wrapped fetch or PAYMENT-SIGNATURE headers.

Refs: coinbase#1402 coinbase#1454
@nwilliams005
nwilliams005 force-pushed the feat/x402check-action-provider branch from b2390d7 to 7a6fc4a Compare October 31, 2026 22:05
caiovicentino added a commit to caiovicentino/jev-risk-check-provider that referenced this pull request Nov 1, 2026
…402check/agentkit (guarded AgentKit wallet)

@x402check/ai-sdk 0.1.0: x402checkApproval, a toolApproval policy for
generateText and streamText. A mapper names the counterparties in a
value-moving tool's input; allow -> approved, warn -> user-approval (or
denied), block and not_verified -> denied, with x402check's reasons. The
check's context is the latest user message and the tool results after it,
plus the call; context: false sends nothing. An approval replay reuses the
call's verdict for five minutes. x402checkTool lets the model check an
address on its own.

@x402check/agentkit 0.1.0: guardWalletProvider wraps an AgentKit
EvmWalletProvider in a Proxy that routes every signature through the
client's guardAccount (AgentKit's x402 payments sign typed data through
toSigner()); sendTransaction and nativeTransfer are simulated and checked,
and sendTransaction sends the checked copy; raw hashes and other members
that sign or send refuse. x402checkActionProvider adds check_counterparty
without decorators or AgentKit telemetry, with AgentKit's own zod.

Both verify each attestation against its request with x402check's key
pinned and fail closed. CI runs both. The thread watch follows
coinbase/agentkit#1613, an "x402check" provider for x402check.dev, a
different service. ElizaOS waits: its registry closed on 2026-09-23 and no
wallet plugin has a pre-sign hook.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
caiovicentino added a commit to caiovicentino/jev-risk-check-provider that referenced this pull request Nov 1, 2026
…on shape

Make createX402checkBeforePayment / create_x402check_before_payment return
the exact X402BeforePaymentDecision shape from coinbase#1454 ({ abort, reason?,
code? }) so x402check drops into X402Config.beforePayment.

- Map ok|caution|avoid (+ live payTo/network vs history) into decision codes
- abortOnCaution + failOpen policy knobs; payTo mismatch always aborts
- Local compatible context/decision types (no unmerged coinbase#1454 imports)
- Python parity helper + tests; README one-line drop-in example
- Keep standalone x402check action provider

Related: coinbase#1402, coinbase#1454
Update provider copy, READMEs, and payment-hint text to match the
live x402check.dev unit price (was $0.002).

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

action provider New action provider documentation Improvements or additions to documentation python typescript

Development

Successfully merging this pull request may close these issues.

2 participants