Skip to main content
Give any agent a Privy wallet with a CLI command. The agent sandbox CLI (privy-agent-wallets) lets consumers authenticate, fund, and transact from assistants like Claude Code, Cursor, Cline, and Windsurf without writing any integration code. Go to agents.privy.io to track agent activity and spend in the agent sandbox.

Design principles

  • CLI-first distribution: Agents already execute shell commands. A CLI is the most natural interface for agent-driven wallets.
  • Skill-based discovery: The skill file teaches agents how to authenticate and transact without human guidance beyond the initial login.
  • Browser-based funding: The human owner retains a visual dashboard to check balances, view transaction history, and onramp funds, keeping the human in control.
  • Cryptographic authorization: Each CLI session generates a P-256 keypair which is used to sign RPC requests. The agent is never given the wallet private key.

How it works

  1. The CLI generates a local P-256 keypair and opens a browser for authentication.
  2. The human logs in through Privy and grants the agent signer access to their wallets.
  3. The CLI stores the session in the OS credential manager (or an encrypted local file as fallback).
  4. For every transaction, the CLI signs an authorization payload and sends it to the agent server, which verifies the signature, injects app credentials, and forwards the request to Privy’s API.

Getting started

1

Visit the agent sandbox

Go to agents.privy.io to create an account, view wallets, and manage agent activity.
2

Install the CLI

Install the agent sandbox CLI globally:
npm install -g @privy-io/agent-wallet-cli
Or run it directly with npx:
npx @privy-io/agent-wallet-cli login
3

Log in

Start the authentication flow. This generates a keypair, opens a browser window, and waits for credentials.
privy-agent-wallets login
In the browser, complete the Privy login and approve signer access. The browser displays a JSON credential blob. Copy it and paste it back into the terminal to complete login.
4

Fund wallets

Open the agent sandbox in a browser to add funds via onramp:
privy-agent-wallets fund
The agent sandbox at agents.privy.io provides a visual interface to view balances, review transaction history, and onramp funds into the wallet.
5

View wallets

List the Ethereum and Solana wallet addresses linked to the session:
privy-agent-wallets list-wallets
Output:
Ethereum:  0x1a2b...3c4d  (wallet_id_xxx)
Solana:    7hQ5p...mN9r   (wallet_id_yyy)
6

Send transactions

Use the rpc command to sign messages and send transactions. Pass the RPC body as JSON:
privy-agent-wallets rpc --json '{"method": "eth_sendTransaction", "params": {"to": "0xRecipient", "value": "0.01"}}'
The body can also be piped from stdin:
echo '{"method": "personal_sign", "params": {"message": "hello"}}' | privy-agent-wallets rpc

Supported RPC methods

Ethereum

MethodDescription
personal_signSign a plaintext message
eth_sendTransactionSend a transaction
eth_signTransactionSign without broadcasting
eth_signTypedData_v4Sign EIP-712 typed data
secp256k1_signRaw secp256k1 signature
eth_sign7702AuthorizationEIP-7702 authorization
eth_signUserOperationSign a user operation (ERC-4337)

Solana

MethodDescription
signTransactionSign a Solana transaction
signAndSendTransactionSign and broadcast a transaction
signMessageSign an arbitrary message

Session and credential storage

The CLI attempts to use the OS-backed credential manager when available, and otherwise falls back to storing session data in an encrypted file at ~/.privy/session.json. It is the responsibility of the agent or user to install any required prerequisites for the OS credential manager.
PlatformCredential managerPrerequisites
macOSKeychain (security CLI)None — available by default
Linuxlibsecret (secret-tool CLI)sudo apt install -y libsecret-tools (Debian/Ubuntu)
WindowsPowerShell SecretManagementInstall-Module Microsoft.PowerShell.SecretManagement
When the OS credential manager is not available (e.g., Docker containers, headless servers, or missing prerequisites), the CLI falls back to an encrypted file at ~/.privy/session.json. This file is not portable between machines. Each session contains:
  • The app ID for the Privy agent wallet app
  • Ethereum and Solana wallet IDs and addresses
  • The P-256 private key used to sign RPC requests
  • A creation timestamp
Sessions expire after seven days. To end a session early:
privy-agent-wallets logout
Users can always revoke agent access to their wallet via the agent sandbox at agents.privy.io/manage.

Learn more

Agent CLI

Track agent activity, view balances, and manage wallets.

Agentic wallets

Build developer-controlled agent wallets with policy guardrails.

x402 payments

Enable HTTP-native payments for APIs and digital content.

MPP integration

Machine-to-machine payments over HTTP with Privy wallets.

Gas sponsorship

Sponsor gas fees for agent transactions.