Skip to content

About

Autonomous, sub-millisecond Solana security agent for real-time threat interception and vault protection.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

Β 

History

19 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ›‘οΈ SolAgent Sentinel

Autonomous AI Agent & Blinks Security Runtime Protocol for Solana
Built for the Colosseum Hackathon β€” Crypto World's Fair (Fall 2026)

Live Demo Solana Devnet Colosseum Hackathon Next.js 14 Anchor Framework License: MIT

πŸš€ Live Production URL: https://solagent-sentinel.vercel.app
πŸ”— GitHub Repository: https://github.com/camesenin/solagent-sentinel


🌐 The Problem: Autonomous Agents & Blinks Attack Surface

⚑ The Alpenglow Paradigm Shift (~150ms Finality):
With Solana's activation of Alpenglow, transaction confirmation and consensus finality drop from ~12.8s to 150 milliseconds. In a sub-second finality world, post-execution reactive monitoring is dead: once an autonomous agent executes a malicious instruction or signs a poisoned payload, funds are permanently and irreversibly drained in a fraction of a heartbeat. Security must be strictly pre-action, pre-signature, and sub-30ms deterministic.

As AI Agents (via Solana Agent Kit, Eliza, LangChain) and Solana Actions & Blinks gain explosive adoption, they introduce the most dangerous attack vector in Web3:

  1. Rogue AI Delegations: If an autonomous trading agent consumes a poisoned prompt or untrusted state, it can blindly sign malicious drainer instructions.
  2. Hidden CPI Drainers: Ordinary users click an innocent Blink button ("Claim Free Airdrop"), while an obfuscated Cross-Program Invocation triggers SetAuthority or unlimited ApproveChecked, granting attackers permanent ownership of their token accounts.
  3. Cryptic Wallet Warnings: Standard wallets display unreadable hexadecimal parameters (Program: TokenkegQfe... Instruction 6), forcing users to sign in the dark.

πŸ’‘ The Solution: SolAgent Sentinel

SolAgent Sentinel is an open-source, deterministic pre-action security shield and attestation protocol that:

  • Sub-30ms Wire Buffer Decompilation: Evaluates raw transaction buffers in under 30msβ€”well within Solana's block processing envelopeβ€”intercepting SetAuthority hijacking, unlimited allowances, and domain spoofing before private keys are ever commanded to sign.

  • Solana Mobile & Seeker Ready: Engineered for mobile-first agent authorization via Seeker Connect, enabling seamless one-tap cryptographic approvals and physical hardware enclave oversight without generic MWA friction.

  • Default-Deny Fail-Safe Engine: Operates under strict zero-trust parametersβ€”if an RPC simulation times out or unknown instructions fail invariant checks, the transaction is rejected off-chain with zero state mutation.

  • Deconstructs Transaction Wire Buffers: Intercepts instructions before signing to detect SetAuthority hijacking, unlimited allowances, and domain spoofing directly from serialized payload opcodes.

  • Provides a 360Β° Dual Perspective:

    • Modo Usuario ComΓΊn: Human-readable translation with a traffic-light security badge (🟒 Safe / 🟑 Warning / πŸ”΄ Blocked) and visual balance simulation.
    • Modo Auditor / Ingeniero: Deep instruction hierarchy, raw accounts, writable/signer privilege maps, and Anchor IDL signatures.
  • On-Chain Attestation Registry: An Anchor smart contract architecture designed for Solana (Devnet/Mainnet) to record security audit hashes and blacklist malicious threat signatures via Program Derived Addresses (PDAs).


πŸ—οΈ System Architecture

flowchart TD
    subgraph Input["1. Input Source"]
        B1["Solana Blink / Action URL"]
        A1["Autonomous AI Agent Payload"]
        T1["Raw Transaction (Base64)"]
    end

    subgraph Sentinel["2. SolAgent Sentinel Engine"]
        P1["Wire-Format Instruction Decompiler"]
        R1["Anti-Drainer Rules Engine (SetAuthority / Approve)"]
        S1["Simulated Balance State Evaluator"]
        K1["Risk Scorer (0 - 100)"]
    end

    subgraph Perspectives["3. 360Β° Output Interfaces"]
        U1["πŸ‘€ Modo Usuario ComΓΊn<br/>(SemΓ‘foro, Lenguaje Natural, +/- Balances)"]
        D1["πŸ”¬ Modo Auditor<br/>(Instrucciones, Permisos, Hex/JSON)"]
        API["πŸ€– Agent Guard API<br/>(Pre-flight Middleware)"]
    end

    subgraph OnChain["4. Solana Architecture"]
        REG["Anchor Sentinel Registry<br/>(PDA Attestations & Blacklist)"]
    end

    Input --> Sentinel
    Sentinel --> Perspectives
    Sentinel --> REG
Loading

πŸš€ Quick Start

Prerequisites

  • Node.js >= 18.x
  • Rust & Cargo (for Anchor smart contract)
  • Solana CLI (optional, for devnet deployment)

1. Installation

git clone https://github.com/camesenin/solagent-sentinel.git
cd solagent-sentinel
npm install

2. Run the Interactive Web Inspector

npm run dev

Open http://localhost:3000 to view the live dashboard, test case simulator, and dual-perspective inspector.

3. Production Build

npm run build
npm run start

πŸ“¦ Repository Structure

solagent-sentinel/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ app/                    # Next.js 14 App Router (Pages & Metadata)
β”‚   β”œβ”€β”€ components/             # Dual-perspective UI components
β”‚   β”‚   β”œβ”€β”€ SecurityShieldBadge.tsx  # Color-coded traffic light shield
β”‚   β”‚   β”œβ”€β”€ UserViewCard.tsx         # Plain-language explanation for everyday users
β”‚   β”‚   β”œβ”€β”€ AuditorViewCard.tsx      # Deep AST & instruction inspector for auditors
β”‚   β”‚   β”œβ”€β”€ BalanceSimulationWidget.tsx # Live visual incoming/outgoing delta
β”‚   β”‚   β”œβ”€β”€ LiveInspector.tsx        # Interactive scanner for Blinks & Payloads
β”‚   β”‚   └── AttackSimulator.tsx      # Step-by-step AI Agent firewall simulation
β”‚   └── lib/
β”‚       └── sentinel-core/      # Core deterministic cryptographic engine
β”‚           β”œβ”€β”€ types.ts             # Security audit report interfaces
β”‚           β”œβ”€β”€ drainerRules.ts      # SetAuthority and CPI drainer detection
β”‚           β”œβ”€β”€ instructionParser.ts # Transaction AST deconstruction
β”‚           β”œβ”€β”€ riskScorer.ts        # Multi-factor score calculator (0-100)
β”‚           β”œβ”€β”€ humanTranslator.ts   # Plain language narrative generator
β”‚           └── mockTransactions.ts  # Authentic battle-tested test scenarios
└── anchor/
    β”œβ”€β”€ Anchor.toml             # Anchor configuration (Devnet)
    └── programs/
        └── sentinel_registry/  # Smart contract in Rust
            └── src/lib.rs      # Global registry & attestation recorder

πŸ§ͺ Automated Security & Audit Suite (19/19 Passing)

Reproduce all deterministic heuristic and cybersecurity penetration tests locally:

# 1. Run Functional E2E Scenario Suite (Jupiter swap, Drainers, Token-2022)
node sentinel_audit_suite.js

# 2. Run Dedicated Anti-Exploit Suite (SSRF Firewall, DoS payload limits, Math guards)
node sentinel_security_vulnerability_audit.js

# 3. Run Micro-Benchmark Suite (<0.05ms deterministic instruction evaluation)
node autonomous_agent_integration_benchmark.js

See BENCHMARK.md for detailed performance methodology, hardware specifications, and reproducible stress metrics.


πŸ€– SentinelGuard SDK for AI Agents (ElizaOS & Solana Agent Kit)

Integrate SolAgent Sentinel into any autonomous AI agent before broadcasting transactions:

import { SentinelGuard } from '@/lib/sdk/sentinelGuard';

const guard = new SentinelGuard({
  rpcUrl: 'https://api.devnet.solana.com',
  policy: {
    autoAbortCritical: true, // Block malicious drainers in <35ms
    maxAllowedRiskScore: 60,
  }
});

// Middleware interceptor before agent signing
const audit = await guard.verifyTransaction(serializedAgentTx);

if (!audit.verdict.isApproved) {
  console.error(`πŸ›‘ Transaction Aborted: ${audit.verdict.actionNotice}`);
  throw new Error(`Sentinel Security Firewall: ${audit.humanSummary.actionHeadline}`);
}

// Proceed safely with wallet signing
await agentWallet.signAndSendTransaction(tx);

πŸ† Colosseum Hackathon Details

  • Hackathon: Cypherpunk / Crypto World's Fair (Fall 2026)
  • Organized by: Colosseum & Solana Foundation
  • Track: AI Agents & Infrastructure / Blinks
  • Lead Builder: Carlos Mesen (@camesenin)
  • Production Deployment ($0): https://solagent-sentinel.vercel.app
  • Pitch Video (1080p MP4): Available in docs/solagent_sentinel_pitch.mp4

πŸ“„ License

MIT License. Open source and freely extensible by the Solana community.

About

Autonomous, sub-millisecond Solana security agent for real-time threat interception and vault protection.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages