polygon-agent setup creates an EOA and authenticates with OMS, then polygon-agent wallet create provisions the smart wallet that holds the operating balance. The smart wallet is where spending limits live: per-token caps, contract allowlists, and DeFi permissions are scoped at creation. The EOA never holds funds.
Wallet sessions last six months. After expiry, re-run wallet create to refresh the session.
How it works
The browser approval step is one-time per session. After approval, the CLI runs autonomously for six months against the configured spending limits.Commands
setup
| Flag | Default | Purpose |
|---|---|---|
--name | none | Project name written to builder.json |
--force | false | Recreate config even if already set up |
~/.polygon-agent/builder.json. Run this once per machine per project.
wallet create
| Flag | Default | Purpose |
|---|---|---|
--name | main | Wallet name (multiple wallets supported) |
--chain | polygon | Chain to deploy on |
--print-url | false | Print approval URL and exit (headless) |
--timeout | 300 | Seconds to wait for browser approval |
--native-limit | none | POL spending cap |
--usdc-limit | none | USDC spending cap |
--usdt-limit | none | USDT spending cap |
--token-limit | none | Other token cap, repeatable: --token-limit WETH:0.1 |
--contract | none | Whitelist a contract address, repeatable |
--defi | false | Whitelist DeFi contracts (swaps, yield) in addition to defaults |
--usdc-to / --usdc-amount | none | One-off USDC transfer at creation |
--access-key | none | Override the stored OMS project access key |
--defi at creation so the smart wallet can interact with Aave v3, Morpho, and ERC-4626 vaults without re-approval. To allow specific contracts only, list them with repeated --contract flags.
wallet import
wallet list, address, remove
list enumerates all wallets. address prints the smart-wallet address for the named wallet. remove deletes the local session; the onchain wallet is unaffected.
Headless approval
For server environments without a browser, use--print-url:
polygon-agent wallet import --code <code> --rid <rid> on the server to pick up the session.
Worked example
--defi.
Implementation
CLI overview
Topology, install, supported chains, safety model.
Balances and funding
Check balances and fund the smart wallet.
Agentic Wallets
smart contract wallet primitives.