Sardis

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)  # 975

What 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

  1. Sign up at dashboard.sardis.sh/signup
  2. Go to API Keys in the dashboard
  3. Create a new key with write scope
  4. Copy the key (starts with sk_test_)

Step 2: Install the SDK

pip install sardis

Step 3: Set environment variables

export SARDIS_API_KEY=<your-sk_test-key>
export SARDIS_API_URL=https://api.sardis.sh

Step 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 hash

Step 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

  1. In the dashboard, create a new API key with sk_live_ prefix
  2. 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.sh

Step 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

CheckStatus
Production API key (sk_live_) configuredRequired
Sardis SDK package installedRequired
Spending policy set for production limitsRequired
Wallet funded with real USDCRequired
Webhook endpoint registered for notificationsRecommended
Approval workflow configured for large paymentsRecommended
Kill switch tested in stagingRecommended
Dashboard access verified for all team membersOptional

Environment Variable Reference

VariableRequiredDescription
SARDIS_API_KEYYesYour API key (sk_test_ for testnet, sk_live_ for mainnet)
SARDIS_API_URLNoAPI base URL (default: https://api.sardis.sh)
TURNKEY_API_KEYProductionTurnkey MPC signing key (auto-configured with Sardis keys)
TURNKEY_ORGANIZATION_IDProductionTurnkey 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.