SAWP is an open-source protocol and SDK suite designed to empower AI agents with secure, autonomous, and programmable financial capabilities. It defines a unified standard for how agents create identities, subscribe to wallets, sign transactions, and interact with the Solana ecosystemβall while operating within strict, human-defined safety boundaries.
Just as ERC-4337 brought account abstraction to Ethereum, SAWP brings agentic abstraction to Solana, ensuring that security is structural, models are interchangeable, and agents are first-class network citizens.
In SAWP, the wallet is a physical execution daemon (the Execution Plane) that secures keys. The agent is a logical client (the Tooling Plane) that dispatches signed intents. This separation allows you to swap AI models (GPT-4o, Claude 3.5, Local Llama) without migrating your keys or re-writing your logic.
Every transaction intent generated by an AI is subjected to the SAWP Sandbox.
- Policy Engine: Enforces spend limits, network scope, and allowed program IDs.
- NodeSandbox: Wraps execution in an isolated environment with CPU/Memory limiting and timeout protection.
- Observation Plane: Real-time audit logging of every intent, decision, and signature.
Agents are not just scripts; they have DIDs (Decentralized Identifiers). They can discover other agents, verify each other's signatures, delegate permissions, and connect to dApps via the same interfaces used by human wallets.
Experience the protocol in action without setting up a local environment:
Features on display:
- Autonomous Tool Selection: Watch the agent decide which Solana tools to call.
- Real-time Observability: Inspect the sandbox metrics and policy evaluations for every prompt.
- On-chain Action: Execute real Devnet transactions (Airdrops, Transfers, Swaps).
Install the primary orchestration SDK:
npm install @saw-protocol/sdk @saw-protocol/keystore-env @saw-protocol/runtime-openaiimport { SAWP, Agent, generateAgentDID } from "@saw-protocol/sdk";
import { OpenAIRuntime } from "@saw-protocol/runtime-openai";
// 1. Initialize the Execution Plane (Wallet)
const wallet = await SAWP.Wallet.create({
keyStore: new MyCustomKeyStore(),
network: "devnet",
});
// 2. Provision Identity & Authorize
const { did, keypair } = generateAgentDID();
await wallet.authorize({ id: did, did, keypair });
// 3. Synthesize the Agent
const agent = new Agent({
did,
runtime: new OpenAIRuntime({ apiKey: "sk-..." }),
targetWallet: wallet, // Same-process mode
keypair,
});
// 4. Execute
const receipt = await agent.run(
"Check my balance and airdrop some SOL if I'm low.",
);
console.log(receipt.outcome); // 'success'The SAWP protocol operates on a decoupled Intent-Action-Receipt flow. This ensures that the AI never has direct access to private keys, and every decision is verifiable.
- Reasoning: The AI model (Prompt) generates a natural language plan and selects a Tool.
- Intent: The SDK wraps this into a
TransactionIntentcontaining the requested action, parameters, and the AI's internal reasoning. - Policy Check: Before hitting the blockchain, the Policy Plane evaluates the intent against active
PolicyRules(e.g., "Max $50 per swap"). - Sandbox Execution: The intent is passed to the Execution Plane. The logic runs inside the NodeSandbox to prevent CPU spikes or infinite loops.
- Signing & Broadcast: If all checks pass, the Wallet (holding the keys) signs the transaction and broadcasts it to Solana.
- Receipt: An immutable
ExecutionReceiptis generated, hashed, and recorded in the Observation Plane.
To ensure modularity, the protocol is strictly divided into functional planes:
- π‘οΈ Identity Plane: Manages Ed25519-based DIDs for Agents and Wallets.
- π Policy Plane: A stateful engine that evaluates permissions in real-time.
- β‘ Execution Plane: The bridge to the Solana blockchain (Building, Signing, Broadcasting).
- ποΈ Observation Plane: The "black box" recorder providing full auditability.
- π‘ Communication Plane: A secure messaging layer (WebSocket/Local) between Agents and Wallets.
- π Connection Plane: Standardized interfaces for dApps to "Connect Agent Wallet".
- π οΈ Tooling Plane: The catalog of high-level capabilities (DeFi, Staking, NFT) exposed to AI models.
For a comprehensive guide to building with SAWP, please refer to our dedicated documentation:
Complete API reference, implementation flows, and best practices for the SAWP SDK suite.
Technical deep-dives into the 7-plane architectural model:
- Architecture & Vision: The cross-plane design philosophy.
- Protocol Entities: Detailed technical breakdown of Intents and Receipts.
- Interface Contracts: Standardized TypeScript definitions.
- Security & Sandboxing: Execution boundary management.
- Multi-Agent Access: Wallet delegation patterns.
- On-Chain Anchoring: Immutable state recording on Solana.
- Agent Skills: Standardizing capability descriptions for LLMs.
SAWP is built as a modular monorepo. Use only what you need.
| Package | Purpose |
|---|---|
@saw-protocol/sdk |
The unified entry point for all features. |
@saw-protocol/core |
Core interfaces, types, and cryptographic primitives. |
@saw-protocol/policy |
The rule-based permission and spending limit engine. |
@saw-protocol/sandbox |
Process-level execution isolation and timeout management. |
@saw-protocol/builder |
High-level Solana transaction construction. |
@saw-protocol/logger |
Highly configurable logging pipeline for the Observation Plane. |
@saw-protocol/widget |
Premium React components for dApp wallet connections. |
@saw-protocol/runtime-* |
Adapters for OpenAI, Anthropic, and Local models. |
When you initialize a SAWP Agent, it automatically gains access to a robust set of Solana-native capabilities:
- Self-Awareness:
get_my_address,get_my_sol_balance,get_agent_info. - Balance & Accounts:
get_sol_balance,get_token_balance,get_account_info. - Transfers:
solana_transfer,spl_transfer. - DeFi (Jupiter):
get_jupiter_quote,jupiter_swap,get_token_price. - Staking:
stake_sol,unstake_sol. - Network:
estimate_gas_fee,request_airdrop,get_network_stats.
/packages: The core protocol source code./agent-chat-app: The source code for the Live Demo./spec: Comprehensive protocol specifications (Identity through to On-Chain Anchoring)./docs: API references and implementation guides.
If you want to contribute to the protocol or run the chat app locally:
-
Clone & Install:
git clone https://github.com/timileyindev/sawp.git npm install
-
Configure Environment:
cp .env.example .env # Add your OPENAI_API_KEY and optional VITE_RPC_URL -
Run the Suite:
npm run test:harness # Interactive CLI for testing all planes npm run dev # Start the local Agent Chat App
Built for the future of autonomous finance on Solana.
Empowering agents with integrity.