Protocol
Protocol Overview

Protocol Overview

Aegis Protocol is a Solana smart contract built with Anchor that provides policy-based transaction execution for AI agents.

Program Details

Program ID (Devnet): ET9WDoFE2bf4bSmciLL7q7sKdeSYeNkWbNMHbAMBu2ZJ

Framework: Anchor 0.30.1

Language: Rust

Core Features

Policy Enforcement

  • Daily Spending Limits - Maximum lamports per 24-hour period
  • Address Whitelist - Up to 20 approved recipients
  • Vault Pausing - Emergency stop for all transactions

Override System

  • Manual Approvals - Owners can approve blocked transactions
  • Expiration - Overrides expire after 1 hour (configurable)
  • On-Chain State - All overrides stored on-chain

Fee Collection

  • Protocol Fees - 0.05% (5 basis points) on all transactions
  • Treasury PDA - Fees collected to single treasury account
  • Minimum Fee - 5000 lamports (0.000005 SOL)

Account Structure

VaultConfig

Main vault configuration account storing:

  • Owner and agent signer keys
  • Daily limit and spent amount
  • Whitelist (20 addresses max)
  • Vault state (paused/active)
  • Override nonce counter

PendingOverride

Override request accounts storing:

  • Destination and amount
  • Block reason
  • Expiration timestamp
  • Approval status

FeeTreasury

Singleton treasury for protocol fees.

Instructions

InstructionDescriptionSigner
initialize_vaultCreate new vaultOwner
execute_guardedExecute owner-signed txOwner
execute_agentExecute agent-signed txAgent
create_overrideRequest manual approvalOwner/Agent
approve_overrideApprove overrideOwner
execute_approved_overrideExecute approved txOwner
update_daily_limitChange daily limitOwner
add_to_whitelistAdd whitelisted addressOwner
remove_from_whitelistRemove from whitelistOwner
pause_vaultEmergency pauseOwner
resume_vaultResume paused vaultOwner
update_agent_signerRotate agent keyOwner

Events

All state changes emit events for Guardian monitoring:

  • VaultCreated - New vault initialized
  • TransactionExecuted - Successful transaction
  • TransactionBlocked - Policy violation
  • OverrideCreated - Override requested
  • OverrideApproved - Owner approved
  • PolicyUpdated - Configuration changed
  • VaultPaused / VaultResumed - Emergency controls
  • AgentSignerUpdated - Key rotation

Security Model

On-Chain Guarantees

  • ✅ All policy checks happen on-chain
  • ✅ Agent cannot bypass policies
  • ✅ Owner cannot be impersonated
  • ✅ Fees cannot be avoided
  • ✅ Integer overflow protection
  • ✅ Account ownership verification

Checked Arithmetic

All arithmetic uses checked operations:

let new_spent = vault.spent_today
    .checked_add(amount)
    .ok_or(AegisError::ArithmeticOverflow)?;

Next Steps