Home/Docs/elizaOS Plugin

elizaOS Plugin

The official AgentSentry plugin for elizaOS agents. Wraps wallet actions with enterprise-grade guardrails using a drop-in middleware pattern.

Features

  • -Zero-config setup for standard elizaOS deployments
  • -Automatic wallet action interception (swap, transfer, LP)
  • -Real-time slippage validation via Helius RPC
  • -Circuit breaker state management
  • -Telegram, Discord, and Slack alert webhooks

Configuration

config.ts
import { SentryPlugin } from '@agentsentry/eliza-plugin';

export const sentryConfig = {
  // Required
  apiKey: process.env.AGENTSENTRY_API_KEY,
  agentId: 'my-agent-001',

  // Policy configuration
  policies: {
    maxTransactionValue: 1000,    // Max SOL per transaction
    dailyLimit: 10000,            // Max SOL per 24 hours
    velocityLimit: 5,             // Max transactions per minute
    allowedActions: ['swap', 'transfer', 'stake'],
    blockedTokens: ['SCAM', 'RUG'],
    whitelistedDestinations: [
      'So11111111111111111111111111111111111111112',
    ],
  },

  // Alert channels
  webhooks: {
    telegram: process.env.TELEGRAM_WEBHOOK,
    discord: process.env.DISCORD_WEBHOOK,
    slack: process.env.SLACK_WEBHOOK,
  },

  // Circuit breaker settings
  circuitBreaker: {
    failureThreshold: 3,
    resetTimeout: 300000, // 5 minutes
    halfOpenRequests: 1,
  },
};

API Reference

sentry.checkIn(action, params)

Validates an action against all configured policies before execution. Returns ALLOW, BLOCK, or ESCALATE verdict.

sentry.wrapAction(action, params, executor)

Wraps an action executor with full check-in, validation, and audit logging. Recommended for most use cases.

sentry.getCircuitStatus()

Returns the current circuit breaker state: CLOSED (normal), OPEN (blocked), or HALF_OPEN (testing).

Was this page helpful? /