Dev.to Security πŸ” Cybersecurity πŸ‘ 0 πŸ“– 5 min read

Check a Base token before your agent swaps: a $0.01 pre-trade risk verdict

Check a Base token before your agent swaps: a $0.01 pre-trade risk verdict A trading agent that can swap on Base should not treat a token address as safe because a quote exists. Before it signs an approval or a swap, i

Check a Base token before your agent swaps: a $0.01 pre-trade risk verdict

A trading agent that can swap on Base should not treat a token address as safe because a quote exists. Before it signs an approval or a swap, it can pay $0.01 USDC and read the contract. The result is not a score and not a go/no-go from us. It is a structured evidence pack β€” facts, signals, and checks that did not finish β€” for a policy or a person to review.

Disclosure: I work on BRAINIAC.software. There is no free trial and I am not claiming customers. Discovery and the local client download are free; a successful HTTP 2xx that returns real data costs the listed USDC price. Prices and field names below are from the live catalog, OpenAPI, and an unpaid 402 I ran on 23 November 2026. If a price has moved, the 402 is the source of truth.

This article is about one route: BQPOST /api/v1/token-security/risk-verdict. Claude Desktop and Cursor still cannot sign a 402 against a remote /mcp URL; the local payer they need is in Give a desktop agent a local x402 wallet.

What the route returns, and what it does not

Docs: token-security/risk-verdict. The catalog description is: read a Base token contract and return an evidence-based verdict.

It does not produce a risk score. Facts, signals, and unavailable checks are separate, and the absence of a signal is not a safety approval. In the published response example, data.approvesInteraction is false, and limitations states that the response does not approve interacting with the token. Named sources: public Base JSON-RPC (mainnet.base.org) for runtime bytecode and eth_call / eth_getStorageAt, plus the public DEX Screener token endpoint. Documented scope: Base mainnet, chain id 8453.

The live OpenAPI requires tokenAddress (a 0x-prefixed 40-hex address). Optional fields: chain, chainId, cursor. The published example uses Base USDC:

{ "tokenAddress": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913" }

Inspect the 402 without paying

This unpaid POST returns HTTP 402 and does not move USDC. Use a fresh 64-character hex Idempotency-Key each time you want a new challenge.

curl -i -X POST https://www.brainiac.software/api/v1/token-security/risk-verdict \
  -H 'Content-Type: application/json' \
  -H "Idempotency-Key: $(openssl rand -hex 32)" \
  -d '{"tokenAddress":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"}'

On 23 November 2026 that response was x402 version 2, scheme exact, network eip155:8453, amount "10000" ($0.01 USDC, 6 decimals), asset 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913, payTo 0x6428665E83F503904571104311bB78CBb29b975c, facilitator https://api.cdp.coinbase.com/platform/v2/x402. The catalog and OpenAPI x-payment-info list the same $0.01.

Field names an agent should branch on

The JSON below is the published example from the docs and the 402's Bazaar output schema, not a paid body from this article. Field names are what a paid call returns (truncated):

{
  "status": "partial",
  "data": {
    "retrievedAt": "2026-11-02T18:00:00.000Z",
    "tokenAddress": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
    "chainId": 8453,
    "approvesInteraction": false,
    "result_id": "a1b2c3d4e5f60718293a4b5c6d7e8f90",
    "received_at": "2026-11-02T18:00:01.000Z",
    "assessment": "signals_present",
    "findings": [
      {
        "kind": "fact",
        "code": "contract_code_present",
        "detail": "The address has runtime code at the latest block.",
        "evidence": "2456"
      },
      {
        "kind": "signal",
        "code": "selector_fe575a87",
        "detail": "Runtime bytecode contains the 4-byte selector for isBlacklisted(address). Presence in bytecode does not prove the function is reachable or privileged.",
        "evidence": "fe575a87"
      }
    ]
  },
  "nextCursor": "eyJ2IjoxLCJyb3V0ZSI6InBhcnRpYWwtcmVzdW1lLi4u",
  "progress": { "processed": 0, "total": null, "unit": "items", "scannedRange": null },
  "sources": [
    { "source": "Base JSON-RPC", "url": "https://mainnet.base.org", "retrievedAt": "2026-11-02T18:00:00.000Z" }
  ],
  "missing_items": [
    {
      "check": "paused_read_timeout",
      "reason": "timeout",
      "detail": "eth_call for paused() timed out. Bytecode facts above still stand."
    }
  ],
  "limitations": [
    "Absence of a signal is not evidence that the token is safe, and this response does not approve interacting with it."
  ]
}

Read four buckets: findings[] with kind fact (for example contract_code_present); findings[] with kind signal (the example flags the isBlacklisted(address) selector and warns that presence does not prove the function is reachable); missing_items[] (check, reason, detail β€” a timed-out paused() read is not a pass); and assessment, approvesInteraction, plus limitations[]. Do not invent a score from these.

status may be complete or partial when there is real data. A partial result can include nextCursor; resume by sending the same body plus cursor. Treat partial as incomplete work, not a clean bill of health. status failed or an empty payload is not charged.

The published example address is USDC on Base, so a signal on it is a teaching point, not a claim that USDC is unsafe. Bytecode selector matches can be coincidental.

Where this sits in an agent loop

Install the local stdio client from the skill, verify mcp-client.mjs.sha256, and keep BRAINIAC_PRIVATE_KEY, BRAINIAC_MAX_USD_PER_CALL, and BRAINIAC_DAILY_MAX_USD only in the host environment. For a $0.01 route, a per-call cap of 0.05 is enough. Do not paste a private key into a chat or into this article.

  1. The agent is about to swap or approve tokenAddress. Halt the swap path.
  2. Free: describe with id token-security.risk-verdict, so the body matches the live schema.
  3. Paid: call with { "id": "token-security.risk-verdict", "params": { "tokenAddress": "<token>" } }. The client pin-checks payTo, USDC, Base, and the CDP facilitator, then signs only if the amount is within the caps. I have verified that this official client path can complete a paid call on this route; that was a test payment, not a customer.
  4. If status is partial and nextCursor is present, resume with cursor or stop and show the incomplete result.
  5. Policy: refuse or escalate if approvesInteraction is not true (the published example is false), if missing_items is non-empty, or if any finding has kind signal and your policy requires a human. Never treat an empty findings list as β€œsafe” β€” the docs forbid that reading.
  6. Only then continue to a quote, approval, or swap β€” or do not.

Settlement is only after HTTP 2xx with real data (complete or partial). HTTP 4xx/5xx, failed, and empty payloads are not charged. Payment pins: how-it-works.

This is a lookup for a person or a policy to review, not legal advice and not an official determination. The same group also lists honeypot-risk-check and sell-simulation at $0.01 each; they are separate routes and not covered here.

If you already gate swaps in a local MCP client, I would like to hear which findings codes you actually block on, and whether missing_items is a hard stop or a retry.

πŸ“° Read the original article on Dev.to Security

Originally published by Dev.to Security. Aggregated on AIWithGhost for educational purposes β€” full credit and traffic to the original publisher.