Repository navigation
Conversation
…afety checks) Adds tapLabsActionProvider with two actions an agent can run before it buys, swaps or signs: - check_token_safety: TAP Labs' Safety Check for a token on Base or Solana, or a contract on Base - check_transaction: TAP Labs' Wallet Firewall for a transaction, approval, permit or sign-in message Each check is paid per call in USDC on Base with x402 from the agent's wallet. Before signing, the provider refuses any payment that is not an exact USDC payment on Base mainnet to TAP's wallet, at or under a per-check cap (default $0.03), valid for at most 10 minutes and using USDC's own EIP-712 domain; it reserves a total budget per provider instance (default $1). The x402 library gets only the wallet's address and typed-data signing, and the 402's extensions are not passed on. One payment per action, no retries of a paid request, redirects refused. What goes back to the model is size-capped, cleaned of control and invisible characters and labelled as data. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HZGGYkXaPLo54ceaP67829
🟡 Heimdall Review Status
|
Author
|
Friendly bump — happy to make any changes for review. Context in case it helps: this action provider has been running live on Base mainnet since Oct 21 — two real checks settled through the x402 flow and a third was correctly stopped by the budget before signing, so pay-per-call is exercised end to end, not just unit-tested. It lets an AgentKit agent call TAP’s certification checks and pay per call over x402 — squarely the agent-commerce case AgentKit is for. One signed commit, following action-provider conventions. Glad to split it, add tests, or adjust naming — just point me at what you’d like changed. Thanks for the look. |
This branch has not been deployed
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
tapLabsActionProvider, two pre-trade safety checks for AgentKit agents from TAP Labs. Each check is paid per call in USDC on Base with x402, from the agent's own wallet:check_token_safetyruns the TAP Labs Safety Check ($0.01). It looks for scam and rug pull warning signs in a token on Base or Solana, or a contract on Base:check_transactionruns the TAP Labs Wallet Firewall ($0.02). Before the agent signs a transaction, approval, permit, sign-in, EIP-7702 authorization or Solana transaction that came from outside its own tools, it decodes what the request does and compares it with the user's own words. It flags:Blockscout ended keyless API access on 1 July 2026. TAP Labs is moving its Base explorer reads (verified source, holders, the explorer's record) to other sources. Until then, those three show under
notCheckedand are never guessed. That is why the live run below lists 9 items not checked.Both checks are advisory, not guarantees. They return
block,warn,okorunknown, with findings that link their sources and a list of what was not checked.unknownis never treated as safe. Neither service holds funds, and neither signs anything for the user.Payment safety
The provider signs payments on its own, so it limits what it will sign:
What it will pay. Only an x402 v2
exactpayment that meets every one of these conditions:payTo);maxPaymentUsdc, default $0.03, at most $1);Any other payment is refused before signing.
Budget. Each provider instance has a total budget (
maxTotalUsdc, default $1, at most $100). The amount is reserved before signing, so parallel calls cannot overspend.Least privilege. The x402 library gets only the wallet's address and
signTypedData, so it cannot send or approve anything. The 402'sextensionsare not passed on. The same limits are registered again as an x402 client policy.One payment per action. Redirects are refused, responses are size-capped, and the output stays under 12,000 characters.
Prompt-injection hygiene. Text from the service (token names, sites' messages) is stripped of control and invisible characters. The output tells the model to treat quoted text as data.
If something goes wrong after signing, the message says so and tells the agent to check the wallet's USDC transfers before paying again. TAP Labs settles a payment only together with a successful answer.
Supports EVM wallet providers on
base-mainnet.Docs: a provider README, an entry in the agentkit README, and a changeset (patch).
Disclosure: this comes from TAP (The Atlas Project), which runs TAP Labs. Terms: https://theatlasproject.dev/docs/terms
Tests
Unit tests.
cd typescript/agentkit && npx jest src/action-providers/tapLabsruns 71 tests, all passing. They use real x402 signing with a generated key and a mocked network, and cover:extra;extensions(such as EIP-2612 gas sponsoring) never reaching the signer;ESLint and Prettier pass on the new files.
Live on Base mainnet, 21 October 2026. This went through AgentKit's action interface, with no LLM:
ViemWalletProvideron Base mainnet, with a wallet holding USDC on Base;tapLabsActionProvider({ maxPaymentUsdc: 0.02, maxTotalUsdc: 0.03 });getActions()and were invoked with their own schemas.Both settlements were then read back from Base:
20000 units;
Explorer links:
I have not run it through an LLM chatbot from
examples/yet. I can add a transcript if you'd like one.Unrelated, found during the mainnet run. AgentKit's analytics endpoint answered HTTP 400 to every action invocation.
CreateAction's wrapper callssendAnalyticsEventwithout handling a rejection. fix: handle rejected analytics request in WalletProvider.trackInitialization #1408 fixed the same problem inWalletProvider.trackInitialization.Checklist
🤖 Generated with Claude Code
https://claude.ai/code/session_01HZGGYkXaPLo54ceaP67829