Skip to content

Commit 3e0e5d6

Browse files
Merge branch 'main' into feat/skills-sak
2 parents 800be78 + a7c86ba commit 3e0e5d6

26 files changed

Lines changed: 1831 additions & 16 deletions

.cursor/rules/contributor-workflow.mdc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ Every new documentation page must be added to the appropriate sidebar file:
1717
| MetaMask Connect | `mm-connect-sidebar.js` |
1818
| Embedded Wallets | `ew-sidebar.js` |
1919
| Smart Accounts Kit | `gator-sidebar.js` |
20+
| Agent Wallet | `agent-wallet-sidebar.js` |
2021
| Services | `services-sidebar.js` |
2122
| Developer dashboard | `dashboard-sidebar.js` |
2223
| Snaps | `snaps-sidebar.js` |
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
---
2+
description: Product-specific guidance for MetaMask Agent Wallet documentation, including terminology, CLI conventions, and content organization.
3+
globs: agent-wallet/**/*.md,agent-wallet/**/*.mdx
4+
alwaysApply: false
5+
---
6+
7+
# Agent Wallet
8+
9+
## Product naming
10+
11+
- The product name is **MetaMask Agent Wallet**. Use **Agent Wallet** as short form in prose.
12+
- The CLI binary is `mm` (lowercase, monospace). Do not document `mm-dev` or `mm-uat` in user-facing docs.
13+
- The npm package is `@metamask/agentic-cli`.
14+
15+
## Wallet and trading modes
16+
17+
- **server-wallet** — private keys are held securely in a TEE-backed environment.
18+
- **Bring your own wallet** — user supplies a BIP-39 mnemonic. CLI flag: `byok`.
19+
- **Guard Mode (Recommended)** — trading mode (`--mode guard`). Designed for everyday traders. Enforces security check, network allowlist, token recipient allowlist, address allowlist, and rolling 24h outflow limit. 2-factor authentication on policy violations, malicious transactions, and raising outflow limit.
20+
- **Beast Mode** — trading mode (`--mode beast`). Designed for power users. Security check guardrail only. 2-factor authentication on malicious transactions and risky contracts.
21+
22+
Users choose wallet and trading modes during interactive `mm init` or by prompting their agent.
23+
Mark Guard Mode as **Recommended**; do not describe modes as opt-in, default, or preferred in other ways.
24+
Sign-in method (QR, Google, or email) determines the 2FA approval channel (Mobile push vs email link).
25+
26+
CLI flags use `server-wallet`, `byok`, `guard`, and `beast`.
27+
28+
## Security terms
29+
30+
Use these terms consistently when describing the security stack:
31+
32+
- **Transaction Protection** — guarantee for transactions deemed safe (up to $10,000 loss coverage).
33+
Frame as backing for "security by default," not as a standalone scanning feature. Link eligibility
34+
and terms to
35+
[Transaction Shield support](https://support.metamask.io/manage-crypto/transactions/transaction-shield/).
36+
- **Transaction Shield** — automated security checks for malicious contracts and scams. Link to
37+
[Transaction Shield support](https://support.metamask.io/manage-crypto/transactions/transaction-shield/).
38+
Do not lead with vendor names.
39+
- **Smart Transactions** — optimizes how trades land onchain (fewer fails, better gas, built-in MEV
40+
protection). Link to
41+
[Smart Transactions support](https://support.metamask.io/manage-crypto/transactions/smart-transactions/).
42+
Do not use "Servo" in user-facing docs.
43+
- **Server wallet** / **TEE** — keys managed and secured server-side; agents can't access the user's
44+
main wallet. Do not lead with vendor names.
45+
- **2FA** or **2-factor authentication** — human approval for flagged or policy-violating transactions. Do not use "MFA" in prose (CLI state `AWAITING_MFA` is acceptable in code references).
46+
47+
Do not add comparative security claims beyond approved product copy.
48+
49+
## Content organization
50+
51+
| Folder | Content type |
52+
| ---------------- | ------------------------------------------------- |
53+
| Root (`README.mdx`, `quickstart.md`, `use-the-cli-directly.md`) | Overview, quickstart, headless CLI |
54+
| `guides/` | Task-oriented how-to guides |
55+
| `reference/` | Architecture, CLI commands, error codes, supported chains |
56+
| `troubleshooting/` | Symptom-based fixes (single page in v1) |
57+
58+
Do not paste content from `.agents/skills/metamask-agent-wallet/` into documentation pages.
59+
60+
## Reference conventions
61+
62+
- Command headings use backtick-wrapped names (for example, `## \`mm transfer\``).
63+
- Parameters use tables with columns: Flag, Required, Description.
64+
- Use `bash` fences for CLI examples.
65+
- Global flags: `--format`, `--json`, `--toon`, `--verbose`.
66+
67+
## Sidebar
68+
69+
The sidebar configuration is in [agent-wallet-sidebar.js](agent-wallet-sidebar.js).
70+
71+
## Images
72+
73+
Place product images in `static/img/agent-wallet/`.

.cursor/rules/terminology.mdc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,13 @@ listed on the right unless they appear in code, URLs, or direct quotations from
2222
| sign-in / sign-out (noun or adjective) | log-in, log-out, login, logout (as nouns/adj) |
2323
| onchain / offchain | on-chain, off-chain |
2424
| Wallet Standard, Wallet Adapter | wallet-standard, wallet-adapter (except in URLs) |
25+
| MetaMask Agent Wallet | Agentic CLI, Agentic Wallet (except in code/URLs where `agentic` appears) |
26+
| Agent Wallet (short form) | agent wallet (lowercase product name) |
27+
| Guard Mode | guard mode (capitalize Mode) |
28+
| Beast Mode | beast mode (capitalize Mode) |
29+
| server-wallet | server wallet, Server Wallet (except as product phrase "server-wallet mode") |
30+
| Bring your own wallet | BYOK, bring your own key, byok (except CLI flag `--wallet byok`) |
31+
| `mm` (CLI binary) | MM, Mm (except at sentence start) |
2532

2633
## Standards and specifications
2734

AGENTS.md

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,24 @@
11
# MetaMask developer documentation
22

3+
<!-- vale off -->
4+
35
This repository contains the source for [docs.metamask.io](https://docs.metamask.io), the MetaMask
46
developer documentation site. It is built with Docusaurus and covers multiple products aimed at
57
dapp developers and wallet extension builders.
68

9+
<!-- vale on -->
10+
711
## Products
812

9-
| Product | Path | Sidebar file | Description |
10-
| ------------------- | --------------------------- | ----------------------- | ----------------------------------------------------------------------------------- |
11-
| MetaMask Connect | `metamask-connect/` | `mm-connect-sidebar.js` | Connect dapps to MetaMask extension and mobile, across EVM, Solana, and multichain. |
12-
| Embedded Wallets | `embedded-wallets/` | `ew-sidebar.js` | Embed wallet functionality directly into applications. |
13-
| Smart Accounts Kit | `smart-accounts-kit/` | `gator-sidebar.js` | Create smart accounts with delegated permissions, and request advanced permissions. |
14-
| Services | `services/` | `services-sidebar.js` | Ease dapp development using Infura and related infrastructure APIs. |
15-
| Snaps | `snaps/` | `snaps-sidebar.js` | Extend MetaMask by creating custom mini-apps. |
16-
| Developer dashboard | `developer-tools/dashboard` | `dashboard-sidebar.js` | Manage Infura API keys, monitor usage, and access account info. |
13+
| Product | Path | Sidebar file | Description |
14+
| ------------------- | --------------------------- | ------------------------- | ----------------------------------------------------------------------------------- |
15+
| MetaMask Connect | `metamask-connect/` | `mm-connect-sidebar.js` | Connect dapps to MetaMask extension and mobile, across EVM, Solana, and multichain. |
16+
| Embedded Wallets | `embedded-wallets/` | `ew-sidebar.js` | Embed wallet functionality directly into applications. |
17+
| Smart Accounts Kit | `smart-accounts-kit/` | `gator-sidebar.js` | Create smart accounts with delegated permissions, and request advanced permissions. |
18+
| Agent Wallet | `agent-wallet/` | `agent-wallet-sidebar.js` | Give AI agents programmatic wallet access via the `mm` CLI with mandatory security. |
19+
| Services | `services/` | `services-sidebar.js` | Ease dapp development using Infura and related infrastructure APIs. |
20+
| Snaps | `snaps/` | `snaps-sidebar.js` | Extend MetaMask by creating custom mini-apps. |
21+
| Developer dashboard | `developer-tools/dashboard` | `dashboard-sidebar.js` | Manage Infura API keys, monitor usage, and access account info. |
1722

1823
## Editorial standards
1924

@@ -22,7 +27,9 @@ Follow these guides when writing or editing documentation:
2227
- [Consensys documentation style guide](https://docs-template.consensys.net/contribute/style-guide)
2328
- [Consensys Markdown formatting guide](https://docs-template.consensys.net/contribute/format-markdown)
2429
- [Microsoft Writing Style Guide](https://learn.microsoft.com/en-us/style-guide/welcome/)
30+
<!-- vale off -->
2531
- [Diataxis framework](https://diataxis.fr/) for content structure
32+
<!-- vale on -->
2633

2734
The rules under `.cursor/rules/` cover the most actionable parts of these references.
2835
See [CONTRIBUTING.md](CONTRIBUTING.md) for the full contribution workflow.

agent-wallet-sidebar.js

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
// @ts-check
2+
3+
/** @type {import('@docusaurus/plugin-content-docs').SidebarsConfig} */
4+
const sidebar = {
5+
agentWalletSidebar: [
6+
{
7+
type: 'doc',
8+
label: 'Overview',
9+
id: 'README',
10+
},
11+
{
12+
type: 'doc',
13+
label: 'Quickstart',
14+
id: 'quickstart',
15+
},
16+
{
17+
type: 'doc',
18+
label: 'Use the CLI directly',
19+
id: 'use-the-cli-directly',
20+
},
21+
{
22+
type: 'category',
23+
label: 'Guides',
24+
collapsed: false,
25+
items: [
26+
'guides/send-tokens',
27+
'guides/swap-and-bridge',
28+
'guides/trade-perpetuals',
29+
'guides/trade-prediction-markets',
30+
'guides/check-balances-and-prices',
31+
'guides/sign-messages-and-transactions',
32+
],
33+
},
34+
{
35+
type: 'category',
36+
label: 'Reference',
37+
collapsed: true,
38+
items: [
39+
'reference/architecture',
40+
'reference/commands',
41+
'reference/error-codes',
42+
'reference/supported-chains',
43+
],
44+
},
45+
{
46+
type: 'doc',
47+
id: 'troubleshooting',
48+
label: 'Troubleshooting',
49+
},
50+
],
51+
}
52+
53+
module.exports = sidebar

agent-wallet/README.mdx

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
---
2+
title: MetaMask Agent Wallet
3+
sidebar_label: Overview
4+
description: Give your AI agent a self-custody wallet. Install the mm CLI and agent skills, then use natural language in Claude Code, Codex, Cursor, and other agents.
5+
keywords: [MetaMask, Agent Wallet, mm, AI agents, skills]
6+
---
7+
8+
import CardList from '@site/src/components/CardList'
9+
10+
A fully self-custodial agent wallet that lets AI agents trade autonomously without forcing users to give up control. Deploying an agent on a self-custody wallet can mean choosing between giving the agent freedom to act and keeping users’ funds safe. MetaMask Agent Wallet ends that trade-off. Your agent operates inside user-defined limits.
11+
12+
:::info Early Access
13+
MetaMask Agent Wallet is available through the
14+
[Early Access Program](https://metamask.io/agent-wallet).
15+
:::
16+
17+
## What your agent can do
18+
19+
After setup, prompt your agent in plain language:
20+
21+
<!-- vale off -->
22+
23+
| You ask your agent | What happens |
24+
| ------------------------------------------------ | ----------------------------------------------------------------- |
25+
| "Show the wallet address and USDC balance" | Your agent checks auth, then queries balances. |
26+
| "Send 10 USDT to 0x123… on Ethereum" | Your agent confirms details, then submits a transfer. |
27+
| "Swap 0.1 ETH to USDC on Base" | Your agent fetches a quote, confirms with you, then executes. |
28+
| "Open a 5x long on BTC with $100 on Hyperliquid" | Your agent deposits if needed, quotes, and opens the position. |
29+
| "Bet 10 USDT on YES for BTC 5-min price up" | Your agent searches markets, confirms odds, and places the order. |
30+
31+
<!-- vale on -->
32+
33+
## MetaMask safety-checks every transaction before it lands
34+
35+
Security by default, not configuration.
36+
Supported EVM transactions pass through a mandatory 3-step security pipeline.
37+
Backed by Transaction Protection: transactions through Agent Wallet deemed safe are guaranteed
38+
against loss up to $10,000.\*
39+
40+
1. **Transaction simulation**: What will this transaction actually do? Balance changes, approvals,
41+
and gas are surfaced before signing.
42+
2. **[Transaction Shield](https://support.metamask.io/manage-crypto/transactions/transaction-shield/)**:
43+
Automated security checks flag malicious contracts and scams; flagged transactions require your
44+
approval before they execute.
45+
3. **[Smart Transactions](https://support.metamask.io/manage-crypto/transactions/smart-transactions/)**:
46+
Smart transaction execution with built-in MEV protection, fewer fails, and better gas where
47+
supported on the target chain.
48+
49+
:::note
50+
51+
Learn more in [Architecture](reference/architecture.md). See [Transaction Shield](https://support.metamask.io/manage-crypto/transactions/transaction-shield/)
52+
for eligibility, coverage limits, and terms.
53+
54+
:::
55+
56+
## Capabilities
57+
58+
The `mm` CLI exposes a full command surface for wallet operations.
59+
Your agent routes natural-language requests to these commands through installed skills.
60+
61+
<!-- vale off -->
62+
63+
| Area | What your agent can do |
64+
| ------------------------------------------------------------------- | ------------------------------------------------------- |
65+
| [Authentication](quickstart.md) | Sign in, check session, sign out |
66+
| [Wallet](guides/check-balances-and-prices.md) | Create wallet, show address, check balances |
67+
| [Send](guides/send-tokens.md) | Transfer native tokens and ERC-20s |
68+
| [Sign / raw transactions](guides/sign-messages-and-transactions.md) | Sign messages, typed data, and raw EVM transactions |
69+
| [Decode calldata](guides/sign-messages-and-transactions.md) | Inspect unfamiliar EVM calldata before signing |
70+
| [Swap / bridge](guides/swap-and-bridge.md) | Quote, execute, and track swaps and cross-chain bridges |
71+
| [Perpetuals](guides/trade-perpetuals.md) | Trade on Hyperliquid (deposit, open, modify, close) |
72+
| [Prediction markets](guides/trade-prediction-markets.md) | Search, quote, and trade on Polymarket |
73+
| [Market data](guides/check-balances-and-prices.md) | Spot prices, token discovery, supported chains |
74+
75+
<!-- vale on -->
76+
77+
See the [commands reference](reference/commands.md) for every flag and subcommand.
78+
79+
## Supported chains
80+
81+
MetaMask Agent Wallet supports multiple EVM chains.
82+
Run `mm chains list` for the authoritative list for your CLI version.
83+
See [Supported chains](reference/supported-chains.md) for typical networks.
84+
85+
## Set up
86+
87+
<CardList
88+
items={[
89+
{
90+
href: '/agent-wallet/quickstart',
91+
title: 'Quickstart',
92+
description:
93+
'Install the CLI, add skills to your agent, sign in, and send your first transfer.',
94+
},
95+
{
96+
href: '/agent-wallet/reference/architecture',
97+
title: 'Architecture',
98+
description:
99+
'Wallet modes, Transaction Protection, Transaction Shield, Smart Transactions, and 2FA.',
100+
},
101+
{
102+
href: '/agent-wallet/guides/trade-perpetuals',
103+
title: 'Trade perpetuals',
104+
description: 'Deposit, open, modify, and close Hyperliquid positions.',
105+
},
106+
]}
107+
/>
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
---
2+
description: Check wallet balances, token prices, and discover tokens with mm.
3+
keywords: [MetaMask, Agent Wallet, balance, price, market data, mm]
4+
---
5+
6+
# Check balances and prices
7+
8+
Query wallet balances, spot prices, and token metadata without submitting transactions.
9+
10+
## Ask your agent
11+
12+
```text
13+
You (to your agent): "What's my USDC balance?"
14+
```
15+
16+
```text
17+
You (to your agent): "What's the current price of ETH?"
18+
```
19+
20+
```text
21+
You (to your agent): "Show me trending tokens"
22+
```
23+
24+
Read-only queries like these do not require confirmation before your agent runs them.
25+
26+
## Commands
27+
28+
1. Confirm your wallet address:
29+
30+
```bash
31+
mm wallet address
32+
```
33+
34+
2. Query balances, prices, or token lists using the commands in the following sections.
35+
36+
## Wallet balance
37+
38+
```bash
39+
mm wallet balance
40+
mm wallet balance --chain 8453
41+
mm wallet balance --token USDC
42+
```
43+
44+
If `--token` with a symbol returns no balance or an error, pass the ERC-20 contract address for that
45+
chain. Run `mm token list search --query <symbol> --chain <chain-id>` to look up the address.
46+
47+
## Spot prices
48+
49+
```bash
50+
mm price spot --asset-ids <ASSET_IDS> --vs USD
51+
mm price currencies
52+
mm price networks
53+
```
54+
55+
Use `mm token assets` to resolve asset identifiers for tokens you care about.
56+
57+
## Token discovery
58+
59+
```bash
60+
mm token list popular --chain ethereum
61+
mm token list search --query uniswap --chain ethereum
62+
mm token list trending --chain base
63+
mm token networks
64+
```
65+
66+
## Supported chains
67+
68+
```bash
69+
mm chains list
70+
```
71+
72+
## Related commands
73+
74+
See [Commands reference](../reference/commands.md) for `mm wallet balance`, `mm price`, and
75+
`mm token`.

0 commit comments

Comments
 (0)