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

KeyWhere it livesWhat it can do
MANDATE_KEY.env on the machine that runs the agentControls the agent wallet: the creator-fee recipient. Used for claims, swaps, the buyback and rescue.
ANTHROPIC_API_KEY.envCalls 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

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:

  1. Stop the runner, or pause the agent.
  2. Preview what is in the wallet:

`` node engine/rescue.mjs 0xYourOtherAddress ``

  1. 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