@proofgate/eliza-plugin
v0.1.2
Published
ProofGate plugin for elizaOS — validate AI agent transactions against security guardrails before execution
Maintainers
Readme
@proofgate/eliza-plugin
Blockchain transaction validation for Eliza AI agents via ProofGate
🚀 What is this?
This plugin adds automatic transaction validation to your Eliza AI agents before they execute any blockchain transactions. It prevents:
- ❌ Wallet drains from prompt injection attacks
- ❌ Infinite approvals to malicious contracts
- ❌ Logic errors that could cost thousands
- ❌ Hallucinated transactions with wrong amounts
📦 Installation
npm install @proofgate/eliza-plugin🔧 Quick Start
import { createProofGatePlugin } from 'proofgate-eliza-plugin';
// Create plugin instance
const proofgatePlugin = createProofGatePlugin({
apiKey: 'pg_your_api_key_here', // Get from https://www.proofgate.xyz
guardrailId: 'your-guardrail-id', // Optional: specific guardrail
chainId: 8453, // Base mainnet (or 56 for BSC)
autoBlock: true, // Block unsafe transactions (default: true)
});
// Add to your Eliza agent
const agent = new Agent({
// ... your agent config
plugins: [proofgatePlugin],
});💡 How It Works
- User asks agent to send a transaction (e.g., "Send 100 USDC to 0x123...")
- ProofGate intercepts before execution
- Validates against your safety guardrails:
- Balance checks
- Contract whitelists
- Spending limits
- Slippage tolerance
- Returns verdict: PASS ✅ or FAIL 🚨
- Blocks unsafe transactions (if autoBlock: true)
- Records cryptographic proof on-chain
🔑 Get Your API Key
- Go to proofgate.xyz
- Connect wallet
- Create a guardrail (e.g., "Max $500/transaction, only Uniswap")
- Copy your API key & guardrail ID
Free tier: 100 validations/month, no credit card required.
📋 Configuration Options
interface ProofGateConfig {
apiKey: string; // Required: Your ProofGate API key (starts with pg_)
apiUrl?: string; // Optional: Custom API URL (default: https://www.proofgate.xyz/api)
guardrailId?: string; // Optional: Specific guardrail to validate against
chainId?: number; // Optional: Chain ID (default: 56 for BSC)
autoBlock?: boolean; // Optional: Auto-block unsafe transactions (default: true)
debug?: boolean; // Optional: Enable debug logging (default: false)
}🎯 Example Use Cases
DeFi Trading Bot
const tradingBot = new Agent({
name: 'DeFi Trader',
plugins: [
createProofGatePlugin({
apiKey: process.env.PROOFGATE_API_KEY!,
guardrailId: 'defi-trading', // Guardrail: Max 1k USDC/trade, only Uniswap
chainId: 8453, // Base
autoBlock: true,
}),
],
});
// User: "Swap 5000 USDC to ETH on unknown DEX"
// ProofGate: 🚨 BLOCKED - Contract not whitelistedTreasury Manager
const treasuryBot = new Agent({
name: 'DAO Treasury',
plugins: [
createProofGatePlugin({
apiKey: process.env.PROOFGATE_API_KEY!,
guardrailId: 'treasury-ops', // Guardrail: Aave/Morpho only
chainId: 8453,
}),
],
});
// User: "Deposit 100k USDC to Aave"
// ProofGate: ✅ SAFE - Contract verified, within daily limit🛡️ Safety Guardrails
Define custom rules for your agent at proofgate.xyz/create:
- Balance Requirements: "Require 5 USDC balance before any swap"
- Contract Whitelist: "Only interact with Uniswap V3, Aave V3"
- Max Approval: "Never approve more than 1000 USDC"
- Slippage Limits: "Block swaps with >1% slippage"
- Daily Limits: "$10k max spending per day"
📊 On-Chain Proofs
Every validation is recorded on Base mainnet:
- Immutable audit trail
- Cryptographic evidence
- Query anytime via
getEvidence(validationId)
🔗 Links
- ProofGate: proofgate.xyz
- Documentation: proofgate.xyz/docs
- GitHub: github.com/ProofGate
- Eliza Framework: github.com/ai16z/eliza
💬 Support
- Twitter: @ProofGate
📄 License
MIT
Built with ❤️ by 0xCR6
