x402 payment security for Coinbase AgentKit agents

TollWarden is a payment security firewall for x402 micropayments. agentkit-tollwarden adds a scan-before-you-pay action provider to Coinbase AgentKit.

Install

pip install agentkit-tollwarden

Add the provider

from coinbase_agentkit import AgentKit, AgentKitConfig
from agentkit_tollwarden import tollwarden_action_provider

agent_kit = AgentKit(AgentKitConfig(
    wallet_provider=wallet_provider,
    action_providers=[tollwarden_action_provider(agent_id="my-agent")],
))

Actions

Enforce the verdict

The actions rely on the model obeying the verdict. To make a blocked payment impossible instead, wrap your payment executor.

from agentkit_tollwarden import guarded_payment

safe_pay = guarded_payment(execute_x402_payment, tollwarden, wallet_provider=wallet_provider)
safe_pay(payment, content=page_text)
# raises TollWardenBlockedError on a block verdict; the executor is never called

Pass content (the text the agent read before deciding to pay) so the prompt-injection check runs. strict=True refuses flags too.

Non-custodial

TollWarden reads only payment metadata to produce a signed verdict; it never touches the AgentKit wallet's keys or funds.

Reference

Other integrations