Getting Started with Stellar Agent Guard
Stellar Agent Guard consists of three core repositories working together:
stellar-agent-guard-contracts: Soroban smart contracts implementing custom account abstraction.stellar-agent-guard-sdk: TypeScript library for pre-flight policy interception and agent telemetry.stellar-agent-guard-dashboard: Web-based operator console for policy deployment and freeze management.
System Requirements
- Node.js:
v24.0.0or higher (Node 18 supported viatsx) - Rust:
1.80.0or higher with targetwasm32v1-none - Stellar CLI:
21.0.0or higher (cargo install --locked stellar-cli) - Browser Wallet: Freighter Wallet extension switched to Testnet
🚀 Quick Setup Guide
1. Install the SDK in your AI Agent Project
bash
npm install stellar-agent-guard-sdkIn your agent runtime (e.g. LangChain or ElizaOS):
typescript
import { PreFlightInterceptor } from "stellar-agent-guard-sdk";
import { Keypair } from "@stellar/stellar-sdk";
const interceptor = new PreFlightInterceptor({
rpcUrl: "https://soroban-testnet.stellar.org",
guard: "CAPADGEK457RHKN4RYVUMDJTFHDSG7R5HREQONKLYK7MFKC5WFENPP44",
agent: Keypair.fromSecret(process.env.AGENT_SECRET!),
source: Keypair.fromSecret(process.env.SOURCE_SECRET!),
});
const decision = await interceptor.check({
contractId: "CDCYDGBGS5AZ5BZS6XY2SK2PHJHSOEGTN3N4INCK34KF6GU2BGC7Z6MB",
method: "transfer",
args: [/* from, to, amount */],
});
if (decision.kind === "admissible") {
console.log("Allowed! Resource fee:", decision.estimatedResourceFee);
} else if (decision.kind === "blocked") {
console.log("Blocked by guard:", decision.reason);
}2. Launch the Operator Dashboard
bash
git clone https://github.com/aigbagbobila/stellar-agent-guard-dashboard.git
cd stellar-agent-guard-dashboard
npm install
npm run devOpen http://localhost:3000 in your browser to deploy guard instances, configure policies, and inspect live event streams.
3. Build Contracts Locally (Optional)
bash
git clone https://github.com/aigbagbobila/stellar-agent-guard-contracts.git
cd stellar-agent-guard-contracts
cargo test
cargo build --target wasm32v1-none --releaseNext Steps
- Explore the Architecture Overview to understand how the three layers communicate.
- Read the Contracts Documentation for details on Soroban auth context interception.
- Read the SDK Guide for framework integration hooks.
- Read the Dashboard Documentation for operator control workflows.
