Policies, Boundaries & Hardening
Default spend limits, supported DeFi/Bitcoin formats, honest fail-closed boundaries, replay protection, and production environment flags.
Supported Formats & Honest Boundaries
EVM EIP-1559, EIP-2930, and Legacy RLP; ERC-20 (transfer, approve, increaseAllowance, transferFrom, permit), setApprovalForAll, nested multicall (depth ≤ 3), Gnosis Safe execTransaction, Uniswap Permit2 & UniversalRouter (V3_SWAP_EXACT_IN / SWEEP), and Bitcoin P2WPKH/P2PKH/P2SH/P2WSH/P2TR + BIP-143.
If an agent calls a custom DeFi contract whose 4-byte selector is not in the supported decoder set, MpcFirewall classifies it as UNKNOWN_CONTRACT_CALL and rejects it by default rather than letting unknown bytes slip through (allowUnknownSelectors: false).
Default Policy Limits
Tokens: Auto-sign ≤ 100 USDC • Max per TX: 500 USDC • Daily cap: 1,000 USDC
Native Gas: Auto-sign ≤ 0.1 ETH • Max per TX: 0.5 ETH • Daily cap: 1.0 ETH (includes max fee bribe guard)
Bitcoin: Max output 100,000 sats • Daily cap: 500,000 sats
Production Environment Flags
| Variable | Behavior |
|---|---|
| REQUIRE_ADMIN_AUTH + MPC_FIREWALL_ADMIN_TOKEN | Locks PATCH/POST /api/policy behind constant-time Bearer / x-admin-token verification |
| NEARAI_API_KEY + STRICT_LIVE_TEE=true | Requires live NEAR AI Cloud TEE (cloud-api.near.ai/v1); fails closed with ERR_TEE_UNAVAILABLE if unreachable |
| NEAR_INTENTS_BASE_URL / NEAR_INTENTS_API_KEY | Configures 1Click quote requests with explicit CONFIDENTIAL_INTENTS or INTENTS routing |
| MPC_FIREWALL_DATA_DIR | Custom directory for persistent runtime state (defaults to .mpc-firewall-data locally, os.tmpdir() on Netlify) |
Replay Guard & Hosting Notes
On-chain, processed_tx_ids and processed_payloads block replaying identical signed bytes (ERR_REPLAY_DETECTED). Note that stateless serverless deployments (like Netlify) store Node-side counters inside os.tmpdir(); production teams should enforce spend caps primarily via the deployed NEAR smart contract or attach persistent storage via MPC_FIREWALL_DATA_DIR.