Pre-Trade Security Layer for Autonomous DeFi Agents on Base.Stop letting your autonomous trading bots get rekt by stealth honeypots, malicious taxes, and rugpulls.
Autonomous trading bots are fast, but they are completely blind. Every minute, new unvetted tokens launch on Base. A significant share are deliberately engineered traps designed to block sells, drain executing wallets, or alter transfer taxes at the worst possible moment. Static blocklists (like standard free APIs) are useless against freshly deployed, obfuscated contracts. By the time human-curated lists update, your bot's capital is already gone.
AgentRisk is an isolated, machine-readable security API built specifically for AI agents and automated scripts.
Before your bot executes a swap() on Uniswap or Aerodrome, it pings AgentRisk. We run a deep runtime simulation combining direct on-chain checks, GoPlus Security, and DexScreener liquidity data, and return a strict verdict:
{
"riskScore": 20,
"riskLevel": "CAUTION",
"verdict": "PROCEED WITH CAUTION. Top 10 holders control 51.8% of supply.",
"shouldExecute": true,
"reasons": [
"Top 10 holders control 51.8% of supply."
]
}- Deployer wallet freshness — flags newly-created wallets used for one-off token launches
- Brand impersonation detection — flags tokens named after known companies (Apple, Google, Meta, etc.)
- Data source disagreement — flags cases where third-party APIs and our own on-chain checks disagree
- Human-readable verdict — one plain-English sentence, not just raw scores
- Sub-millisecond cached responses — repeat scans within 30 seconds return instantly, with a
cachedfield so you know whether a result is fresh or reused
Want to poke at the MCP server without writing any code? Run: npx @modelcontextprotocol/inspector
Then connect it to https://agentrisk.dev/mcp/manifest and call check_token_risk directly from the UI.
Every response includes cached (boolean) and timestamp (unix seconds) fields. Cached results are served for up to 30 seconds — long enough to speed up repeat lookups, short enough to catch a rug pull or a newly-enabled honeypot function in most cases. For the final safety check immediately before executing a trade, we recommend either calling with a fresh request or checking that cached is false / timestamp is very recent before trusting a shouldExecute: true result.
- Agent Discovers Token via mempool or DEX router event.
- Agent Calls AgentRisk MCP Tool (
check_token_risk) or the direct/scanendpoint. - Instant x402 Micropayment ($0.15 USDC instantly settled on Base — no API keys, subscriptions, or credit cards; pure machine-to-machine payment).
- Binary Decision: The agent receives
shouldExecute: true/falsewith a risk score and structured reasons.
pip install agentriskm2mimportasynciofromagentriskimportAgentRiskasyncdefmain():
risk=AgentRisk(private_key="your_base_wallet_private_key")
result=awaitrisk.scan("0xTokenAddressHere")
print(result["verdict"])
asyncio.run(main())Or check a token instantly from the terminal, no code needed:
export AGENTRISK_PRIVATE_KEY=your_base_wallet_private_key
agentriskm2m check 0xTokenAddressHereInstall the x402 SDK, then run this — it handles payment automatically:
pipinstallx402eth-accountimportasynciofrometh_accountimportAccountfromx402importx402Clientfromx402.http.clientsimportx402HttpxClientfromx402.mechanisms.evmimportEthAccountSignerfromx402.mechanisms.evm.exact.registerimportregister_exact_evm_clientPRIVATE_KEY="your_base_wallet_private_key"TOKEN_ADDRESS="0x..."# the token you want to checkasyncdefcheck_token():
account=Account.from_key(PRIVATE_KEY)
client=x402Client()
register_exact_evm_client(client, EthAccountSigner(account))
asyncwithx402HttpxClient(client) ashttp:
response=awaithttp.get(f"https://agentrisk.dev/scan?token={TOKEN_ADDRESS}")
print(response.json())
asyncio.run(check_token())That's it. It pays 0.15 USDC automatically and prints the risk report. Your wallet needs a small amount of USDC and ETH (for gas) on Base.
No code needed — just point your MCP client config at:
{
"mcpServers": {
"agentrisk": {
"url": "https://agentrisk.dev/mcp/manifest"
}
}
}Your agent will automatically discover check_token_risk as an available tool.
fromlangchain.toolsimporttoolfrometh_accountimportAccountfromx402importx402Clientfromx402.http.clientsimportx402HttpxClientfromx402.mechanisms.evmimportEthAccountSignerfromx402.mechanisms.evm.exact.registerimportregister_exact_evm_clientaccount=Account.from_key("your_base_wallet_private_key")
client=x402Client()
register_exact_evm_client(client, EthAccountSigner(account))
@toolasyncdefcheck_token_safety(token_address: str) ->dict:
"""Check if a Base token is a honeypot or scam before buying or swapping."""asyncwithx402HttpxClient(client) ashttp:
response=awaithttp.get(f"https://agentrisk.dev/scan?token={token_address}")
returnresponse.json()
# Add check_token_safety to your agent's tools listfromcoinbase_agentkitimportaction@action(name="check_token_safety",description="Check if a Base token is safe to trade before executing a swap")asyncdefcheck_token_safety(token_address: str) ->dict:
asyncwithx402HttpxClient(client) ashttp:
response=awaithttp.get(f"https://agentrisk.dev/scan?token={token_address}")
returnresponse.json()defbuy_token(token_address, amount):
risk=check_token_safety(token_address) # your call to AgentRiskifnotrisk["shouldExecute"]:
print(f"Blocked: {risk['verdict']}")
returnexecute_swap(token_address, amount)If your agent searches the x402 Bazaar for tools, AgentRisk is discoverable automatically — no manual integration needed.
MCP manifest is live at: https://agentrisk.dev/mcp/manifest
Tool endpoint: POST https://agentrisk.dev/mcp/tools/check_token_risk (x402-gated, 0.15 USDC per call). ### Option 2: Direct HTTP Call
GET https://agentrisk.dev/scan?token=<CONTRACT_ADDRESS>
Returns HTTP 402 with payment instructions until a valid x402 payment (0.15 USDC on Base) is attached.
- Model: Pay-per-scan via the x402 protocol on Base Mainnet.
- Cost: 0.15 USDC per comprehensive scan.
- Facilitator: Coinbase's official CDP facilitator — verifies and settles payments directly on Base.
- Agent manifest:
/.well-known/agent.json - MCP manifest:
/mcp/manifest - Public track record:
/v1/track-record - Listed on the x402 Bazaar — discoverable by any agent searching for token safety tools
Built for autonomous systems that trust math, not hype.