Skip to content

Configuration

Everything you can set, and every script you can run.

Environment variables

Daemon

VariableDefaultEffect
AGENT_WALLET_DB.agent-wallet/wallet.dbSQLite path. :memory: for an ephemeral wallet.
AGENT_WALLET_CONTROL_PORT4023Control plane port
AGENT_WALLET_PAY_PORT4022Payment API port
AGENT_WALLET_MCP_PORT4024MCP server port
AGENT_WALLET_CONTROL_TOKENgenerated at startupOperator bearer token

Ledger signing

VariableDefaultEffect
AGENT_WALLET_LEDGER_KEYunsetPath to an Ed25519 PEM (or the PEM itself). When set, every audit event is signed. Generate one with npm run ledger:keygen.

Per-agent rate limit

VariableDefaultEffect
AGENT_WALLET_RATE_LIMIT_PER_MIN60Max payments per minute per authenticated agent. 0 disables.

Approval expiry

VariableDefaultEffect
AGENT_WALLET_APPROVAL_TIMEOUT_HOURS24Auto-expire pending approvals after this many hours. 0 disables.

Custody

VariableDefaultEffect
AGENT_WALLET_CUSTODYlocalmanaged selects Coinbase CDP server wallets
CDP_API_KEY_IDCDP API key id (managed custody)
CDP_API_KEY_SECRETCDP API key secret
CDP_WALLET_SECRETCDP wallet secret

Stripe

VariableDefaultEffect
STRIPE_SECRET_KEYStripe API key. sk_test_… for test mode; the smoke test refuses anything else.

Wallet config (TypeScript)

If you embed the WalletDaemon directly rather than running the bundled daemon, the config is:

ts
interface WalletConfig {
  policy: PolicyConfig;                 // mode, threshold, hard limit, requireMandate
  rails: PaymentRail[];                 // x402, Stripe, ACP, or your own
  custody: CustodyProvider;             // Local or Managed

  ledger?: Ledger;                      // defaults to InMemoryLedger
  mandates?: MandateStore;              // defaults to in-memory
  approvals?: ApprovalStore;            // defaults to in-memory
  control?: ControlState;               // freeze state — defaults to in-memory
  funding?: FundingSourceStore;         // defaults to in-memory
  agents?: AgentStore;                  // defaults to in-memory

  cartVerifier?: CartVerifier;          // typically an AcpClient
  rateLimit?: { count: number; windowMs: number };
  approvalTimeoutMs?: number;
}

The daemon (src/daemon.ts) is the canonical assembly: SQLite-backed stores, LocalCustody, all three rails, an AcpClient, the env-driven knobs above.

Policy config

ts
interface PolicyConfig {
  mode: "autonomous" | "tiered" | "approve-every";
  autoApproveThreshold?: Money;  // for tiered
  hardLimit?: Money;             // above all mandates
  requireMandate?: boolean;      // escalate a no-mandate request
}

The daemon's default is:

ts
{
  mode: "tiered",
  autoApproveThreshold: money(100, "USD"),   // $1.00 auto-approves
  hardLimit: money(5000, "USD"),             // $50.00 hard ceiling
  requireMandate: true,
}

npm scripts

Run

ScriptWhat it does
npm run daemonThe unified daemon — all surfaces, SQLite, the works
npm startAlias for npm run daemon
npm run devThe daemon under node --watch
npm run demoA scripted policy-engine demo
npm run mcpA stand-alone stdio MCP server (separate wallet)

Verify

ScriptWhat it does
npm testThe unit suite (src/**/*.test.ts)
npm run typecheckStrict tsc --noEmit
npm run buildEmit dist/
npm run mcp:checkMCP smoke test
npm run control:checkControl plane + durable storage
npm run daemon:checkCross-surface, including agent-auth enforcement
npm run x402:checkReal Base Sepolia tx (no cost; testnet)
npm run stripe:checkIssue a test virtual card (needs a key; skips cleanly without)

Setup

ScriptWhat it does
npm run custody:addressGenerate a local custody keypair and print the address
npm run ledger:keygenGenerate an Ed25519 ledger signing key
npm run x402:resourceA local x402 test resource server (used by x402:check)

Docs

ScriptWhat it does
npm run docs:devLocal dev server for this site
npm run docs:buildBuild the static site to docs/.vitepress/dist

A policy-governed payment wallet for AI agents.