Concepts

The policy

What the owner allows: five fields, saved as numbered versions.

A policy is what the owner allows the agent wallet to do. It has five fields. The owner reads and saves it through /v1/policy, with their own session. An agent token cannot read or change it.

Fields

Amounts are base units as decimal strings: lamports for SOL, the mint's smallest unit for a token.

pausedbooleanrequired

While true, the paused rule fails and every intent is denied.

dailySolLamportsstring (u64)required

The SOL the agent wallet may send out in any rolling 24 hours, in lamports. Read by daily_spend.

tokenLimitsobject: mint address to string (u64)required

For each mint, the amount that may leave the wallet in any rolling 24 hours, in the mint's base units. A mint with no entry cannot leave the wallet. Read by token_limits.

programAllowlistarray of addresses, at most 32required

The programs a transaction may call. ComputeBudget is always permitted and does not need an entry. Read by program_allowlist.

blockUnlimitedApprovalsbooleanrequired

While true, an approval for the maximum u64 amount is denied. Read by no_unlimited_approval.

The schema is strict. Saving a policy sends all five fields, and an unknown key is refused with VALIDATION_ERROR.

The default policy

Creating the agent wallet writes this policy as version 1:

json
{
  "paused": false,
  "dailySolLamports": "2000000000",
  "tokenLimits": {
    "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v": "50000000"
  },
  "programAllowlist": [
    "11111111111111111111111111111111",
    "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA",
    "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"
  ],
  "blockUnlimitedApprovals": true
}

That is 2 SOL a day, 50 USDC a day, and three programs: System, SPL Token and Associated Token. Jupiter and Memo are not on the default allowlist, so a swap or a memo is denied until the owner adds the program.

Versions

Every save writes a new version with the next number. Pausing and resuming are saves too, so each writes a version. Earlier versions are kept.

A record cites the version it ran under in policy_version and carries that policy's digest in policy_digest. GET /v1/records/{id} returns the cited version in full, so a record can be read against the exact policy that judged it after the policy has changed.

The digest

The digest is the SHA-256 of the policy as canonical JSON, in hex. The default policy's digest is:

text
c958b5c7f8fd5818451f8abcc30a0f2494302e935ce5e1a1bcde9ddea57b2293

Changing any field changes the digest. The order of keys does not. PDR v1 has the recipe.

The programs the engine names

ProgramAddress
System11111111111111111111111111111111
SPL TokenTokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA
Token-2022TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb
Associated TokenATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL
MemoMemoSq4gqABAXKb96qnH8TysNcWxMyWCqXgDLGmfcHr
Jupiter v6JUP6LkbZbjS1jKKwapdHNy74zcZ3tLUZoi5QNyVTaV4
ComputeBudgetComputeBudget111111111111111111111111111111

The USDC mint is EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v.