services
Get a key

library / AI and blockchain / SI0015

Model claim checker

A model says an account is owned by one program, or that finalized trails by 32 slots. Turn each statement into one or two chain reads and print HOLDS, CONTRADICTED or UNCHECKED, so you know when it is wrong.

By Carbium · Agent evals · SI0015 · updated 2026-11-22

01

Which claims a chain read can settle

A model is sometimes right and sometimes wrong, and for a large class of statements one RPC call tells you which. What it says about the current state of an account (who owns it, whether it exists, whether it is executable, how many lamports it holds) or about a commitment level is a fact the chain can confirm or contradict. Intent, safety and what happens next have no read behind them.

For an agent eval, turn each sentence the model produces into a small record: what it said, which check settles it, the address and the expected value. The verdict then comes from a read. Read-only model tools covers the input side, tools that let a model read the chain.

What the model saidRead that settles itVerdict rule
This account is owned by program XgetAccountInfoowner equals X
This address is a programgetAccountInfoexecutable is true
This account holds at least N lamportsgetAccountInfolamports is at least N
An account exists at this addressgetAccountInfothe value is not null
Finalized is about 32 slots behindgetSlot at processed and at finalizedthe gap is at least 32

A token balance claim works the same way through getTokenAccountBalance, and SPL token balance reads one. Both are account reads at 10 cells each. getSlot is a cheap cached read at 1 cell.

02

The checker file

One file on @solana/kit 8.6.0 and Node 24, which runs the TypeScript directly. Set CARBIUM_KEY first; the file exits with a message when it is missing. CARBIUM_RPC_URL overrides the endpoint, which defaults to https://services.carbium.sh.

main.ts
// SI0015 · Model claim checker// https://carbium.sh/library/si/model-claim-checker// Copyright (c) Carbium Corporation. MIT License (LICENSE). Keep this notice.// SPDX-License-Identifier: MIT// Model claim checker: test what a model said about Solana state against finalized reads.// Run: CARBIUM_KEY=... node main.ts [claims.json]import { readFileSync } from "node:fs";import { address, createDefaultRpcTransport, createSolanaRpcFromTransport } from "@solana/kit";const key = process.env.CARBIUM_KEY;if (!key) {  console.error("Set CARBIUM_KEY to your Carbium API key.");  process.exit(1);}const url = process.env.CARBIUM_RPC_URL ?? "https://services.carbium.sh";const rpc = createSolanaRpcFromTransport(createDefaultRpcTransport({ url, headers: { "x-api-key": key } }));type Kind = "exists" | "owner" | "executable" | "minLamports" | "finalizedLagAtLeast";type Claim = { say: string; check: Kind; address?: string; value?: string };type Verdict = { ok: boolean; saw: string };const TOKEN = "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA";const USDC = "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v";const SYSTEM = "11111111111111111111111111111111";const WSOL = "So11111111111111111111111111111111111111112";// What a model said, one record per statement; pass a JSON file of the same shape to use your own.const claims: Claim[] = process.argv[2] ? JSON.parse(readFileSync(process.argv[2], "utf8")) : [  { say: "The USDC mint is owned by the SPL Token program", check: "owner", address: USDC, value: TOKEN },  { say: "The SPL Token program is an executable account", check: "executable", address: TOKEN },  { say: "The USDC mint is owned by the System program", check: "owner", address: USDC, value: SYSTEM },  { say: "The USDC mint is an executable account", check: "executable", address: USDC },  { say: "The USDC mint holds at least 1 SOL", check: "minLamports", address: USDC, value: "1000000000" },  { say: "An account exists at the wrapped SOL mint address", check: "exists", address: WSOL },  { say: "Finalized trails processed by about 32 slots", check: "finalizedLagAtLeast", value: "32" },];async function verify(c: Claim): Promise<Verdict> {  const needsValue = c.check === "owner" || c.check === "minLamports" || c.check === "finalizedLagAtLeast";  if (needsValue && !c.value) throw new Error("claim needs a value");  const want = c.value ?? "";  if (c.check === "finalizedLagAtLeast") {    const [processed, finalized] = await Promise.all([      rpc.getSlot({ commitment: "processed" }).send(),      rpc.getSlot({ commitment: "finalized" }).send(),    ]);    const lag = processed - finalized;    return { ok: lag >= BigInt(want), saw: `finalized is ${lag} slots behind processed` };  }  if (!c.address) throw new Error("claim needs an address");  const owner = c.check === "owner" ? address(want) : undefined;  const { value } = await rpc.getAccountInfo(address(c.address), { commitment: "finalized", encoding: "base64" }).send();  if (c.check === "exists") return { ok: value !== null, saw: value ? "account exists" : "no account" };  if (!value) return { ok: false, saw: "no account at that address" };  switch (c.check) {    case "owner": return { ok: value.owner === owner, saw: `owner is ${value.owner}` };    case "executable": return { ok: value.executable, saw: `executable is ${value.executable}` };    case "minLamports": return { ok: value.lamports >= BigInt(want), saw: `${value.lamports} lamports` };    default: throw new Error("unknown check");  }}let wrong = 0;let unchecked = 0;for (const c of claims) {  try {    const v = await verify(c);    if (!v.ok) wrong++;    console.log(`${(v.ok ? "HOLDS" : "CONTRADICTED").padEnd(12)} ${c.say} | ${v.saw}`);  } catch (e) {    unchecked++;    console.log(`${"UNCHECKED".padEnd(12)} ${c.say} | ${(e as Error).message}`);  }}console.log(`${claims.length} claims, ${wrong} contradicted, ${unchecked} unchecked`);

run: node main.ts

With no argument it runs seven built-in claims, four that hold and three that fail. The failing ones say the USDC mint is owned by the System program, that the USDC mint is an executable account, and that finalized trails processed by 32 slots. Pass the path of a JSON file with records of the same shape to check your own. Each output line gives the verdict, the claim, and what the chain showed.

The file builds one rpc object and every check reuses it.

03

Reading the three verdicts

HOLDS means the read agreed. CONTRADICTED means the read answered and disagreed, so the claim is wrong at the commitment you read. UNCHECKED means no answer came back, or the claim record was malformed, such as a bad address or a missing address or value field, and says nothing about the claim.

Keep the third verdict apart from the second. A 429 or a network error means the check did not run. Rerun the unchecked lines later. Scoring them as wrong would blame the model for your own rate limit.

Reads use finalized, set in each account call and in one of the two slot calls, so a verdict rests on the strongest level. One read of both levels can show them equal or briefly out of order, so a lag of 0, or a small negative number, is normal.

A method Carbium does not serve, such as getTokenLargestAccounts, answers -32601 as not served, and a retry gets the same answer. When a model recommends one, record that code from a single call next to the state verdicts, and keep it out of their counts.

04

Claims that were true once

Many wrong answers about Solana are old answers: the model learned the chain as it was, and the chain has changed since. Only the lag one is built into the file; the others need a check of your own or a look by hand.

  • Finalized is far behind. Before the Alpenglow switch finalized trailed processed by about 32 slots, and models still repeat it. Now the gap is 0 to 1. The built-in lag claim fails for that reason.
  • Blocks are full of vote transactions. Mainnet blocks carry no vote transactions since Alpenglow, so advice to filter them out of a block describes the old chain.
  • An address has no earlier transactions. getSignaturesForAddress on Carbium comes from its own address index, which keeps up to 30 days, and the call costs 50 cells. An empty page past that is the age limit of the index, and the address may still have older transactions.
05

Cost

The built-in run makes six account reads at 10 cells each and two slot reads at 1 cell each. Limits are per account and an account's keys share one budget, so a scheduled eval competes with whatever else uses the account.

For many claims about many accounts, getMultipleAccounts charges 10 cells per pubkey and takes up to 300 pubkeys a call on Pro; below Pro the 1,024-cell burst caps a call at 100. It cuts the number of requests and costs the same per account.

06

Where it ends

  • State only. A claim about intent, risk or the future, such as 'this token is safe', has no read that settles it. Keep those out of the claim file or grade them by hand.
  • Owner and executable tell you which program controls an account. Whether that program does what the model says needs its code or its data layout.
  • Every verdict is a snapshot at finalized. A claim that held a minute ago can fail now, and a model that described a transaction it just saw at processed may be right at that level. Store the commitment and the time next to the verdict.
  • History stops at 30 days. A claim about older activity on an address cannot be settled by getSignaturesForAddress here.
  • Method claims are not in the file. To test 'this method exists', make the call and record -32601 as not served.
  • The seven built-in claims are examples with known answers. A real eval needs claims extracted from the model's text, and that step is yours; when a verdict looks wrong, check the extracted record against the model's sentence before you blame the model.
07

When it goes wrong

what goes wrongwhat to do
Every claim comes back UNCHECKED.Read the message after the bar on the line. Check that CARBIUM_KEY holds a valid key and that CARBIUM_RPC_URL, if you set it, points at the endpoint.
A long run hits 429 partway through.Those lines print UNCHECKED. Wait for the retry-after hint and rerun only them. Other keys on the same account spend the same budget.
A lamport claim is unchecked because its value does not parse.The file reads value with BigInt, so write the count as digits, with no commas or decimals. 1 SOL is 1,000,000,000 lamports.
The lag claim passes on one run and fails on the next.Two slot reads hit a moving chain, and finalized can equal processed or show out of order. Grade a lag claim against a threshold well away from 0 and 1, such as 32, and never as an exact number.
The model names a program, such as 'the token program', and the claim holds a name instead of an address.Resolve the name to a base58 address before it enters the claim record. In an owner claim the expected value goes through address() as well, so a string that does not decode fails there and prints UNCHECKED.
08

Questions

Can this tell me whether a model is wrong about a transaction?

For account state, yes. For a transaction's contents, read it with getTransaction at 50 cells and compare the fields it gave. This file has no such check, but it is one more kind in verify.

Why finalized and not confirmed?

A verdict should rest on the strongest level, and finalized now trails processed by 0 to 1 slots. Change commitment in the account call if you grade a claim made about a fresher level.

How do I fail a CI job on a wrong claim?

Set process.exitCode = 1 when the summary shows a contradicted or unchecked count above zero. The file leaves the exit status at 0, so the built-in run, whose summary line reads 3 contradicted, still exits clean.

What happens when the model names an address with no account?

An owner, executable or minLamports claim prints CONTRADICTED with 'no account at that address', since the claim assumed one. An exists claim says so directly.

How do I check a token balance claim?

Add a kind that calls getTokenAccountBalance and compares amount, the raw integer string. It is an account read at 10 cells, and SPL token balance shows the call.