Documentation
AgentVault is a treasury & budget protocol for autonomous AI agents on Solana. Fund a USDC vault once, register agents with per-task spending caps, and get an on-chain receipt for every payment — with an instant kill switch for any agent.
Overview
An organization deploys a vault — a USDC token account owned by an on-chain program. AI agents draw from that vault within limits you set. You never hand a private key to autonomous code: agents are registered as on-chain records with a per-task budget that is checked before every payment.
- Agent treasury — one USDC vault backs many agents.
- Per-agent budgets — a per-task spending cap enforced on-chain.
- Kill switch— instantly revoke a single agent's spending access.
- On-chain receipts — every payment writes a verifiable record PDA.
How it works
- 01
Fund the vault
Deposit USDC into a vault PDA you own. One vault can back many agents.
- 02
Register agents
Add each agent with a per-task budget cap and a role. You stay the authority.
- 03
Agents pay on-chain
Agents draw from the vault within their cap. Each payment is a real Solana transaction.
- 04
Audit every receipt
Every payment leaves a PaymentRecord PDA you can verify on Solana Explorer.
The kill switch is the deactivate_member instruction: it flips an agent to inactive so it can no longer be paid, while preserving its full payment history.
Architecture
AgentVault is a single Anchor program. All state lives in Program Derived Addresses (PDAs) seeded so they are deterministic and ownerless.
Program ID: 8g5hMx6AwTUFCrKwuaCfDY468qE4bbHiw8BvdiepUJdo
Program instructions
Quickstart (CLI)
Install the SDK + CLI globally:
npm i -g @agentvault/sdk
Create and fund a vault, register an agent, then pay it:
# Create a vault you own agentvault create-vault --name "My Agent Swarm" # Fund it with USDC agentvault fund --amount 1000 # Register an agent with a per-task budget cap agentvault register --role "Research Agent" --limit 50 # Pay an agent from the vault (writes an on-chain receipt) agentvault pay <AGENT_WALLET> --amount 5 --memo "API call batch" # Kill switch — revoke an agent instantly agentvault kill <AGENT_WALLET> # Inspect on-chain state agentvault status agentvault receipts --limit 10
Run agentvault --help (or agentvault <command> --help) for every flag. By default the CLI uses your Solana keypair at ~/.config/solana/id.json.
SDK (TypeScript)
The same operations are available programmatically via the AgentVault class. Amounts are in raw USDC units — 6 decimals, so 1 USDC = 1_000_000.
import { AgentVault } from "@agentvault/sdk";
const av = new AgentVault({
rpc: "https://api.devnet.solana.com",
wallet: "~/.config/solana/id.json", // path or a web3.js Keypair
// programId is optional — defaults to the deployed program
});
// --- Write ---
await av.createVault("My Agent Swarm");
await av.fundVault(1_000_000_000); // 1,000 USDC
await av.registerAgent(agentWallet, "Research Agent", 50_000_000); // 50 USDC cap
const receipt = await av.pay(agentWallet, 5_000_000, "API call batch");
await av.killAgent(agentWallet); // kill switch
// --- Read ---
const team = await av.getTeam(); // vault config + balance
const agents = await av.getAgents(); // registered agents
const budget = await av.getAgentBudget(agentWallet);
const receipts = await av.getReceipts(); // on-chain payment historypay() returns a PaymentReceipt with the transaction signature and runs any registered connector hooks (see below).
Connectors
Connectors hook into the payment lifecycle — run checks before a payment and side effects after one (webhooks, logging, framework glue). Built-in connectors:
agentvault connector:add --type monitoring --name webhook \
--config '{"url":"https://example.com/hooks/agentvault"}'
agentvault connector:listUsing the app
Network & config
The frontend reads on-chain data using these values, all overridable via environment variables:
The IDL is served publicly at /api/idl so the deployed program's interface is always inspectable.
Token
AgentVault vaults are funded in USDC — you do not need the community token to use the protocol. Value accrual (fee capture, buyback & burn, staking rewards) is on the roadmap and ships as auditable on-chain code.