probarion
v0.1.2
Published
Probarion CLI: dry-run spends, verify a vault's ledger, anchors, attestation records and keys, audit any NEAR account's access keys and code, prove a transaction's outcomes with light_client_proof, print the owner and approver transactions of a vault for
Readme
probarion (CLI)
The command line for Probarion, a mandate layer for AI agents on NEAR: spend by mandate, prove every payment.
Unaudited beta. Versions 0.x may change the commands in a minor release. MIT licensed.
The owner of a vault does the sensitive things: create the vault, set a mandate, add or remove an
agent key, freeze, withdraw, approve a held payment. This CLI does not sign any of them. For each one
it checks your input against the contract's own rules, writes the arguments to a JSON file and prints
the matching near-cli-rs command, so that you review the
arguments and sign with your own wallet, keychain or Ledger. Where the vault requires exactly 1
yoctoNEAR, the printed command carries it.
Three commands only read: check dry-runs a spend against the vault's own rules, verify checks a
vault's ledger against the chain (or a saved snapshot, with no network at all), and ledger export
copies the ledger. They do not sign or send anything either. Nor do payee check, account audit and
tx prove, which are in the CLI from release 0.1.2 on, and in a build of this repository; release 0.1.1
on npm does not have them.
Install
npm install -g probarion
probarion --helpOr run it without installing: npx probarion --help. Node 24 or newer. You also need near-cli-rs
(the near command) to sign what the CLI prints.
To build it from source instead, from a clone of the repository (pnpm 10):
git clone https://github.com/probarion/probarion.git
cd probarion
pnpm install --frozen-lockfile
pnpm build
node packages/cli/dist/bin.js --helpIn the repository folder, node packages/cli/dist/bin.js is the probarion command of the examples
below.
Commands
probarion agent keygen --out agent-key.json # saved with owner-only access, not overwritten if it exists; prints the public key
probarion agent keygen --print-secret # prints the secret key to this terminal instead
probarion vault create --name acme --approvers cfo.testnet --daily-backstop 500 --held-ttl-hours 72
probarion mandate create --vault acme.vaults.probarion.testnet --payee near:vendor.testnet \
--max-per 100 --max-total 1000 --uses 10 --expires 2026-12-31 --approval-above 50 \
--agent-pk ed25519:... --purpose po.pdf --label "Contractor"
probarion mandate revoke --vault <vault> --mandate 1
probarion agent add --vault <vault> --pk ed25519:... --allowance 1
probarion agent remove --vault <vault> --pk ed25519:...
probarion ledger set-key --vault <vault> --pk ed25519:...
probarion spend approve --vault <vault> --spend 3 # printed for an APPROVER to sign
probarion spend reject --vault <vault> --spend 3
probarion vault freeze --vault <vault> # printed with no deposit
probarion vault unfreeze --vault <vault>
probarion vault withdraw --vault <vault> --amount 25
probarion vault withdraw-intents --vault <vault> --token base --amount 25--vaultfalls back toPROBARION_VAULT_ID.--network mainnet|testnetfalls back toNEAR_NETWORK, thentestnet.--rpctakes comma-separated URLs and falls back toNEAR_RPC_URLS.--sign-as <account>puts the signer into the printed command, and--out-dir <dir>chooses where the arguments file goes. The file is named after the method and the hash of its content, so a command you printed earlier keeps pointing at the arguments you reviewed.- Amounts are in USDC with up to 6 decimals (
--max-per 100is 100 USDC). Deposits and allowances are in NEAR. A mandate's payee is fixed once it exists: a new payee needs a new mandate. - A mandate payee is
near:<account>,base:<0x address>orsolana:<address>.--purposeis a PO or contract file that is hashed with sha256, or a 64-character hex hash. - The printed command ends with
sign-with-keychain send. For a Ledger, replace that withsign-with-ledger usb send. Run it in bash, zsh or PowerShell, notcmd.exe.
Keys
agent keygen needs one of two flags. --out <file> saves the key pair to a file with owner-only
access (on Windows the folder's permissions apply, and the CLI says so), does not overwrite an
existing file and prints the public key only. It warns when the file is inside a git repository, so
make sure the file is ignored and not tracked. --print-secret prints the secret
to the terminal, where it stays in your scrollback. Give the public key to the vault owner, who adds
it with agent add (for the agent's spend key) or ledger set-key (for the key that signs the
ledger and anchors it). Keep the secret on your server and out of the repository.
Check a spend, verify a vault
probarion check --vault <vault> --mandate 1 --amount 25 --invoice invoice.txt --ref INV-002
probarion verify --vault <vault>
probarion verify --vault <vault> --snapshot snapshot.json # also saves the snapshot it verified
probarion verify --offline snapshot.json # checks a saved snapshot, with no network
probarion verify --vault <vault> --online # adds O1 and O2 to check e
probarion verify --offline snapshot.json --invoices <dir> # adds A8 to check e (not in 0.1.1)
probarion verify --vault <vault> --burn-tx 2=<tx hash>@<approver account>
probarion verify --vault <vault> --proof evidence.json
probarion ledger export --out ledger-copy.jsonlTo try verify with nothing set up, run it on the TEST FIXTURE snapshot in a clone of the repository
(after pnpm install and pnpm build). It needs no network and no keys, and exits 0:
node packages/cli/dist/bin.js verify --offline packages/core/test/fixtures/valid-snapshot.jsonProbarion verify: x.vaults.probarion.testnet (testnet)
entries 5, anchors 3, generated 2026-11-03T09:41:13.810Z
snapshot taken 2026-11-05T12:00:00.000Z: its chain data is the file's and was not read from the chain again
a ledger-signatures PASS 5 entries: each body_hash recomputes from its body and carries a valid signature by the ledger key ...
b hash-links PASS 5 entries: every body_hash and link recomputes, chained from the zero link
...
h burn-memos PASS 1 burned spend has a matched burn pair: the POA ft_burn memo is WITHDRAW_TO:<destination address> ...
i factory-version PASS created by vaults.probarion.testnet at version 1
9 passed, 0 failed, 0 unproven
RESULT: PASS(Rows c to g and the ends of the long details are cut here.)
check
check asks the vault's free check_spend view whether it would accept a spend, and prints
OK: the vault would accept this spend. (with and hold it for an approver above the mandate's
approval threshold) or REFUSED: PROBARION:<Code>, for example OverPerPayment or
DuplicateInvoice. --json prints the request, the signer and the verdict.
--invoicetakes the extracted invoice text, the text the agent processes, as a UTF-8 file. Itsinvoice_hashis computed the way the SDK computes it. A file that is not UTF-8 text (a PDF, a scan) is a usage error (exit 64): extract its text first.- The check runs as
--agent-pk, else as the public key ofPROBARION_AGENT_KEY, else as the mandate's agent. Only the public key is printed. --refis 1 to 64 bytes. The vault refuses a ref or an invoice it has already seen.
| Exit code | check |
|---|---|
| 0 | the vault would accept the spend (it may hold it for an approver) |
| 1 | the vault would refuse it, or the check could not run (error: on stderr) |
| 64 | usage error: a missing, malformed or conflicting flag, or an --invoice that is not UTF-8 text |
verify
verify runs the nine checks of the verifier on the vault's chain state and your ledger file:
ledger signatures (a), hash links (b), anchors (c), a decision for every spend (d), attestations (e),
the vault's keys and code (f), its intents keys (g), the burn of every cross-chain payout (h) and the
factory version (i). It prints one row per check with what it found, then the counts and the result.
--json prints the report instead.
| Exit code | verify |
|---|---|
| 0 | every check passes |
| 1 | a check fails (a fail always wins over unproven), or verify could not run (error: on stderr, no RESULT line) |
| 2 | no check fails, but at least one is unproven |
| 64 | usage error: a missing, malformed or conflicting flag, an --invoice, --system-prompt file or --invoices folder that cannot be read, a folder with no .txt file, or an invoice or prompt file that is not UTF-8 text |
UNPROVEN is not a pass. It means that verify could not look at what a check needs. Today only check h can be unproven: a payout's burn is in a transaction that verify did not read. The row lists the spends, the reason and what to do:
h burn-memos UNPROVEN 0 of 1 burned spend has a proven burn pair; not proven, so the report is not ok: ...
unproven: spend 2 (approver_tx): supply the burn tx with --burn-tx or --proof
8 passed, 0 failed, 1 unproven
RESULT: UNPROVEN (no check failed; what the UNPROVEN rows name is not proven)| Reason | What happened | What to do |
|---|---|---|
| approver_tx | a held payout that an approver paid: its burn is in the approver's tx, which your ledger does not record | --burn-tx or --proof |
| not_recorded | a spend bound to its decision, with no payment entry naming its tx | --burn-tx or --proof |
| pre_ledger_no_tx | a mainnet v0 spend from before the ledger, with no tx supplied | --burn-tx or --proof |
| tx_unavailable | the tx could not be read right now: no node gave a definite answer (for example, the archival node was unreachable) | re-run, or add --archival-rpc |
The flags:
--burn-tx <spend_id>=<tx hash>[@<signer>]names a transaction that holds a spend's burn, for example the approver'sapprovetx. It can be repeated. verify still reads each transaction and looks for the burn in it: when none of the transactions it reads holds the burn, check h fails. A malformed value exits 64.--proof <file>takes the vault's transactions from an evidence file in the format ofdocs/mainnet-proof.json. They are tried after the--burn-txones. Without--proof, verify reads no evidence file, not even adocs/mainnet-proof.jsonin the working directory. A--prooffile that is not there is an error.--archival-rpc <urls>is the archival node used for burn transactions older than about 2.5 days. It defaults toNEAR_ARCHIVAL_RPC_URLS, else FastNEAR's archival node.--onlinealso runs O1 and O2 on every attested decision and looks burns up in FastNEAR's transaction index. O1 checks that the TDX quote is DCAP-genuine and bound to this request; the measurement is not pinned yet, so O1 does not show which image the TEE runs. O2 checks that the GPU payload carries the request nonce and that NVIDIA NRAS verifies it. Check e's row says how many quotes and GPU payloads were checked.- What it needs: the network, and
@nearai/inference-sdk.probarionlists that package as an optional dependency, sopnpm installin the clone installs it too, unless it cannot (an optional dependency that fails to install is left out). The package declares Node 24.22.1 or newer. - When the package cannot be loaded, verify prints
online: O1 and O2 did not run (<reason>), in the report and on stderr, and check e keeps its offline result. - When O1 or O2 ran, the report adds an
online legendline that says what each one checks. When there was nothing to check (no attested decision, or no GPU payload), it says that O1 and O2, or O2, did not run. - When O2 fails because NVIDIA's token is
not_yet_validby this computer's clock (a few seconds behind is enough), check e fails and the report adds anonline hintline: sync the clock and run again. The line also goes to stderr aswarning: online hint: ...; with--json, stderr is the only place it appears.
- What it needs: the network, and
--invoice <file>and--invoices <dir>are in the CLI built from this repository, from release 0.1.2 on; release 0.1.1 on npm does not have them.probarion --versionprints the version you run, andprobarion verify --helplists--invoiceswhen it has them. Each names invoice texts you hold:--invoiceone file (it can be repeated),--invoicesevery.txtfile of a folder, not its subfolders. With them, check e also runs A8 on each attested decision whoseinvoice_hashis the sha256 of a file's bytes: it rebuilds the request the model was sent from that text and checks its hash. They work live and with--offline. verify reads the files on this computer and uses them for A8 only: it sends them nowhere, does not write them to--snapshot, and prints file names, not their text (--jsonadds aninvoiceslist with each file's sha256 and the ledger entries it matches). A file that matches no attested decision is listed under the rows and on stderr, and does not fail the run; an edited copy of an invoice has another sha256, so it is one of these. A file that cannot be read or is not UTF-8 text, or a folder with no.txtfile, exits 64.--system-prompt <file>(repeatable, with--invoiceor--invoices, and like them not in 0.1.1) adds a system prompt that A8 accepts. Without it A8 accepts only the standard prompt (PROPOSAL_SYSTEM_PROMPT), so a decision made under another prompt, for example an agent'smodel.systemPromptsuch as the Canary's persona, fails A8. The file must hold the prompt's exact text: a trailing newline is part of it. The ledger shows each prompt inrequest_inputs.system_prompt, but A8 accepts only the standard prompt and the ones you give.--snapshot <file>writes the snapshot that was verified to a new file. It refuses a file that already exists, and the ledger file under any name (exit 64).--offline <file>verifies such a snapshot as it is, with no network, so it refuses--vault,--ledger,--evidence,--burn-tx,--proof,--archival-rpc,--online,--rpcand--network. It runs every check on what the file holds: it shows that the ledger and the chain data recorded in the snapshot agree with each other, as of the time the snapshot was taken (the report prints it). It does not read the chain, so it takes the file's chain data as it is. A snapshot whosevault,networkortaken_atis malformed is refused (exit 64), and the human report shows control characters from a snapshot as�(U+FFFD) rather than passing them to the terminal.--ledger <path>is the ledger file. It defaults toPROBARION_LEDGER_PATH, else.probarion/ledger.jsonl; an emptyPROBARION_LEDGER_PATHcounts as unset. verify warns when the file is not there, and then fails the spends it cannot bind to a decision.--evidence <dir>(defaultdocs/evidence) holds the Day-4 decision records ofv0.probarion.near, whose first spends predate the ledger. It is read for that vault on mainnet only. Run verify from the repository, or pass the directory: without the records, check d fails those spends.
ledger export
ledger export --out <file> writes the ledger as JSONL, one entry per line. It reads the same
--ledger file as verify. It refuses an --out file that already exists, and the ledger itself.
Check a payee
payee check is in the CLI from release 0.1.2 on, and in a build of this repository; release 0.1.1
on npm does not have it. It reads the chain and prints ALLOW, WARN or BLOCK for one payee,
with one reason per check. Run it before you write a payee into a mandate: the agent's spend call
has no address field, so a mandate is where a payee enters. The examples run a clone's build; with
the CLI from npm, at 0.1.2 or later, write probarion in place of node packages/cli/dist/bin.js.
node packages/cli/dist/bin.js payee check near:vendor.testnet --vault <vault>
node packages/cli/dist/bin.js payee check base:0x... --network mainnet --vault <vault> --json| Check | Finding | Level |
|---|---|---|
| exists | no NEAR account by that name | block |
| exists | an implicit account (64 hex, or 0x and 40 hex) with no funds yet (a transfer creates it) | warn |
| blocklist | on the seed list, packages/core/src/payee-blocklist.json | block |
| lookalike | looks like a payee of --vault: the same first 4 and last 4 characters (Base and implicit NEAR hex, lowercased; Solana in exact case), one or two edits apart (account ids of 6 characters or more, counting the .near or .testnet ending, so nearly every named account), or the same after reading rn as m, l as 1 and o as 0 | block |
| contract | the NEAR code hash is not 1111…1, or Base eth_getCode is not 0x (a Safe is a contract too) | warn |
| new | NEAR: no account at a block about 7 days back, on FastNEAR's archival node. Base: nonce 0, a weaker sign (no transaction sent yet; a nonce does not show age) | warn |
| code changed | NEAR: the code differs from the block about 7 days back | warn |
| past payments | the vault has not paid it before: set --approval-above 0 on its mandate | warn |
- A check that passes adds an info line, so the output says what was read. A read that fails or
times out (3 seconds a request, 15 seconds in all) is unknown, and an unknown is a warning: the
check does not answer
ALLOWon a read it could not make. - Without
--vault(orPROBARION_VAULT_ID), past payments and lookalikes are not checked, and that is a warning too. Solana payees are not read, and Base is read on mainnet only (a testnet vault pays Base through a stub), so those checks are unknown there. - Two payees of one vault that look alike block each other. The owner can still sign the mandate: the check changes nothing on chain.
- The blocklist is a seed. Today it holds two testnet names that Probarion's own eval cases and test fixtures use as the attacker's account. Probarion does not hold them, neither had an account on testnet on 2026-11-13 UTC, and neither has a report of wrongdoing. To add a payee, open a pull request to that file with public evidence (the "Report a payee" issue form says what to include).
- The verdict is advice for the owner and changes nothing on chain.
--archival-rpcand--base-rpcchoose the nodes it reads.
| Exit code | payee check |
|---|---|
| 0 | allow: every check passed |
| 2 | warn: confirm something with the payee first, or a signal could not be read |
| 1 | block, or the check could not run (error: on stderr) |
| 64 | usage error: a malformed payee or flag |
Audit an account, prove a transaction
account audit and tx prove are in the CLI from release 0.1.2 on, and in a build of this
repository; release 0.1.1 on npm does not have them. As above, the examples run a clone's build, and
the CLI from npm, at 0.1.2 or later, runs them as probarion. They run the NEAR primitives of
@probarion/near on any NEAR account
or transaction, read views and proofs over JSON-RPC, and sign nothing.
node packages/cli/dist/bin.js --network mainnet account audit v0.probarion.near --vault-policy
node packages/cli/dist/bin.js --network mainnet tx prove BdN7oB76hAv1o5iAGsyszQx6S5NwEuerYDsWguRbrSQ9 --signer v0.probarion.nearaccount audit <account> reads view_account at the final block and view_access_key_list at that
block, and says what each access key can do if it leaks: full access, receiver and methods, the
allowance for gas, and gas keys. A permission it cannot read counts as full access. It also reads the
account's code identity (its own code, or a NEP-591 global contract by hash or by publisher account)
and, with --builds <file> (a code-hashes record such as contracts/code-hashes.json, or a list),
whether the code is a recorded build. The output names the block it read.
--vault-policyholds the account to a Probarion vault's keys: function-call keys on the account itself forspendoranchor, each with a limited allowance and no gas key, and the code to the recorded vault builds (KNOWN_VAULT_CODE_HASHESof@probarion/core; for a factory vault on a factory version outside that list, pass the factory's builds with--builds). It does not pin the anchor key to the vault's ledger key, and says so:probarion verify(check f) does.--jsonprints the report, with amounts as decimal strings.
tx prove <tx-hash> --signer <account> reads the head block on one RPC origin and matches its hash,
height and block_merkle_root on another, reads the transaction, then fetches a light_client_proof
for it and for every receipt it led to, and verifies each one under that head. It prints each proven
outcome (id, executor, the block that commits it, status) with the NEP-297 events it logged. A failed
receipt is proven too, as a failure. A tx answer that leaves out a receipt a proven outcome created is
refused.
--head-rpc <urls>takes URLs on at least two origins (default:--rpc,NEAR_RPC_URLS, then the network defaults); testnet's defaults are on one origin, so give two there.--archival-rpc <urls>chooses the archival nodes for the transaction and its proofs (default:NEAR_ARCHIVAL_RPC_URLS, then FastNEAR's archival node).- The head is trusted, not proven: validator signatures are not checked. Two providers run by different operators lower that trust; they do not remove it. The output names the origins it read.
- An event speaks for a token when its executor is that token's contract; the output says so.
--jsonprints the head, the origins and the proven outcomes, with amounts as decimal strings.
| Exit code | account audit | tx prove |
|---|---|---|
| 0 | locked, and the policy and the recorded build match when given | proven: the transaction and every receipt it led to |
| 2 | locked, with a warning to read (a key for any method, an unlimited allowance) | |
| 1 | not locked, a blocking finding, or the account could not be read (error: on stderr) | not proven (a proof did not verify, or the tx answer left out a receipt), the two head providers disagree, or a read failed (error: on stderr) |
| 64 | usage error: a malformed account or flag, or a --builds file that cannot be read | usage error: a malformed hash, account or flag, or head URLs on fewer than two origins |
