MetaMask Agent Wallet
by @andreolf
Control a sandboxed MetaMask browser extension wallet for autonomous blockchain transactions. Features configurable permission guardrails including spend limits, chain allowlists, protocol restrictions, and approval thresholds. MetaMask-only (other wallets not supported).
1. Install Dependencies
cd metamask-agent-skill
npm install
npx playwright install chromium
2. Create Agent Wallet Profile
npm run setup
This will:
~/.agent-wallet/chrome-profile3. Fund the Wallet
Transfer a small amount to your agent wallet:
4. Configure Permissions
Edit permissions.json to set your constraints:
{
"constraints": {
"spendLimit": {
"daily": "50000000", // $50 in 6-decimal format
"perTx": "10000000" // $10 max per transaction
},
"allowedChains": [1, 137, 42161],
"allowedProtocols": ["0x...uniswap", "0x...1inch"]
}
}
"Protocol not allowed"
Add the contract address toallowedProtocols in permissions.json."Exceeds daily limit"
Wait 24h or increasespendLimit.daily.MetaMask popup not detected
Ensure the browser profile path is correct and MetaMask is installed.Transaction simulation failed
The dapp may be trying to call a blocked method or unsupported chain.All operations check against permissions.json before execution:
| Constraint | Description |
|------------|-------------|
| spendLimit.daily | Max USD value per 24h period |
| spendLimit.perTx | Max USD value per transaction |
| allowedChains | Whitelisted chain IDs |
| allowedProtocols | Whitelisted contract addresses |
| blockedMethods | Forbidden function selectors |
| requireApproval.above | Threshold requiring user confirmation |
Approval Flow
When a transaction exceeds requireApproval.above:
1. Agent pauses execution
2. Transaction details are logged
3. Agent reports: "Transaction requires approval: [details]"
4. User must explicitly approve before agent continues
clawhub install metamask-agent-wallet-skill