Skip to content

Getting Started with Stellar Agent Guard ​

Stellar Agent Guard consists of three core repositories working together:

  1. stellar-agent-guard-contracts: Soroban smart contracts implementing custom account abstraction.
  2. stellar-agent-guard-sdk: TypeScript library for pre-flight policy interception and agent telemetry.
  3. stellar-agent-guard-dashboard: Web-based operator console for policy deployment and freeze management.

System Requirements ​

  • Node.js: v24.0.0 or higher (Node 18 supported via tsx)
  • Rust: 1.80.0 or higher with target wasm32v1-none
  • Stellar CLI: 21.0.0 or 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-sdk

In 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 dev

Open 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 --release

Next Steps ​