The read-only pre-sign evidence layer — a "pre-sign journal" — for onchain agents.
Before an agent (or you) signs a swap onchain, check_swap
returns a modeled read of route quality, MEV / execution exposure, and
token-registry recognition as a clear / caution / unsupported verdict with its
caveats — and persists a hash-verifiable record of exactly what was known
before signing, re-verifiable offline. That record is the pre-sign journal.
It is read-only: it never signs, executes, routes funds, or custodies assets. The agent still decides. Routescore just records what was known.
check_swap is free — a free API key runs 100 pre-sign checks/day (Pro
1,000/day, Power 10,000/day). Mint one at Account → Developer → API & MCP
access on routescore.io/account; keys look
like rs_live_… and are shown once. See how the modeled reads have tracked
measured on-chain outcomes on the public
calibration surface.
This repo is copy-paste examples for wiring check_swap into an agent — as an
MCP server or the plain REST API — plus an
offline verifier for the evidence record.
| Path | What it shows |
|---|---|
mcp/claude-desktop.json |
MCP server config for Claude Desktop |
mcp/cursor.json |
MCP server config for Cursor |
mcp/codex.md |
MCP + REST setup for OpenAI Codex CLI |
rest/check_swap.sh |
Pre-sign check with curl |
rest/check_swap.ts |
Pre-sign check in TypeScript (fetch) |
rest/check_swap.py |
Pre-sign check in Python (requests) |
rest/verify_record.mjs |
Normative offline hash re-verification (Node) |
rest/verify_record.py |
Offline hash re-verification (Python; see caveat) |
agents/preflight-before-signing.md |
The preflight-before-signing agent pattern |
check_swap is decision support, not execution. Relay the verdict, reasons,
and caveats to the user or the agent's policy verbatim — never soften a
caution to a clear, and never treat registry recognition as a safety audit.
Unsupported inputs, unknown order flow, and uncalibrated sequencer ordering
downgrade the verdict rather than reading as safe.
Base URL: https://www.routescore.io/api/public/v1. Authenticate every request
with Authorization: Bearer rs_live_….
| Method | Path | Purpose |
|---|---|---|
POST |
/check/swap |
Pre-sign evidence check → verdict + trust envelope + record_id |
GET |
/records/{record_id} |
Retrieve the persisted evidence record (owner-scoped) |
GET |
/me |
Confirm the key + report its tier |
Rate limits are per key; every response carries X-RateLimit-* headers
(X-RateLimit-Daily-Limit / -Daily-Remaining for the daily quota). Read them
and back off before you hit a limit.
MIT — see LICENSE.