Agent Wallet Firewall
Sends unclear or suspicious transactions to the user's Telegram chat for approval or rejection via a bot; no response is treated as rejection.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Agent Wallet Firewallsend 0.01 ETH to pay Alice's invoice #42, reason: invoice settlement"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Agent Wallet Firewall
A firewall between your AI agent and your wallet. Every transaction the agent wants to sign is checked against your rules, a simulation, threat lists and your actual intent. Suspicious ones are blocked or sent to your phone for a yes/no.
⚠️ Version 0. Runs on Base Sepolia testnet only. Do not use it with real money yet.
Why
AI agents are getting wallets. They pay for APIs (x402), trade, and settle invoices. But an agent can be tricked:
Prompt injection: a web page, email or token name says "send the funds to this new address". OWASP says this cannot be fully prevented.
Memory injection: a poisoned memory makes a malicious transfer look like something you agreed to earlier (research on ElizaOS agents).
Drainer calls: a "claim your airdrop" transaction that secretly approves someone to take all your tokens.
Spending limits alone do not stop this: an attacker stays under the limit, or drains you in many small payments.
Related MCP server: ows-mcp-wallet
How it works
The agent never holds the key. It talks to this MCP server, and the server signs only what passes every check:
AI agent (Claude, Cursor, any MCP client)
│ send_eth / send_token / approve_token / contract_call
▼
┌──────────────── Agent Wallet Firewall ────────────────┐
│ 1. Decode what does this transaction really do? │
│ 2. Threats known drainer addresses, your blocklist │
│ 3. Rules per-tx limits, daily budgets, rate │
│ limits, recipients, approvals │
│ 4. Simulate would it fail? is the recipient a │
│ contract? │
│ 5. Intent does it match what YOU asked for? │
│ (a separate model, the agent can't │
│ talk to it) │
│ 6. Human anything unclear → Telegram approve / │
│ reject, no answer = rejected │
└───────────────────────────┬───────────────────────────┘
▼
sign & send (or block)The strictest check wins. A model can only make a decision stricter, never override a hard rule.
Your mandate (what the agent may do, in plain words) lives in a local file the agent cannot read or write. The intent check compares every transaction against it, and treats the agent's own explanation as untrusted.
Agent-Drain-Benchmark
18 attack and false-alarm scenarios ship with the repo. Run them yourself:
npm run bench # rules only, offline, free
npm run bench -- --intent # adds the intent check (needs ANTHROPIC_API_KEY)Rules alone catch 16 of 18. The two that get through are the interesting ones: a changed address in an invoice and a fake "as we agreed earlier" memory. Both look completely normal to a spending limit. That is what the intent check is for.
# | Attack | Caught by |
3–5 | Over the limit, thousand small cuts, transaction flood | rules |
7 | Known drainer address | threat list |
8–9 | Unlimited approval, hidden | decoder + rules |
10 | NFT drainer | decoder + rules |
11 |
| decoder + rules |
14 | Transaction that would fail | simulation |
16 | "Alice's address changed" prompt injection | intent check |
17 | "As we agreed earlier" memory injection | intent check |
Found a bypass? See SECURITY.md. Confirmed bypasses become new benchmark scenarios.
Quickstart
Requires Node.js 20.12 or newer.
git clone https://github.com/evolve-hodl/agent-wallet-firewall.git
cd agent-wallet-firewall
npm install # also builds
node dist/cli.js init # creates ~/.agent-wallet-firewall with a fresh TESTNET walletinit prints your new testnet address and the config snippet for your MCP client. Then:
Send the address some free Base Sepolia ETH from a testnet faucet.
Write your mandate and limits in
~/.agent-wallet-firewall/policy.yaml.Optional: add
ANTHROPIC_API_KEY(intent check) andTELEGRAM_BOT_TOKEN+TELEGRAM_CHAT_ID(approvals on your phone) to~/.agent-wallet-firewall/.env.Add the printed snippet to your MCP client. For Claude Desktop on macOS that is
~/Library/Application Support/Claude/claude_desktop_config.json. Restart the client.
Try the attack yourself: give the agent demo/poisoned-invoice.md and ask it to pay the invoice.
Tools the agent gets
Tool | What it does |
| Address, balances, remaining budgets, your mandate |
| Send ETH |
| Send an ERC-20 token |
| Approve token spending (unlimited is blocked by default) |
| Raw contract call, decoded before signing |
Every call needs a reason. You see it in the approval message; the firewall never trusts it.
Files
Everything lives in ~/.agent-wallet-firewall/:
File | Purpose |
| Your mandate and rules (example) |
| Testnet key and optional API keys (permissions 600) |
| Known malicious addresses |
| Every decision, with reasons |
| Spending history for budgets |
Roadmap
Live threat feeds instead of a local list
Asset-change simulation (exactly what leaves your wallet)
Set your mandate from your phone, per task
More chains, mainnet once it is battle-tested
Plugins for agent frameworks (AgentKit, ElizaOS)
x402 payment checks
Hosted version with dashboard, team policies and audit export
Interested in the hosted version? Join the waitlist
License
MIT
This server cannot be deployed
Maintenance
Related MCP Connectors
Pay-per-call safety checks for AI agents: screen a crypto address or URL before you transact.
DeFi safety layer for AI agents: wallet safety, token risk, tx decode/simulate. 20 tools.
Pre-spend firewall for AI agents. Approves, blocks, flags transactions against policy rules.
Security intelligence for AI agents monitoring Ethereum before actions.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenancePre-execution safety layer for autonomous agent wallets. Risk scoring, transaction simulation, and policy enforcement via MCP.MIT
- AlicenseAqualityDmaintenanceEnables AI agents to check balances and send transactions across multiple blockchains with automatic spending limit protection and policy enforcement.3MIT
- AlicenseNot gradedqualityCmaintenanceEnables AI agents to analyze Ethereum wallets, simulate transactions, and draft transfers with deterministic policy and risk scoring, requiring human approval before on-chain execution.6 npmISC
- AlicenseNot gradedqualityDmaintenanceSecurity layer for AI agents that evaluates transaction intents and returns verdicts (ALLOW/WARN/DENY) using deterministic rules, on-chain checks, and simulation.11 npmMIT