feat(relayshield): add RelayShield action provider - #1449
Open
nzdsf2-gif wants to merge 1 commit into
Open
Conversation
Adds a RelayShield action provider with four screening actions, each paid per call over x402 from the agent's own wallet. - screen_wallet: counterparty address screening across EVM, Solana, TON and Bitcoin, chain detected from the address format - check_token_security: honeypot, mintable supply, blacklist and trading restriction checks - check_nft_security: fake or copied collections and transfer restrictions - screen_url: phishing and malware screening No API key is required. The endpoints answer with a 402 challenge and the agent's wallet settles in USDC on Base or Solana, using the same x402 client and payment wrapping as the existing x402 action provider. A failed check is never reported as a clean one: if the endpoint errors or the payment fails, the action returns a message stating that the check did not complete and the item should be treated as unverified.
🟡 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.
Description
Adds a RelayShield action provider with four screening actions, each paid per call over x402 from the agent's own wallet.
screen_walletcheck_token_securitycheck_nft_securityscreen_urlscreen_walletdetects the chain from the address format and covers EVM, Solana, TON and Bitcoin, so the agent never has to ask the user which chain an address is on.Why no API key
The endpoints answer with an HTTP 402 challenge and the agent's wallet settles in USDC in the same request cycle. There is no account to create and no key to store or rotate, which is the only shape that works when the buyer is software. This reuses the same
x402Client/wrapFetchWithPayment/registerExact*Schemepattern as the existingx402action provider rather than introducing a second payment path.supportsNetworkreturns true forbase-mainnetandsolana-mainnet. That reflects where a payment can settle, not which chains can be screened, and the README says so explicitly to avoid the obvious misreading.A failed check is never reported as a clean one
If the endpoint errors or the payment fails, the action returns a message stating plainly that the check did not complete and the item should be treated as unverified. A screening tool that looks like it found nothing when it actually failed is worse than one that admits it could not answer, and there are tests covering both the non-200 and the thrown-error paths.
The action descriptions also instruct the model to report a clean result as "nothing currently known against it" rather than as a safety guarantee.
Testing
pnpm exec jest src/action-providers/relayshield— 9 tests, all passing, covering network support, argument-to-body mapping for each endpoint, a HIGH verdict passing through unchanged, and both failure paths.pnpm run build— clean.pnpm run lint— clean.pnpm run format— clean.Not tested: a live end-to-end paid call against a funded wallet. The tests mock
wrapFetchWithPayment, so the payment path itself is exercised only through the same interface thex402provider uses. Flagging that rather than implying broader coverage than exists.The endpoints themselves were verified live before submitting: all four return a well-formed 402 challenge with USDC payment options on both Base and Solana.
Checklist
patch, per the contributing guide's guidance for new action providers)action-providers/index.ts, in alphabetical positiongenerate-action-providerrather than hand-rolled