# enact balance Source: https://docs.enact.finance/cli/balance Show token balances for your root wallet. ```bash theme={null} enact balance ``` Displays stablecoin balances for your root wallet address on Tempo. ## Output ```bash theme={null} Enact Balance Account: 0x1234...5678 AlphaUSD: $95.50 ``` ## Agent mode ```bash theme={null} enact -t balance ``` ```json theme={null} { "address": "0x1234...5678", "balances": [ { "token": "AlphaUSD", "balance": "95.50" } ] } ``` `balance` shows your **root wallet** balance — the total funds available. For the remaining limit on your current agent session, use [`enact session`](/cli/session). # enact init Source: https://docs.enact.finance/cli/init Create your passkey wallet and authorize an agent session. ```bash theme={null} npx enact-wallet init ``` Interactive setup that creates your wallet and authorizes an agent session on-chain. Run this once per project. ## Options ```bash theme={null} npx enact-wallet init --no-env # Print credentials to stdout instead of writing .env ``` ## What it does Registers a passkey. Your Tempo account address is derived deterministically from the passkey public key. The private key never leaves your device's secure enclave. Displays your wallet address. Send stablecoins to the address and the CLI continues once funds arrive. Prompts for spending limit (USD) and expiry (days). The on-chain authorization of the access key requires a passkey signature from your root account. This is the only time your passkey is required after setup. Credentials are written to `.env` in the current directory. Existing `AGENT_*` variables are replaced, other content is preserved. ## Output ```bash theme={null} # Enact Agent Session — CLI Agent AGENT_PRIVATE_KEY=0x... # Access key private key AGENT_ROOT_ADDRESS=0x... # Your root wallet address AGENT_ACCESS_KEY_ADDRESS=0x... # The authorized access key address AGENT_RPC_URL=https://... # Tempo RPC endpoint AGENT_CHAIN_ID=42431 # Chain ID (42431 = testnet) AGENT_BUDGET_USD=100 # Spending limit set at session creation ``` ## Security model * Your root wallet private key is **never stored anywhere** * It is derived from your passkey on each use, inside your device's secure enclave * `AGENT_PRIVATE_KEY` is an **access key** — a separate derived key with a hard spending limit enforced on-chain by Tempo's Account Keychain precompile * If the access key is compromised, an attacker can only spend up to the remaining limit. They cannot access your root wallet or create new sessions. # CLI Overview Source: https://docs.enact.finance/cli/overview All Enact commands and global flags. ## Commands | Command | Description | | ------------------------------- | ----------------------------------- | | [`enact init`](/cli/init) | Create wallet + agent session | | [`enact pay `](/cli/pay) | Make a paid HTTP request | | [`enact balance`](/cli/balance) | Show token balances | | [`enact session`](/cli/session) | Show session info + remaining limit | | `enact mcp` | Start MCP server for AI tools | ## Global flags | Flag | Description | | --------------- | ---------------------------- | | `-t`, `--agent` | Machine-readable JSON output | | `--help` | Show help | ## Agent mode All commands support `-t` for JSON output — useful when the CLI is being called by an agent: ```bash theme={null} enact -t balance # {"address":"0x...","balances":[{"token":"AlphaUSD","balance":"95.50"}]} enact -t session # {"rootAddress":"0x...","accessKey":"0x...","budget":"100","remaining":"95.50"} enact -t pay https://api.example.com/resource # {"status":200,"receipt":true,"body":{...}} ``` ## Credentials Credentials are loaded in this order: 1. `.env` file in the current working directory 2. Environment variables (`AGENT_PRIVATE_KEY`, `AGENT_ROOT_ADDRESS`, etc.) Run [`enact init`](/cli/init) to create credentials for the first time. # enact pay Source: https://docs.enact.finance/cli/pay Make a payment-aware HTTP request. ```bash theme={null} enact pay [options] ``` Makes an HTTP request that automatically handles `402 Payment Required` responses. If the server requests payment, Enact pays using your agent session credentials and retries. ## Options | Flag | Description | | ----------------------- | --------------------------------- | | `--method ` | HTTP method (default: `GET`) | | `--body ` | Request body | | `--header 'Key: Value'` | Add a request header (repeatable) | | `--dry-run` | Preview cost without paying | ## Examples ```bash theme={null} # Basic GET enact pay https://api.example.com/resource # POST with body enact pay https://api.example.com/analyze \ --method POST \ --body '{"text": "hello world"}' # Preview cost before paying enact pay --dry-run https://api.example.com/resource # Custom headers enact pay https://api.example.com/resource \ --header 'X-Request-ID: abc123' ``` ## Dry run output ```bash theme={null} enact pay --dry-run https://api.example.com/resource Dry Run: GET https://api.example.com/resource Payment required Cost: $0.01 Remaining: $95.50 ``` If `Remaining` is lower than `Cost`, the request will fail. Top up your wallet or create a new session with a higher budget. ## Agent mode ```bash theme={null} enact -t pay https://api.example.com/resource ``` ```json theme={null} { "status": 200, "receipt": true, "body": { ... } } ``` Dry run in agent mode: ```bash theme={null} enact -t pay --dry-run https://api.example.com/resource ``` ```json theme={null} { "requiresPayment": true, "cost": { "amount": "0.01", "currency": "AlphaUSD" }, "remainingBudget": "95.50", "wouldExceedBudget": false } ``` # enact session Source: https://docs.enact.finance/cli/session Show current agent session info and remaining spending limit. ```bash theme={null} enact session ``` Displays current agent session credentials and queries the on-chain remaining spending limit from the Tempo Account Keychain precompile. ## Output ```bash theme={null} Enact Session Root Account: 0x1234...5678 Access Key: 0xabcd...efgh Budget: $100 USD Remaining: $95.50 USD ``` ## Agent mode ```bash theme={null} enact -t session ``` ```json theme={null} { "rootAddress": "0x1234...5678", "accessKey": "0xabcd...efgh", "budget": "100", "remaining": "95.50" } ``` Agents should check `remaining` before making expensive requests. Use `enact -t session` to get a machine-readable value and compare against the expected cost from `enact -t pay --dry-run`. # How It Works Source: https://docs.enact.finance/concepts/how-it-works The technology stack behind Enact — from passkey to payment. ## The stack Enact is built on two open protocols: **Tempo** (the blockchain) and **MPP** (the payment protocol). ``` ┌─────────────────────────────────┐ │ ENACT │ │ Wallet, agent sessions, CLI, │ │ MCP server, dashboard │ ├─────────────────────────────────┤ │ MPP │ │ HTTP 402 payment flows, │ │ payment receipts │ ├─────────────────────────────────┤ │ TEMPO │ │ Passkeys, Account Keychain, │ │ TIP-20 stablecoins │ └─────────────────────────────────┘ ``` ## Tempo Tempo is a payments-first blockchain with sub-second finality and fees paid in stablecoins (no native gas token). Enact uses these Tempo primitives: * **Passkey accounts** — WebAuthn-based wallets tied to your device's biometrics. The private key lives in your device's secure enclave and is never exposed. * **Account Keychain** — a protocol-level precompile at `0xaAAAaaAA00000000000000000000000000000000` that manages access keys with per-token spending limits. This is what enforces agent budgets on-chain. * **TIP-20 tokens** — USD-denominated stablecoins used for both payments and gas fees. ## MPP MPP (Machine Payments Protocol) defines how machines pay each other over HTTP: 1. A server returns `HTTP 402` with a payment challenge 2. The client signs a payment and sends it in the `Authorization` header 3. The server verifies payment and returns the response Enact's `pay` command and MCP `pay_request` tool handle this flow automatically using the `mppx` TypeScript SDK. ## What Enact does Enact ties these together into a developer experience: * **`npx enact-wallet init`** — creates a passkey wallet, funds it, and authorizes an agent session on-chain in one guided flow * **Agent sessions** — scoped access keys with spending limits, managed from the CLI or dashboard * **`npx enact-wallet pay`** — makes paid HTTP requests with automatic 402 handling * **MCP server** — gives AI agents native tools for payments, balance checks, and session info * **Dashboard** — web UI at [app.enact.finance](https://app.enact.finance) for wallet management, agent sessions, and transaction history # Security Model Source: https://docs.enact.finance/concepts/security How Enact keeps your funds safe even if an agent key is compromised. ## The two-key model Enact separates your root account from per-agent access keys: ``` Root Account (passkey-secured, never exposed) ├── Agent Session A → $100 limit, expires 30 days ├── Agent Session B → $50 limit, expires 7 days └── Agent Session C → $200 limit, expires 90 days ``` **Root account** — your main wallet. Created once via browser passkey. The private key is derived inside your device's secure enclave and never stored anywhere. You use this to authorize and revoke agents. **Access keys** — scoped secp256k1 keys generated per agent session. Stored in `.env`. Have hard spending limits enforced at the protocol level by Tempo's Account Keychain precompile. ## What if an access key is compromised? An attacker with your `AGENT_PRIVATE_KEY` can only: * Spend up to the **remaining limit** on that key * Make token transfers up to the spending cap They cannot: * Access your root wallet * Create new sessions or authorize new keys * Exceed the on-chain spending cap * Spend tokens not included in the session's token limits ## Revocation Revoke a session from the Enact dashboard or CLI. This calls `revokeKey()` on the Account Keychain precompile, immediately invalidating the key on-chain. Once revoked, any transaction signed by that key is rejected at the protocol level — no further action required. ## Spending limit enforcement Limits are enforced by Tempo's Account Keychain precompile at `0xaAAAaaAA00000000000000000000000000000000`. This is a protocol-level contract — it cannot be bypassed by the access key holder. The root account sets the limit; the access key can only spend up to that amount per token. For production deployments, always set conservative spending limits. You can create new sessions with higher limits — you cannot undo a payment already made. # Introduction Source: https://docs.enact.finance/index Give your AI agent a wallet with on-chain spending controls. Enact gives AI agents controlled spending access on the Tempo blockchain. Create a passkey-secured wallet, set per-agent spending limits enforced on-chain, and connect your AI tools via CLI or MCP. Enact never holds your funds — it enforces the limits you define at the protocol level. Get started with the [Enact CLI](/quickstart) or the [Enact dashboard](https://app.enact.finance) to create a wallet and connect your first agent. ## How it works ``` ┌─────────────────────────────────┐ │ ENACT │ │ wallet, spending limits, │ │ CLI, MCP server, dashboard │ ├─────────────────────────────────┤ │ MPP │ │ HTTP 402, payment handling, │ │ credentials, receipts │ ├─────────────────────────────────┤ │ TEMPO │ │ TIP-20, Account Keychain, │ │ passkeys, transactions │ └─────────────────────────────────┘ ``` ## What you can do | Capability | Description | | ------------------------- | -------------------------------------------------------------------- | | Passkey wallet | Self-custodial wallet secured by your device's passkey | | Per-agent spending limits | Hard caps enforced on-chain by Tempo's Account Keychain precompile | | Agent lifecycle | Create, monitor, and revoke agent sessions from the CLI or dashboard | | Payment-aware HTTP | `enact pay ` handles 402 Payment Required flows automatically | | MCP integration | Connect to Claude Code, Claude Desktop, Cursor, or OpenClaw | | Dry-run cost preview | Preview what a request will cost before paying | ## Next steps Get your agent paying in 5 minutes All commands and options Connect to Claude, Cursor, OpenClaw How Enact keeps your funds safe # MCP Integration Source: https://docs.enact.finance/mcp Connect Enact to Claude Code, Claude Desktop, Cursor, OpenClaw, and any MCP-compatible AI agent. Enact ships a built-in MCP (Model Context Protocol) server. Once configured, your AI agent can make paid HTTP requests, check balances, and query session info as native tools — no manual credential handling required. ## Prerequisites Run `npx enact-wallet init` first to create your wallet and get credentials in your `.env` file. ## Available tools | Tool | Description | | ------------- | ---------------------------------------------------------------------------------------------- | | `pay_request` | Make a paid HTTP request. Supports `method`, `body`, `headers`, and `dry_run` to preview cost. | | `get_balance` | Get token balances for the agent wallet. | | `get_session` | Get session info and remaining spending limit. | ## Configuration Run this command to add the MCP server: ```bash theme={null} claude mcp add -s user enact-wallet -- npx enact-wallet mcp ``` Then restart Claude Code. Run `claude --mcp-debug` to verify the connection. Edit `~/Library/Application Support/Claude/claude_desktop_config.json` (macOS) or `%APPDATA%\Claude\claude_desktop_config.json` (Windows): ```json theme={null} { "mcpServers": { "enact-wallet": { "command": "npx", "args": ["enact-wallet", "mcp"] } } } ``` Restart Claude Desktop to load the MCP server. Add to `.cursor/mcp.json` in your project root: ```json theme={null} { "mcpServers": { "enact-wallet": { "command": "npx", "args": ["enact-wallet", "mcp"] } } } ``` Reload Cursor to pick up the new MCP server. Tell your OpenClaw agent to install the Enact skill: ``` https://enact.finance/skill.md ``` The MCP server reads credentials from your `.env` file automatically. Make sure you've run `npx enact-wallet init` in the same directory. ## Usage examples Once connected, your agent can call Enact tools directly: ``` // Preview cost without paying pay_request(url="https://api.example.com/resource", dry_run=true) // Make a paid request pay_request(url="https://api.example.com/resource") // POST with body pay_request( url="https://api.example.com/analyze", method="POST", body="{\"text\": \"hello world\"}" ) // Check wallet balance get_balance() // Check remaining session limit get_session() ``` ## Example prompts Try these with your connected agent: * "Check my Enact wallet balance" * "What's my remaining spending limit?" * "How much would it cost to call this API?" (with dry\_run) * "Pay for a news article using Enact" # Quickstart Source: https://docs.enact.finance/quickstart Get your AI agent paying for services in under 5 minutes. ## Prerequisites * Node.js 18+ * A browser with passkey support (Chrome, Safari, Firefox) ## Run init ```bash theme={null} npx enact-wallet init ``` This guides you through three steps: Opens your browser and registers a passkey. Your key is derived from the passkey inside your device's secure enclave — never stored in plaintext anywhere. Send stablecoins (USDC.e, pathUSD) to your wallet address. The CLI displays your address and polls your balance until funds arrive. Prompts for a spending limit and expiry, then opens your browser for passkey approval of the on-chain authorization. When complete, a `.env` file is written to your project: ```bash theme={null} AGENT_PRIVATE_KEY=0x... AGENT_ROOT_ADDRESS=0x... AGENT_ACCESS_KEY_ADDRESS=0x... AGENT_RPC_URL=https://rpc.moderato.tempo.xyz AGENT_CHAIN_ID=42431 AGENT_BUDGET_USD=100 ``` `AGENT_PRIVATE_KEY` is an **access key** — not your root wallet. It has a hard spending limit enforced on-chain. Your root wallet is secured by your passkey and never exposed. ## Make your first paid request ```bash theme={null} npx enact-wallet pay '' ``` Enact handles the 402 Payment Required flow automatically. Preview the cost before paying: ```bash theme={null} npx enact-wallet pay --dry-run '' ``` ## Check your balance and session ```bash theme={null} npx enact-wallet balance # token balances for your root wallet npx enact-wallet session # session info + remaining spending limit ``` ## Use in your agent code Once `.env` is set, integrate with `mppx`: ```ts theme={null} import { Mppx, tempo } from "mppx/client"; import { Account } from "viem/tempo"; const account = Account.fromSecp256k1(process.env.AGENT_PRIVATE_KEY, { access: process.env.AGENT_ROOT_ADDRESS, }); const mppx = Mppx.create({ methods: [tempo({ account })], }); // fetch now handles 402 automatically const response = await mppx.fetch("https://api.example.com/resource"); ``` ## Next steps Connect to Claude Desktop, Cursor, or OpenClaw All available commands and flags