feat(agentkit): add x402Guard action provider for pre-payment trust checks - #1510
Open
enclave402 wants to merge 1 commit into
Open
enclave402 wants to merge 1 commit into
enclave402 wants to merge 1 commit into
Conversation
…hecks Adds a new x402Guard action provider that checks whether an x402 seller is safe to pay before the agent sends money. Closes coinbase#1476. - check_seller_verdict: takes a URL, returns verdict + score + attestation - get_census_leaderboard: returns top 100 sellers by trust score (free) Each verdict is EIP-712 signed by the census attestor for offline verification. Live census: 8,848 endpoints across ~2,000 hosts.
🟡 Heimdall Review Status
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR: feat(agentkit): add x402Guard action provider for pre-payment trust checks
Target repo:
coinbase/agentkitTarget path:
typescript/agentkit/src/action-providers/x402Guard/Closes: #1476
Summary
Adds a new
x402Guardaction provider that checks whether an x402 seller is safe to pay before the agent sends money. This directly answers #1476 ("How do you handle an unreliable or bad-actor agent today?").The provider queries a live census oracle that continuously probes every x402 endpoint listed on the Coinbase Bazaar (currently 8,848 endpoints across ~2,000 hosts) and returns a signed verdict:
Each verdict is cryptographically signed (EIP-712) so a router or auditor can verify it without trusting the gateway.
Actions
check_seller_verdictget_census_leaderboardUsage
The agent calls
check_seller_verdictbefore anyx402_http_request. If the verdict isavoid, the agent skips payment. Zero additional dependencies — uses globalfetchonly.How it answers #1476
Today: nothing. The existing
x402action provider pays any endpoint that returns a 402, with no pre-payment check. This provider adds a census-backed trust layer between "agent wants to pay" and "agent actually pays."Data source: enclave402.com/census — MIT-licensed, cryptographically signed, continuously updated.
npm package:
@enclave402/x402-guard(standalone fetch interceptor, zero deps)Test plan
checkSellerVerdictwith mocked responses (pay, caution, avoid, 402, unknown)getCensusLeaderboardwith mocked census responsehttps://enclave402.com/censusreturns valid JSON withassessed> 0supportsNetworkreturns true for all networks (census is chain-agnostic)