true402
guide · Hermes (NousResearch)

Add a rug-check to your Hermes (NousResearch) agent

A Hermes agent that buys a Base token before checking it can get rugged in one trade. Here is how to gate every buy on an on-chain buy/sell verdict — one MCP server, no API key, paid per call over x402.

~/.hermes/config.yaml — true402 MCP server + pre-trade gate
# 1. Register true402 as an MCP server in ~/.hermes/config.yaml
mcp_servers:
  true402:
    command: npx
    args: ["-y", "@true402.dev/mcp-server"]
    env:
      WALLET_PRIVATE_KEY: "0x..."   # a Base wallet the agent controls; it IS the identity + payer

# 2. Tell Hermes the pre-trade rule (system prompt):
#    "Before any buy on Base, call token-report for the token address
#     and abort the trade unless the verdict is `ok`."

# 3. The gate the agent runs before every buy:
#    -> token-report tool  (POST /v1/base/token-report {"token":"0x<token>"})
#    -> verdict: "avoid" | "caution" | "ok"
#    -> buy ONLY on "ok"; "avoid"/"caution" = do not swap
#
#    token-report runs a real on-chain buy/sell honeypot simulation
#    (state-override eth_call) + liquidity + ownership/mint + deployer checks.
#    Pay-per-call in USDC on Base over x402 — no account, no API key.
#    Safety stalls have a small free daily trial.

# Zero-setup manual check (no config file): the web check at
# https://true402.dev/check runs the same on-chain checks.
§01 · the setup

Register true402 as an MCP server

Hermes (NousResearch) discovers tools through the mcp_servers block in ~/.hermes/config.yaml. Add the true402 MCP server there and your agent gains a set of Base token-safety tools with no extra wiring.

  1. Open ~/.hermes/config.yaml.
  2. Add the true402 entry under mcp_servers (see the install block below).
  3. Set WALLET_PRIVATE_KEY to a Base wallet the agent controls — that wallet is the identity and the payer. There is no account and no API key to provision.

On start, Hermes launches the server with npx and the safety stalls become callable tools. The wallet only needs a little USDC on Base; safety stalls also include a small free daily trial, so you can wire and test the gate before you spend anything.

§02 · the pre-trade gate

Check the verdict before you buy

The pattern that stops rugs is simple: never buy a token your agent has not just verified. Make the safety call the first step of the buy path and let the verdict decide whether the trade proceeds.

  1. Agent decides it wants to buy 0x<token>.
  2. It calls the token-report tool (POST /v1/base/token-report) with that address.
  3. true402 returns a composite verdict: avoid, caution, or ok, with reasons.
  4. Buy only on ok. Treat avoid as a hard stop; treat caution as a stop unless a human/policy overrides.

Give Hermes that rule in its system prompt so the model reaches for the tool on its own: “Before any buy on Base, call token-report for the token address and abort the trade unless the verdict is ok.” The verdict is the gate — the swap never runs when the sell side is blocked.

§03 · why on-chain simulation

A honeypot can't lie to a trade it just failed

A honeypot hides its trap in the transfer logic — ownership, mint authority, and liquidity can all look clean while the sell path is blocked or taxed. A static contract scan reads the bytecode and guesses, so it can be fooled. true402 instead runs a real on-chain buy and sell honeypot simulation using a state-override eth_call — it proves sellability rather than inferring it.

On top of the simulation it checks liquidity, ownership and mint controls, and deployer reputation, then folds everything into one verdict. That is why the gate keys on token-report: it is the composite answer, not a single static flag.

§04 · the stalls

Which stall for which question

The MCP server configures itself from the live API spec, so every paid stall arrives as a tool; these six are the safety set. Pick by the question your agent is asking. All are pay-per-call in USDC on Base over x402 against the API base https://true402.dev/api.

  • token-reportPOST /v1/base/token-report: the composite avoid/caution/ok verdict, ~$0.01. This is the one to gate buys on.
  • token-safetyPOST /v1/token-safety: a structural score 0–100, ~$0.005.
  • address-safetyPOST /v1/base/address-safety: ~$0.005.
  • deployer-checkPOST /v1/base/deployer-check: deployer reputation, ~$0.008. This is the one stall with no free trial — it depends on a keyed third-party explorer API, so it is paid from the first call.
  • tx-preflightPOST /v1/base/tx-preflight: the last check before signing, ~$0.008. Pass the unsigned transaction and get a simulation against current state, the decoded intent (an unlimited approval is judged on the spender), and the counterparty's removal history. It takes no private key and no signature, so it cannot broadcast or front-run the transaction it inspects.
  • liquidity-historyPOST /v1/base/liquidity-history: what has already happened to the token's liquidity, ~$0.005. Every observed removal with amount, block and transaction hash, plus the other tokens drained in the same transaction. A live simulation cannot see this — a pool drained last month simulates fine today if it was re-seeded.

Neither tx-preflight nor liquidity-history ever returns a verdict of safe: each answer carries the block range the archive actually covers, so none observed is not a claim of safety.

For a one-off manual look with zero setup, use the web check at true402.dev/check — the same on-chain checks, no config file needed.

§05 · why pay-per-call

No key. No account. No KYC.

Your Hermes agent has a wallet, not a credit card. true402 is x402-native: it pays per call in USDC on Base by signing a payment authorization — nothing to sign up for, no key to rotate, no rate-limit tier to negotiate. The wallet is the identity.

Safety stalls include a small free daily trial, so the gate works out of the box while you test. Past the trial, the agent pays only when it actually needs an answer — a fraction of a cent per token, and nothing when it is not trading. Start at true402.dev/check and read the API docs.

§ questions

Answered for machines.

How do I add a rug-check to a Hermes (NousResearch) agent?

Add true402 to the mcp_servers block in ~/.hermes/config.yaml, running @true402.dev/mcp-server via npx with your WALLET_PRIVATE_KEY. Hermes launches it on start and the token-safety stalls become callable tools. Then tell the agent to call token-report before any Base buy.

Do I need an API key or account?

No. true402 is x402-native, so the wallet is the identity. There is no sign-up, no API key, and no KYC. Your agent pays per call in USDC on Base by signing a payment authorization. Safety stalls also include a small free daily trial to test the gate first.

Which stall gates a buy decision?

Use token-report (POST /v1/base/token-report), the composite avoid/caution/ok verdict at about $0.01 per call. Gate the buy on the rating: proceed only on ok, and abort on avoid or caution. The other safety stalls answer narrower questions: token-safety (structural score), address-safety (a counterparty or spender), deployer-check (who shipped it), liquidity-history (removals already observed against the token) and tx-preflight (the unsigned transaction, checked immediately before signing).

Why is an on-chain simulation better than a static scan?

A honeypot hides its trap in the transfer logic — ownership, mint, and liquidity can look clean while the sell path is blocked. A static scan reads bytecode and guesses. true402 runs a real buy and sell via a state-override eth_call, proving sellability instead of inferring it. It also checks liquidity, ownership, and deployer reputation.

Can I try it without editing my Hermes config?

Yes. Use the web check at true402.dev/check for a one-off look with zero setup — the same on-chain buy/sell simulation and safety checks, no config file. Once you like the result, add the MCP server to ~/.hermes/config.yaml so the agent runs it automatically before trades.