Skip to content

Open-source platform for 3D AI agents. Turn text or a photo into a rigged, animated GLB avatar, give it an LLM brain, memory and a wallet, and embed it anywhere with one web component. Remote MCP server, x402 payments, Three.js, browser-native.

docs(approvals): document the capped burner policy, its wallet-signature tier and decision trail, with changelog entry and STRUCTURE row

nirholas27d81c33f06d
diff --git a/STRUCTURE.md b/STRUCTURE.md
index a92b247c3..5c4e9ec41 100644
--- a/STRUCTURE.md
+++ b/STRUCTURE.md
@@ -269,6 +269,7 @@ packages, a generated standalone GitHub mirror). See
| Onchain agent wallets (spending allowances, not private keys) | [packages/onchain-agent-wallets/](packages/onchain-agent-wallets) (published as `@three-ws/onchain-agent-wallets`, MCP registry `io.github.nirholas/onchain-agent-wallets`) | Live | Give an agent a Solana wallet without giving it the money. Funds sit in a vault token account the OWNER owns, derived deterministically from the owner address plus the agent id (`createWithSeed(owner, "oaw1:<agent>")`); the agent holds only a capped SPL Token delegation over it, so the token program itself refuses any spend past the ceiling and decrements it on every transfer. Guardrails on top (per-tx, rolling daily, recipient and host allowlists, expiry, pause, confirm-above threshold) are enforced before signing, and every decision including refusals lands in a local ledger. `pay_x402` probes the price unpaid, checks it against the guardrails, tops the agent up for exactly that amount, pays, and leaves it empty. Owner actions need no key on the machine: they come back as unsigned transactions for Phantom/Solflare/Ledger. [Delegation tests](packages/onchain-agent-wallets/test/token-delegation.test.mjs) run the real SPL Token program in process and assert that 61 against a remaining allowance of 60 fails on-chain. |
| Destination whitelist (cooldown allowlist for agent wallet payouts) | Engine [api/_lib/destination-whitelist.js](api/_lib/destination-whitelist.js), endpoint [api/wallet-whitelist/index.js](api/wallet-whitelist/index.js), MCP tools [api/_mcp/tools/whitelist.js](api/_mcp/tools/whitelist.js), cron [api/cron/whitelist-activate.js](api/cron/whitelist-activate.js), hub tab [src/agent-wallet-hub/tabs/whitelist.js](src/agent-wallet-hub/tabs/whitelist.js), migration `api/_lib/migrations/20261010160000_destination_whitelist.sql` | Built; migration not yet applied to production | New payout addresses wait out an owner-set cooldown (24h default, 1h floor), need step-up to add, are proposal-only for agents, cancel in one click and remove instantly. Enforced in the shared spend guards for transfers, tips, bridge, payouts and withdrawals. Docs: [docs/destination-whitelist.md](docs/destination-whitelist.md). Tests: [tests/destination-whitelist.test.js](tests/destination-whitelist.test.js) |
| Owner-funded agent budgets (on-chain allowances) | lib [api/_lib/onchain-allowance.js](api/_lib/onchain-allowance.js), store and guard hook [api/_lib/onchain-allowance-store.js](api/_lib/onchain-allowance-store.js), endpoint [api/agents/solana-allowance.js](api/agents/solana-allowance.js) `-> /api/agents/:id/solana/allowance`, guard wiring [api/agent/guard.js](api/agent/guard.js), hub tab [src/agent-wallet-hub/tabs/allowance.js](src/agent-wallet-hub/tabs/allowance.js), devnet proof [scripts/allowance-devnet-proof.mjs](scripts/allowance-devnet-proof.mjs), migration [api/_lib/migrations/20261023170000_agent_onchain_allowances.sql](api/_lib/migrations/20261023170000_agent_onchain_allowances.sql) | Built; migration not yet applied to production; recurring behind `ALLOWANCE_RECURRING_ENABLED` | The owner keeps funds in their own wallet and signs one transaction creating a capped, expiring fixed delegation to the agent wallet via the Solana Subscriptions and Allowances program. The remaining on-chain allowance is a hard ceiling in the spend guards, and the Budget tab shows cap, spent, remaining and expiry with one-click revoke. Docs: [docs/agent-allowance-budgets.md](docs/agent-allowance-budgets.md). Tests: [tests/onchain-allowance.test.js](tests/onchain-allowance.test.js) |
+| Capped burner (agent spends alone up to a cap, owner confirms the rest) | classifier [api/_lib/burner-tier.js](api/_lib/burner-tier.js) (shared by guard and editor), guard in [api/_lib/agent-trade-guards.js](api/_lib/agent-trade-guards.js), approvals + decision trail in [api/_lib/approvals.js](api/_lib/approvals.js), owner wallet signatures [api/_lib/owner-sign.js](api/_lib/owner-sign.js), hub tab [src/agent-wallet-hub/tabs/burner.js](src/agent-wallet-hub/tabs/burner.js), signing UI [src/approvals-page.js](src/approvals-page.js) | Live | Policy `{ autoMaxUsd, dailyAutoMaxUsd, confirmAboveUsd, expiryMinutes }` on `PUT /api/agents/:id/solana/limits`. Over the cap a spend becomes a pending approval, not a failure; doc: [docs/approvals.md](docs/approvals.md#the-capped-burner). Tests: [tests/burner-tier.test.js](tests/burner-tier.test.js), [tests/burner-approvals.test.js](tests/burner-approvals.test.js) |
| On-chain contracts (Solidity + Solana) | [contracts/](contracts) · [contracts/README.md](contracts/README.md) | Mixed: `ThreeWSPayments` + `ThreeWSFactory` live on BSC/Base/Arbitrum, the rest in-repo | Every contract and program three.ws owns, in one Foundry project plus three Anchor programs. ERC-8004 identity/reputation/validation registries (reference implementations of the canonical deployments the platform actually reads), the live x402 USDC receiver and its CREATE2 vanity factory, `AgentPayments`, `GreenfieldVault`, `WorldMoves`, and the Solana `skill_license` / `agent_invocation` programs. `forge test` covers the Solidity set with 242 tests across 8 suites; the Solana side is covered by the LiteSVM row below. Deploy status per contract and the address provenance per chain: [contracts/DEPLOYMENTS.md](contracts/DEPLOYMENTS.md) |
| Contract audit pack | [contracts/AUDIT-README.md](contracts/AUDIT-README.md), invariants [specs/ECONOMY_CONTRACT_INVARIANTS.md](specs/ECONOMY_CONTRACT_INVARIANTS.md), threat model [specs/ECONOMY_CONTRACT_THREAT_MODEL.md](specs/ECONOMY_CONTRACT_THREAT_MODEL.md), static analysis [contracts/audit/](contracts/audit) | In-repo | Everything a review firm needs on day one for the reputation, royalty and delegation contracts: scope + deploy status per contract, stable invariant ids with a positive and a negative test each, an assets/actors/failure-modes threat model, and committed Slither + Clippy output with every finding fixed or dispositioned in writing |
| Recurring payments (subscriptions + DCA) | Page [public/recurring.html](public/recurring.html) `→ /recurring`, module [src/recurring.js](src/recurring.js), lifecycle rules [api/_lib/recurring.js](api/_lib/recurring.js), APIs [api/agent-subscriptions.js](api/agent-subscriptions.js) `→ /api/agent-subscriptions` and [api/dca-strategies.js](api/dca-strategies.js) `→ /api/dca-strategies`, hourly crons `run-subscriptions` + `run-dca` in [api/cron/[name].js](api/cron/%5Bname%5D.js), schema [api/_lib/migrations/20260813191500_recurring_payment_lifecycle.sql](api/_lib/migrations/20260813191500_recurring_payment_lifecycle.sql) | Live | One signed ERC-7710 permission, then money moves on a schedule: a subscription transfers a fixed USDC amount to an agent's wallet each period, a DCA strategy swaps the same amount into a token through Uniswap V3. `/recurring` is the whole lifecycle in one place (create, pause, resume, cancel, per-charge history) plus an Incoming tab scoped by agent ownership rather than by payer, so a creator sees what is being paid in. Every attempt is written to `subscription_charges` / `dca_executions`, and one shared classifier decides what a failure means: a revoked or expired permission pauses the schedule with the reason attached, a network blip releases the period claim and retries for three ticks, a timeout is never retried (the only failure that could double-charge), a diverged DCA quote skips the period for free, and a platform-side relayer outage never counts against the owner at all. Settlement needs `AGENT_RELAYER_KEY` + `RPC_URL_<chainId>` on the deployment; DCA creation needs `DCA_ALLOWED_TOKEN_OUT` + `DCA_CHAIN_ID`. Docs: [docs/recurring-payments.md](docs/recurring-payments.md). Tests: [tests/recurring-charge-outcomes.test.js](tests/recurring-charge-outcomes.test.js), [tests/api/recurring-subscription-cron.test.js](tests/api/recurring-subscription-cron.test.js) |
diff --git a/data/changelog.json b/data/changelog.json
index 132825a2d..2b0949e32 100644
--- a/data/changelog.json
+++ b/data/changelog.json
@@ -1,6 +1,12 @@
{
"$comment": "Curated changelog entries for three.ws, the editorial layer of the public changelog. New PAGE launches are tracked automatically via the `added` field in data/pages.json; this file is for everything else holders care about: improvements, fixes, SDK releases, trading/payments capabilities, security work. scripts/build-page-index.mjs merges both sources into CHANGELOG.md, public/changelog.json, and public/changelog.xml. Newest first. Allowed tags: feature, improvement, fix, sdk, infra, docs, security, desktop (desktop entries become the desktop app's release notes). `link` is optional and must be a live three.ws path.",
"entries": [
+ {
+ "date": "2026-10-23",
+ "title": "Give your agent a spending cap and confirm anything bigger from your own wallet",
+ "summary": "A new Burner cap tab sets how much an agent may spend alone per spend and per day. Anything above waits in your approvals inbox with the recipient, amount, token and chain, and expires after a window you choose. Above a second line you approve by signing with your own wallet. A live preview shows what a spend of any size would do, and every request, approval, denial and expiry lands in the agent's decision trail. Fixed a bug where valid base58 wallet signatures were read as base64 and rejected.",
+ "tags": ["feature", "security"]
+ },
{
"date": "2026-10-23",
"title": "Wallet and payment screens now work with a keyboard and a screen reader",
diff --git a/docs/approvals.md b/docs/approvals.md
index f3b4dbc8e..a9d208d6e 100644
--- a/docs/approvals.md
+++ b/docs/approvals.md
@@ -270,6 +270,40 @@ const res = await fetch(`/api/approvals/${id}`, {
});
```
+## The capped burner
+
+An owner can tell an agent how much it may spend on its own and what must come
+back to them. The policy lives on the agent (`meta.burner_policy`) and is edited
+in the agent wallet hub's **Burner cap** tab, or with
+`PUT /api/agents/:id/solana/limits` and a `burner_policy` object:
+
+| Field | Meaning |
+|---|---|
+| `autoMaxUsd` | Largest single spend the agent signs alone. Empty turns the cap off. |
+| `dailyAutoMaxUsd` | Rolling 24h ceiling on what it signs alone. Once reached, later spends wait for you. |
+| `confirmAboveUsd` | Above this a tap is not enough: you sign the approval with a Solana wallet linked to your account. |
+| `expiryMinutes` | How long a confirmation request stays answerable (2 to 60, default 10). |
+
+Above the cap nothing fails. The spend becomes a pending approval carrying the
+recipient, amount, token and chain, delivered on every linked channel and the web
+inbox. The classifier ([api/_lib/burner-tier.js](../api/_lib/burner-tier.js)) is
+pure and shared: the server guard and the tab's live preview ("a $X spend would
+be: auto / needs your confirmation / needs your wallet signature") run the same
+code. An unpriced spend always asks.
+
+Above `confirmAboveUsd` the approvals page asks your wallet to sign the request
+text (`three.ws approval`, request id, recipient, amount, chain, payload hash).
+The server verifies the ed25519 signature against your linked wallets
+([api/_lib/owner-sign.js](../api/_lib/owner-sign.js)); a signature for another
+request, an unlinked wallet or a missing one runs nothing. The requirement is
+stored in the hashed payload, so it cannot be edited out of the row. An expired
+request cannot execute, even with a valid signature.
+
+Every burner-gated request, approval (with the signing wallet), denial and expiry
+is appended to the agent's tamper-evident decision trail as a `burner_gate`
+decision. Tests: [tests/burner-tier.test.js](../tests/burner-tier.test.js),
+[tests/burner-approvals.test.js](../tests/burner-approvals.test.js).
+
## Adding a new kind of request
A source registers an executor in the `EXECUTORS` map in