Keys, pause and the exit
There is no Mandate contract and no admin key. An agent is a wallet and a program that someone runs. Everything the program can do with the wallet is in the code, and the owner of the wallet can always take everything out.
Whose keys? When you run an agent yourself, the keys below are yours. On the hosted platform, the operator holds every agent wallet through one seed: see custody and trust, and the operator's own tools in operating the platform (platform/rescue-agent.mjs). The rest of this page is about the self-hosted case.
Which keys exist
| Key | Where it lives | What it can do |
|---|---|---|
MANDATE_KEY | .env on the machine that runs the agent | Controls the agent wallet: the creator-fee recipient. Used for claims, swaps, the buyback and rescue. |
ANTHROPIC_API_KEY | .env | Calls the model. Cannot touch any funds. |
.env is read from the project folder, is excluded from git, and its values are never printed or written anywhere. The wallet should hold the coin's fees and the agent's positions and nothing else.
What the program does with the wallet
- Approves USDG and the stocks to Permit2, and gives the Universal Router an allowance.
- Swaps on the pools listed in the config, wraps and unwraps ETH.
- Claims the wallet's own creator fees at Pons.
- Buys the agent's coin on its own curve, sending the tokens to the burn address.
It sends ETH nowhere else. A paid amount larger than the book's cash is refused before any transaction.
Pause
node engine/control.mjs <agentId> pause
The agent applies it at the start of its next cycle: no new orders, positions kept. Resume with:
node engine/control.mjs <agentId> resume
Resuming also resets the high-water mark of the index, so a pause after a drawdown does not fire the breaker again at once.
Flatten
node engine/control.mjs <agentId> flatten
At the next cycle every position is sold back to USDG, the agent is paused, and the journal says "flattened by the operator".
The exit
To stop everything and take the money out:
- Stop the runner, or pause the agent.
- Preview what is in the wallet:
`` node engine/rescue.mjs 0xYourOtherAddress ``
- Send it:
`` node engine/rescue.mjs 0xYourOtherAddress --yes ``
This transfers USDG, the four stocks, WETH and the ETH balance minus gas to the address you give. It sells nothing: if you want cash, flatten first. Because the wallet is an ordinary wallet, you can also import the key into any wallet app and move the funds by hand.
Operating advice
- Run live on a machine you control, with the key in
.env, not in a hosted panel. - Start with paper mode, then a small amount of fees.
- Keep the baseline agent running next to the live one.
- Back up
site/data/<agent>/state.json. It is the ledger: without it a restarted agent does not know its deposits and its high-water mark.