Quick Install
Get AgentSentry protecting your elizaOS agent in three simple steps.
1
Install the Plugin
typescript
npm install @agentsentry/eliza-plugin2
Import and Initialize
typescript
import { SentryPlugin } from '@agentsentry/eliza-plugin';
const sentry = SentryPlugin({
apiKey: process.env.AGENTSENTRY_API_KEY,
agentId: 'my-trading-agent',
policies: {
maxTransactionValue: 1000, // SOL
dailyLimit: 5000,
allowedActions: ['swap', 'transfer'],
requiredApprovals: 1,
},
});3
Wrap Your Actions
typescript
// Before: Unprotected action
await agent.swap(tokenA, tokenB, amount);
// After: Protected with AgentSentry
const result = await sentry.wrapAction(
'swap',
{ tokenA, tokenB, amount },
async (params) => {
return await agent.swap(params.tokenA, params.tokenB, params.amount);
}
);
if (result.blocked) {
console.log('Action blocked:', result.reason);
// Handle escalation or retry logic
}Next Steps
Was this page helpful? /