Concepts

The agent wallet

The account agents spend from: creating, funding, pausing and withdrawing.

The agent wallet is the Solana account an agent spends from. Each owner has one. Its key is held by the signer; the owner's own wallet sets the policy and withdraws, and no request from an agent reaches the key.

Creating it

The owner creates it once, with POST /v1/wallet. The signer generates the keypair and stores the secret key encrypted. The API saves the default policy as version 1 at the same time.

The wallet is the fee payer and the only signer of every transaction compiled from an intent, so it needs SOL for network fees as well as for what it sends.

Funding it

The owner sends SOL or tokens to the wallet's address from any wallet. Nothing in Writ is involved in funding: it is an ordinary transfer to an ordinary address.

A token sent to the wallet can leave it only after the owner sets a cap for its mint in tokenLimits.

What the owner sees

GET /v1/wallet shows the address, the SOL and token balances read from the chain, what the wallet sent in the last 24 hours against each cap, whether it is paused, the policy version in force and the five latest records:

the wallet after one 0.5 SOL payment
{
  "address": "BrpKxDbVNo9KmzXy6TULJACV2oh7msEKUXeGurFaLihv",
  "lamports": "4499994999",
  "tokens": [],
  "spend": {
    "windowHours": 24,
    "sol": {
      "used": "500005001",
      "cap": "2000000000"
    },
    "tokens": [
      {
        "mint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
        "cap": "50000000",
        "used": "0",
        "symbol": "USDC",
        "decimals": 6
      }
    ]
  },
  "paused": false,
  "policyVersion": 1,
  "recentRecords": "4 records"
}

spend.sol.used is 500005001 lamports after a 0.5 SOL payment: the network fee counts toward the cap.

Pause

While the policy is paused, the paused rule fails and every intent is denied, from the chat and from every agent token. Pausing does not touch the chain. Withdrawals still work.

Withdraw

The owner can move SOL, a token or both from the agent wallet to the address they signed in with, with POST /v1/withdrawals. The destination is not a parameter: the signer reads the owner's address from the database.

A withdrawal is not an intent. The rules do not judge it and it does not count toward the caps. It appears in the records with kind: "withdrawal" and the source owner.

The chat agent

Writ's chat agent is claude-opus-5-5. For each turn it receives the last 20 messages of the conversation and the wallet's address and balances. It has no key, no RPC access and no way to read or change the policy. Its output is bound to the TIS schema, and the engine validates the intent again before anything else happens.

When the API runs without a model key, a scripted agent answers in its place. It understands requests of these forms:

RequestIntent
pay <address> <amount> SOL or USDC or a minttransfer
swap <amount> <asset> to <asset>swap
approve <delegate> <base units or unlimited> <asset>approve
revoke <asset>revoke
memo <text>memo

GET /health says which agent answers, in agent.