Production Migration Guide
Take your agent payments from simulation to mainnet in 3 phases. No code changes required between environments.
Before you start: Sardis supports three deployment modes. Start with simulation, move to testnet, then go mainnet. Each phase builds on the previous one — you do not need to rewrite any code.
Phase 1: Simulation (Local)
This is the default mode. No API key, no blockchain, no real money. All operations run in-memory on your machine.
from sardis import SardisClient
# No API key = simulation mode (automatic)
client = SardisClient()
# Everything works locally
wallet = client.wallets.create(name="my-agent", initial_balance=1000)
wallet.pay(to="openai.com", amount=25, purpose="API credits")
print(wallet.balance) # 975What to test in simulation:
- Wallet creation and balance management
- Policy enforcement (limits, allowlists, blocklists)
- Multi-agent group budgets
- Approval thresholds
- Transaction logging
Use client.quickstart() for a guided walkthrough of all simulation features.
Phase 2: Testnet (Base Sepolia)
Real blockchain transactions with test tokens. No real money at risk.
Step 1: Get your API key
- Sign up at dashboard.sardis.sh/signup
- Go to API Keys in the dashboard
- Create a new key with
writescope - Copy the key (starts with
sk_test_)
Step 2: Install the SDK
pip install sardisStep 3: Set environment variables
export SARDIS_API_KEY=<your-sk_test-key>
export SARDIS_API_URL=https://api.sardis.shStep 4: Run your first testnet payment
import os
from sardis import SardisClient
# API key triggers production mode automatically
client = SardisClient(api_key=os.environ["SARDIS_API_KEY"])
# Create a wallet on Base Sepolia
wallet = client.wallets.create(
name="test-agent",
chain="base_sepolia",
token="USDC",
policy="Max $100 per transaction"
)
# Fund the wallet (use dashboard or faucet)
# Then execute a real testnet payment
tx = wallet.pay(to="0xRecipient...", amount=5.00, purpose="Test payment")
print(tx.success) # True
print(tx.tx_hash) # Real blockchain tx hashStep 5: Fund your testnet wallet
Options for getting testnet USDC:
- Dashboard faucet: Go to the dashboard and click "Fund Wallet" on your wallet
- Circle faucet: Get testnet USDC from faucet.circle.com
- Direct transfer: Send Base Sepolia USDC to your wallet address
Phase 3: Mainnet (Production)
Real money, real transactions. Only change is the chain configuration.
Step 1: Get a production API key
- In the dashboard, create a new API key with
sk_live_prefix - Store it securely (environment variable, secrets manager — never hardcode)
Step 2: Update environment
export SARDIS_API_KEY=<your-sk_live-key>
export SARDIS_API_URL=https://api.sardis.shStep 3: Switch to mainnet chain
import os
from sardis import SardisClient
client = SardisClient(api_key=os.environ["SARDIS_API_KEY"])
# Create wallet on Base mainnet
wallet = client.wallets.create(
name="production-agent",
chain="base", # mainnet
token="USDC",
policy="Max $500 per day. Only allow approved vendors. Require approval above $200."
)Step 4: Fund with real USDC
- Coinbase Onramp (recommended): Free, instant USDC purchase directly to your wallet
- Direct transfer: Send USDC on Base to your wallet address
- Bridge from other chains: Use Circle CCTP to bridge USDC from Ethereum, Polygon, etc.
Step 5: Production checklist
| Check | Status |
|---|---|
Production API key (sk_live_) configured | Required |
| Sardis SDK package installed | Required |
| Spending policy set for production limits | Required |
| Wallet funded with real USDC | Required |
| Webhook endpoint registered for notifications | Recommended |
| Approval workflow configured for large payments | Recommended |
| Kill switch tested in staging | Recommended |
| Dashboard access verified for all team members | Optional |
Environment Variable Reference
| Variable | Required | Description |
|---|---|---|
SARDIS_API_KEY | Yes | Your API key (sk_test_ for testnet, sk_live_ for mainnet) |
SARDIS_API_URL | No | API base URL (default: https://api.sardis.sh) |
TURNKEY_API_KEY | Production | Turnkey MPC signing key (auto-configured with Sardis keys) |
TURNKEY_ORGANIZATION_ID | Production | Turnkey org ID (auto-configured with Sardis keys) |
Troubleshooting
"SardisClient is running in simulation mode"
This warning means no real payments will execute. Fix: provide an API key and install the SDK:
pip install sardis
export SARDIS_API_KEY="sk_test_...""Insufficient funds or limit exceeded"
Your wallet does not have enough USDC. Check your balance in the dashboard or fund it using one of the methods above.
"Policy check failed"
The payment was rejected by your spending policy. Check:
- Is the amount within your per-transaction limit?
- Is the destination in your allowed list?
- Have you exceeded your daily/monthly budget?
"Transaction failed" with no details
Check the transaction in the dashboard Transaction Explorer for the full lifecycle and error details. Common causes: RPC timeout (retry), gas estimation failure, or nonce conflict.
Need help?
Join our Discord or email support@sardis.sh.
Agent Auth Protocol
How AI agents discover, register, authenticate, and receive spending mandates through the Sardis Agent Auth Protocol. Covers discovery endpoints, capabilities, JWT format, and mandate mapping.
Deployment Guide
Production-like staging deployment for Sardis API, dashboard, and demo live mode on Cloud Run and AWS App Runner.