AI agents and chain data: serving verified on-chain data to LLMs
In 2026, AI agents became a customer of chain data vendors. Most large vendors now run an MCP server, so an agent in Claude, Cursor or ChatGPT can query chain data directly. Some vendors also let agents pay per call.
That is useful for exploration. It is risky for anything that moves money or feeds a report. An agent repeats what a tool returns, and it cannot tell a correct balance from a wrong one. This note covers who serves agents today and what you can verify. It then lists the main risks and a pattern to serve agents data you can trust.
All quotes and dates below were read on 2026-10-30.
Who serves agents today
MCP (Model Context Protocol) is an open standard that lets an AI client call external tools. A chain data MCP server exposes tools such as "run this SQL" or "get this wallet's balances".
| Vendor | What the agent gets | Source |
|---|---|---|
| Dune | SQL queries, results, charts, dashboards | Dune docs |
| Alchemy | Alchemy's blockchain APIs, hosted MCP | GitHub |
| Bitquery | DEX trades, transfers, OHLC candles | Bitquery docs |
| GoldRush | GoldRush multichain APIs as MCP tools | GoldRush changelog |
| Allium | SQL against Allium Explorer | Allium docs |
| The Graph | AI Suite and MCP server, per its docs index | The Graph |
The dates show how fast this moved. GoldRush published its MCP server on 2025-04-14. Dune launched its MCP in February 2026 and a CLI with agent skills in March 2026, according to Dune's changelog. Dune says the CLI uses "typically fewer tokens than MCP protocol overhead". In May 2026 Dune removed its own in-app "Dune Agent" "in favor of the Dune MCP and Dune CLI". The same month, Dune cut 25% of its staff, in a story The Block headlined as "citing AI efficiencies" (The Block).
Alchemy moved from a local server to a hosted one. Its repo says the old npm package "will stop working on September 30, 2026" and points users to the hosted server at mcp.alchemy.com. If you built on the local package, check your setup.
Agents that pay
Some vendors now accept payment per request, so an agent needs no API key or contract.
- x402 describes itself as "an open, neutral standard for internet-native payments". Coinbase unveiled it in May 2025 to "automate online payments with stablecoins" (Ledger Insights).
- Goldsky's Polymarket Feeds API accepts "a Feeds API key or per-request x402 payment" (Goldsky docs).
- Dune lists "Dune MPP" for "pay-per-request micropayments using the Machine Payment Protocol" (Dune docs).
- Allium's docs list "Machine Payments" for pay-per-call in USDC.
- The Graph's 2026 roadmap plans an "x402-compliant Subgraph gateway with MCP and A2A support" for Q2 2026. It says x402 "means AI agents will be authorized to autonomously query the network and pay per-query". Treat this as a roadmap claim.
To give an agent its own wallet, Coinbase offers AgentKit, "a toolkit for giving AI agents a crypto wallet and onchain interactions". A wallet turns a read-only agent into one that can send funds. That raises the risk.
Three ways an agent reads chain data
agent
|
+-- (a) raw RPC ------> node or RPC provider
| answers: state at a block
|
+-- (b) indexed API --> balances, transfers, trades
| answers: vendor's decoded view
|
+-- (c) SQL ----------> warehouse (Dune, Allium, own)
answers: whatever the query says
Each path fails in its own way.
- Raw RPC is close to the source. The agent must still decode results and know which block it asked about.
- Indexed APIs are easy to use. The agent trusts the vendor's decoding, prices and coverage.
- SQL is flexible. The agent writes the query, and a wrong join returns a wrong number that looks fine.
Freshness also differs. Dune's docs give Data Hub freshness of "EVM: ~1-15 min Solana: ~1-5 min Curated: ~1 hour" (Dune). An agent that does not say which block or time its answer reflects can be 15 minutes stale without anyone noticing.
"The API said so" is not verification
An answer from an RPC provider or a data API is a claim by that provider. Some tools let you check the claim. They differ in what they prove.
| Tool | What it proves | What it does not prove |
|---|---|---|
eth_getProof (EIP-1186) | An account or storage value matches a state root | That the state root is canonical |
| Helios light client | RPC answers match the chain consensus | Anything about decoded or derived data |
| Proof of SQL | A SQL result matches the data it ran on (vendor claim) | That the input data was complete |
| Vendor roadmaps | Planned "verifiable" data | Nothing yet |
EIP-1186 adds an RPC method "which creates Merkle Proofs for Accounts and Storage Values". Helios "converts an untrusted centralized RPC endpoint into a safe unmanipulable local RPC". These two are protocol-level checks you can run yourself.
Space and Time says its Proof of SQL prover "cryptographically guarantees SQL queries were computed accurately against untampered data". The Graph's roadmap lists an "Amp verifiable raw blockchain data release" and a "Substreams probabilistic verifier" for Q4 2026. These are vendor claims and plans. I did not find any vendor MCP documentation that says it returns proofs with its answers.
So for most agent use today, verification is your job. For any number that matters, record the block number and source. Then cross-check it against a second source or a proof.
What goes wrong
Wrong or lookalike addresses
Language models can produce an address that looks right and is wrong. Attackers also make lookalike addresses on purpose. A study of address poisoning found that attackers generate "lookalike addresses similar to one with which the victim has previously interacted". It counted "270M on-chain attacks targeting 17M victims" and "at least 83.8M USD in losses" on Ethereum and BSC over two years (arXiv). An agent that copies an address from a transaction history can copy the poisoned one.
Stale state and reorgs
A balance is true at one block. It can change at the next. Recent blocks can also be reorganised. If an agent caches an answer, or reads from a source that lags, it acts on old state. The reorgs, finality and idempotency note covers the chain side of this.
Prompt and memory injection
On-chain data contains text that anyone can write: token names, NFT metadata, transaction memos. Off-chain sources like social posts feed agents too. Any of it can carry instructions aimed at the model.
A Princeton and Sentient paper tested this on agents built with ElizaOS. It found that "AI models are significantly more vulnerable to memory injection compared to prompt injection", and that "prompt-injection defenses and detectors only provide limited protection when stored context is corrupted" (arXiv). If an attacker gets bad text into an agent's stored memory, current filters do not reliably stop it.
A case reported in November 2024 shows the risk. An AI agent called Freysa held a prize pool. After 482 attempts, one user "redefined the 'approveTransfer' function" in the chat, so the agent thought it handled incoming payments. It "sent its entire balance of 13.19 ETH (about $47,000)" (The Decoder).
Over-broad tool permissions
An MCP server acts with the permissions you give it. The MCP specification warns that proxy servers can create "'confused deputy' vulnerabilities" that let "malicious clients ... obtain authorization codes without proper user consent" (MCP spec). An API key with write access, or a wallet with funds, inside an agent's reach is a standing risk.
A safe pattern for serving agents
This is the pattern I recommend when an agent must read financial data.
agent ---> narrow tool ---> curated tables ---> raw chain data
(read-only, (versioned, (node, stream
typed inputs) tested, lineage) or vendor)
|
+--> every answer: value, block, time, source
- Read-only by default. Agent tools query data. They do not sign or send. Any write goes to a human for approval.
- No free-text addresses. The tool takes an address from an allow-list or a lookup the agent cannot edit. It checks the checksum. It never trusts an address the model typed.
- Narrow, typed tools. "Get position for account X at block N" is safer than "run any SQL". Free SQL suits analysts who explore data. Do not give it to an agent that triggers actions.
- Answers carry provenance. Every response includes the block number, timestamp and source table. The agent must repeat them. A human can then check the number.
- Treat chain text as data. Token names, memos and metadata are returned in a field marked as untrusted. They are never placed in the system prompt or agent memory as instructions.
- Verify what moves money. For balances that drive a decision, cross-check against a second source or an
eth_getProofresult before acting. - Log every call. Keep the tool input, output and model response. When something goes wrong, you need the trail.
Buy or build for agents
Vendor MCP servers are a good start for exploration. An analyst can ask Dune or Allium a question in plain language and get a query back. That saves time.
For production agents, a vendor MCP is usually too broad. The better setup puts your own curated tables, with tests and lineage, behind a narrow tool you control. You can still buy the underlying data. The build or buy note covers that choice. The on-chain analytics lakehouse note shows how to build the curated layer. The decoding contracts at scale note covers the decoding step, where most bad answers start.
For the wider market, see the state of Web3 data in 2026.
Where DataBlock fits
I build the curated data layer and the narrow tools that sit between an agent and chain data. The LLM and RAG over financial data page describes that work. The data side is on the on-chain analytics warehouse page. The full offer is at Web3 data.
If you plan to let an agent read or act on chain data, I can review your tool design and data path for the risks above in one call.