{
  "markdown": "# AgentRisk M2M 🛡️\n\n> **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.*\n\n---\n\n## ⚡ The Problem\n\nAutonomous trading bots are fast, but they are completely blind.\nEvery 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.\nStatic 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.\n\n## 🎯 The Solution\n\n**AgentRisk** is an isolated, machine-readable security API built specifically for AI agents and automated scripts.\nBefore 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:\n\n```json\n{\n  \"riskScore\": 20,\n  \"riskLevel\": \"CAUTION\",\n  \"verdict\": \"PROCEED WITH CAUTION. Top 10 holders control 51.8% of supply.\",\n  \"shouldExecute\": true,\n  \"reasons\": [\n    \"Top 10 holders control 51.8% of supply.\"\n  ]\n}\n```\n\n## What Makes This Different\n\n- **Deployer wallet freshness** — flags newly-created wallets used for one-off token launches\n- **Brand impersonation detection** — flags tokens named after known companies (Apple, Google, Meta, etc.)\n- **Data source disagreement** — flags cases where third-party APIs and our own on-chain checks disagree\n- **Human-readable verdict** — one plain-English sentence, not just raw scores\n- **Sub-millisecond cached responses** — repeat scans within 30 seconds return instantly, with a `cached` field so you know whether a result is fresh or reused\n\n## Quick Testing with MCP Inspector\n\nWant to poke at the MCP server without writing any code? Run: npx @modelcontextprotocol/inspector\n\nThen connect it to `https://agentrisk.dev/mcp/manifest` and call `check_token_risk` directly from the UI.\n\n## Cache Freshness Warning\n\nEvery 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.\n\n## ⚙️ How It Works (M2M Architecture)\n\n1. Agent Discovers Token via mempool or DEX router event.\n2. Agent Calls AgentRisk MCP Tool (`check_token_risk`) or the direct `/scan` endpoint.\n3. Instant x402 Micropayment ($0.15 USDC instantly settled on Base — no API keys, subscriptions, or credit cards; pure machine-to-machine payment).\n4. Binary Decision: The agent receives `shouldExecute: true/false` with a risk score and structured reasons.\n\n## 📦 Python SDK\n\n```bash\npip install agentriskm2m\n```\n\n```python\nimport asyncio\nfrom agentrisk import AgentRisk\n\nasync def main():\n    risk = AgentRisk(private_key=\"your_base_wallet_private_key\")\n    result = await risk.scan(\"0xTokenAddressHere\")\n    print(result[\"verdict\"])\n\nasyncio.run(main())\n```\n\n[PyPI page](https://pypi.org/project/agentriskm2m/)\n\nOr check a token instantly from the terminal, no code needed:\n\n```bash\nexport AGENTRISK_PRIVATE_KEY=your_base_wallet_private_key\nagentriskm2m check 0xTokenAddressHere\n```\n\n## 🚀 Copy-Paste Integration (60 seconds)\n\nInstall the x402 SDK, then run this — it handles payment automatically:\n\n```python\npip install x402 eth-account\n\nimport asyncio\nfrom eth_account import Account\nfrom x402 import x402Client\nfrom x402.http.clients import x402HttpxClient\nfrom x402.mechanisms.evm import EthAccountSigner\nfrom x402.mechanisms.evm.exact.register import register_exact_evm_client\n\nPRIVATE_KEY = \"your_base_wallet_private_key\"\nTOKEN_ADDRESS = \"0x...\"  # the token you want to check\n\nasync def check_token():\n    account = Account.from_key(PRIVATE_KEY)\n    client = x402Client()\n    register_exact_evm_client(client, EthAccountSigner(account))\n    async with x402HttpxClient(client) as http:\n        response = await http.get(f\"https://agentrisk.dev/scan?token={TOKEN_ADDRESS}\")\n        print(response.json())\n\nasyncio.run(check_token())\n```\n\nThat'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.\n\n## Framework Integration Examples\n\n### Option 1: MCP (Claude, Cursor, any MCP-compatible agent)\n\nNo code needed — just point your MCP client config at:\n\n```json\n{\n  \"mcpServers\": {\n    \"agentrisk\": {\n      \"url\": \"https://agentrisk.dev/mcp/manifest\"\n    }\n  }\n}\n```\n\nYour agent will automatically discover `check_token_risk` as an available tool.\n\n### Option 2: LangChain\n\n```python\nfrom langchain.tools import tool\nfrom eth_account import Account\nfrom x402 import x402Client\nfrom x402.http.clients import x402HttpxClient\nfrom x402.mechanisms.evm import EthAccountSigner\nfrom x402.mechanisms.evm.exact.register import register_exact_evm_client\n\naccount = Account.from_key(\"your_base_wallet_private_key\")\nclient = x402Client()\nregister_exact_evm_client(client, EthAccountSigner(account))\n\n@tool\nasync def check_token_safety(token_address: str) -> dict:\n    \"\"\"Check if a Base token is a honeypot or scam before buying or swapping.\"\"\"\n    async with x402HttpxClient(client) as http:\n        response = await http.get(f\"https://agentrisk.dev/scan?token={token_address}\")\n        return response.json()\n\n# Add check_token_safety to your agent's tools list\n```\n\n### Option 3: Coinbase AgentKit\n\n```python\nfrom coinbase_agentkit import action\n\n@action(\n    name=\"check_token_safety\",\n    description=\"Check if a Base token is safe to trade before executing a swap\"\n)\nasync def check_token_safety(token_address: str) -> dict:\n    async with x402HttpxClient(client) as http:\n        response = await http.get(f\"https://agentrisk.dev/scan?token={token_address}\")\n        return response.json()\n```\n\n### Option 4: Plain Python (any custom bot, no framework)\n\n```python\ndef buy_token(token_address, amount):\n    risk = check_token_safety(token_address)  # your call to AgentRisk\n    if not risk[\"shouldExecute\"]:\n        print(f\"Blocked: {risk['verdict']}\")\n        return\n    execute_swap(token_address, amount)\n```\n\n### Option 5: Automatic discovery via x402 Bazaar\n\nIf your agent searches the [x402 Bazaar](https://x402bazaar.xyz) for tools, AgentRisk is discoverable automatically — no manual integration needed.\n\n## 🚀 Other Integration Options\n\n### Option 1: MCP Server (For Claude, Cursor & Custom Agents)\n\nMCP manifest is live at:\nhttps://agentrisk.dev/mcp/manifest\n\nTool endpoint: `POST https://agentrisk.dev/mcp/tools/check_token_risk` (x402-gated, 0.15 USDC per call). ### Option 2: Direct HTTP Call\n\nGET https://agentrisk.dev/scan?token=<CONTRACT_ADDRESS>\n\nReturns HTTP 402 with payment instructions until a valid x402 payment (0.15 USDC on Base) is attached.\n\n## 💰 Economy\n\n- **Model:** Pay-per-scan via the x402 protocol on Base Mainnet.\n- **Cost:** 0.15 USDC per comprehensive scan.\n- **Facilitator:** Coinbase's official CDP facilitator — verifies and settles payments directly on Base.\n\n## 🔎 Live Status\n\n- Agent manifest: [`/​.well-known/agent.json`](https://agentrisk.dev/.well-known/agent.json)\n- MCP manifest: [`/mcp/manifest`](https://agentrisk.dev/mcp/manifest)\n- Public track record: [`/v1/track-record`](https://agentrisk.dev/v1/track-record)\n- Listed on the [x402 Bazaar](https://x402bazaar.xyz) — discoverable by any agent searching for token safety tools\n\nBuilt for autonomous systems that trust math, not hype.\n",
  "bytes": 7798,
  "sha": "94038349e398f4ad12b4aa84b50144caa6570c2586d2c1393355f4f4dce1ef3b",
  "repo_slug": "neurobyteio/agentrisk",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_neurobyteio_agentrisk_51b99712/readme"
}