Treasury guard
Agent tokens often sit in the agent's own treasury, and holders' biggest fear is that the treasury gets dumped or sent to insiders. A treasury guard puts anti-rug rules on that treasury: Palisec's co-signer enforces them on every transaction, and anyone can check them on chain.
What it does
- Destinations. The project token can only go to an allowed destination (for example a vesting contract) or an allowed sell venue. A transfer anywhere else is
PS_TREASURY_001. - A daily sell cap. The agent can sell at most an amount, or a share of its holdings, per rolling 24 hours. The sell that would cross it is
PS_TREASURY_002. - No sneaky approvals. The project token can only be approved to a sell venue, never unlimited, and never for more than the cap has left. Anything else is
PS_TREASURY_003. - No pulling liquidity. With
protect_liquidityon, the listed LP tokens can never leave the account or be approved:PS_TREASURY_004. - A lock. Until
locked_until, nobody can loosen the rules: not the API, not the console, not a holder vote. A loosening change is rejected withPS_TREASURY_005, never queued. Tightening always applies at once.
The policy section
Add treasury_guard to the policy and set schema_version to "1.6". It is off unless you add it.
"schema_version": "1.6",
"treasury_guard": {
"enabled": true,
"project_token": "0x…your project token",
"allowed_destinations": ["0x…vesting contract"],
"allowed_sell_venues": ["0x…bonding curve or pool"],
"daily_sell_cap": {
"amount": "2000000000000000000000", // 2,000 tokens (18 decimals); null = not used
"pct_of_holdings_bps": 100 // 1% of holdings; null = not used
},
"approvals": "exact_to_venues",
"protect_liquidity": true,
"lp_tokens": ["0x…LP token"],
"locked_until": 1798761600 // unix seconds, UTC; 0 = not locked
}| Field | Meaning |
|---|---|
project_token | The token the rules protect. |
allowed_destinations | Where the token may be sent, up to 32 addresses. Transfers there are not sells. |
allowed_sell_venues | Routers, pools or bonding curves. Tokens sent to them count as sells toward the cap. |
daily_sell_cap | An amount in base units and/or pct_of_holdings_bps; with both, the smaller applies. Holdings are the balance before the window's sells, so each sell does not shrink the cap. |
approvals | Always "exact_to_venues". |
protect_liquidity, lp_tokens | When on, the listed ERC-20 LP tokens never leave the account and are never approved. |
locked_until | Unix seconds (UTC). Before it, loosening this section is rejected. |
How a transaction is read
Palisec does not trust what a call claims to do. Every call is simulated on current chain state, including calls without a function selector, and the guard reads every transfer of the project token out of the account. Direct transfers, routers, multicalls, aggregators and unknown contracts are all judged by what they actually move. If the movement cannot be determined (no simulation, a revert, a stale result), the request is denied with PS_SIM_002.
Sells are counted per account over a rolling 24 hours, across every agent and policy on that account, so switching agents does not reset the window. The cap is checked again in the same database step that records the decision, so simultaneous requests cannot sell past it together.
The lock and holder mandates
- Before
locked_until: any change that loosens the section is rejected withPS_TREASURY_005: raising or removing the cap, adding a destination or venue, unprotecting liquidity, shortening the lock, switching the guard off or removing it. - Holder votes cannot loosen a locked guard: such a proposal does not open, and a vote that passes is checked again before it applies.
- Every policy on the account must keep the lock: a second agent under a policy without the guard, or moving the agent to one, is rejected. Changes already waiting in the loosening delay count too.
- Tightening (a lower cap, fewer destinations, a later lock) applies at once. After the lock date, loosening follows the normal loosening delay.
- Every change is published through the ERC-8511 registry (v3).
Reason codes
| Code | Meaning | ERC-8511 |
|---|---|---|
PS_TREASURY_001 | Destination not allowed for the project token | DENY_RULE |
PS_TREASURY_002 | Daily sell cap reached (retryable once the window moves) | OVER_BUDGET |
PS_TREASURY_003 | Approval not allowed: unlimited, wrong spender or more than the cap has left | APPROVAL_RISK |
PS_TREASURY_004 | Liquidity removal blocked | DENY_RULE |
PS_TREASURY_005 | The guard is locked: loosening is rejected (a policy change, not a decision) | DENY_RULE |
Receipts carry the detail code as palisec:PS_TREASURY_00x. All codes: reason codes.
Verify from the chain
The policy's hash, version and URI are on the ERC-8511 registry, so anyone can check the rules without trusting Palisec: read the commitment, fetch the document, hash it and compare, then read treasury_guard and its lock date from the document.
import { createPublicClient, http } from "viem";
import { fetchPolicy, readAccount, REGISTRY_ADDRESSES } from "policy-enforced-accounts";
const client = createPublicClient({ transport: http("https://rpc.mainnet.chain.robinhood.com") });
// The account's current policy commitment on the ERC-8511 registry (v3).
const status = await readAccount(client, "0x…agent account", REGISTRY_ADDRESSES[4663]);
// Fetches the policy document and checks its hash against the commitment.
const { document, matches } = await fetchPolicy(status.policy);
console.log(matches, status.policy.version, document.treasury_guard);What it does not cover
The guard binds every transaction Palisec co-signs, which is everything the agent does through Palisec. A Palisec account is a Safe with three owners and a threshold of two: the agent's key, the Palisec co-signer and a human recovery owner (how to check). The recovery owner together with the agent's key can still sign without Palisec. Holders who want the guard to bind the team as well should check who holds the recovery owner key; the owners are readable on chain.