Agent keys
Read-only API keys for monitoring bots, the on-chain agent registration that lets a bot mutate strategies, and how to keep both safe.
Bots touch Elysium Morning in two ways. An API key (em_…, from Agents or POST /api/agents) lets software read your account and portfolio through the API. To act, a bot signs transactions from its own address, which you authorise on-chain with ForgeFactory.setAgent for specific strategies. The API never signs or sends transactions for you.
#Anatomy of a key
type AgentScope = "propose" | "bid" | "mutate";
interface AgentKey {
id: string; owner: string; label: string;
prefix: string; // first chars, for display; the full key is shown once
scopes: AgentScope[];
ratePerHour: number;
strategyIds: string[]; // empty = all strategies the owner controls
createdAt: number; lastUsedAt?: number;
calls: number; revoked: boolean;
}#Scopes
| Scope | Intended for | Effect in live mode |
|---|---|---|
propose | A builder bot that proposes each dawn | Recorded on the key. Proposing is DawnScheduler.propose signed by a wallet; the API returns 409 onchain_required. |
bid | An allocator that backs proposals by rule | Recorded on the key. Bidding and voting are wallet-signed transactions. |
mutate | Fee tuning, rebalancing | Recorded on the key. Mutations are ForgeFactory.mutate calls from an address you registered with setAgent. |
An em_… key can read GET /api/account and GET /api/portfolio as its owner. No key can withdraw funds, sunset a strategy, create keys or change account settings.
#Rate limits and allow-lists
ratePerHourcaps every API call the key makes, reads included. Pick the lowest value your loop needs.- On-chain,
ForgeFactoryenforces the real limits: the owner registers an agent address per strategy withsetAgent(strategy, agent, callsPerHour, selectors)(cap 120/h, token bucket with continuous refill) and a per-selector allow-list; the strategy re-checks values against template bounds. - Register only the strategies and selectors the bot needs. Remove an agent with
ForgeFactory.revokeAgent(strategy, agent), and narrow it withsetAgentSelector(strategy, agent, selector, allowed).
#Security
Every authenticated API call updates calls and lastUsedAt. On-chain mutations by an agent address are public in the strategy's mutation log.