Sandboxed spending policies, real-time rate limits, and on-chain budgets for autonomous AI Agents on Solana.
Built with Anchor 1.0.2, Token-2022 compatibility, and designed natively for the HTTP 402 Payment Required agentic micro-payment standard.
Traditional AI Agents are treated like humans from 2010—forced to use shared corporate credit cards, centralized SaaS portals, or vulnerable pre-funded API keys. If the agent's environment is compromised, the developer's entire capital pool is drained instantly.
SolAgent Vault introduces the concept of On-Chain Sandboxed Budgets:
- Double-Isolated PDA Vaults: USDC is deposited into an Associated Token Account (ATA) owned by an
AgentStateProgram Derived Address (PDA). Only our Anchor program can release these funds. - Throwaway Hot-Keys: The AI Agent is equipped with a local keypair (
agent_signer) holding almost 0 funds (just a tiny SOL gas allocation). - On-Chain Policy Guards: Before a single transaction is signed, the smart contract verifies 5 strict, real-time safety limits on the blockchain.
Every spend call executes these strict checks sequentially inside the smart contract:
- Active Status: Instantly halts all transactions if the developer pauses the agent.
- Target Allowlist: Restricts payments only to pre-approved API provider wallets (empty allowlist = open access).
- Single-Call Cap: Enforces a maximum spend limit per individual request.
- Rolling Per-Minute Rate Limit: Uses a sliding time-window on-chain to restrict spending velocity, preventing infinite prompt-injection loops.
- USDC Balance Verification: Ensures the sandboxed vault has enough USDC to execute.
We have designed a native SKILL.md file that acts as the cognitive instruction manual for LLMs (like Qwen on Ollama or GPT-4o). The AI agent ingests this markdown file to automatically:
- Understand its smart contract capabilities.
- Access JSON schemas for tool-calling.
- Implement the HTTP 402 Intercept Protocol (intercepting paywalls, executing Solana payments, and retrying).
├── programs/solagent-vault/src/ # On-Chain Smart Contract Layer (Rust)
│ ├── instructions/ # Decoupled semantic instructions
│ ├── errors.rs # Custom VaultError codes
│ ├── state.rs # PDA data schemas (VaultState, AgentState)
│ └── lib.rs # Program declaration & modular entrypoints
├── app/ # Next.js 15+ & React 19 Frontend Dashboard DApp
├── scripts/ # Off-chain TS AI Agent Interceptor Simulator
├── tests/ # Comprehensive TS integration test suite
├── SKILL.md # LLM-readable system instructions & tool schemas
└── Anchor.toml # Workspace & Program ID configurations
yarn install
# and install frontend dependencies
cd app && npm install && cd ..anchor buildRun the 10 integration tests against the configured local or devnet provider:
anchor testRun the live off-chain simulator demonstrating an LLM intercepting an HTTP 402 paywall and executing a spend under the guardrails:
yarn simulateStart the Next.js developer console:
cd app
npm run devOpen http://localhost:3000 to view your real-time visual control panel!
- Solana Devnet Program ID:
C5pqn3tYpivcZiQUhSbXeozSxZQ35P9e7VQTWzvRxr7o - Vercel Live Dashboard DApp: (Your Vercel URL)