Modes & flags
operatorEvery runtime mode, its env flag, its default, and what it takes to enable.
The mode matrix
Every runtime behavior is governed by an explicit flag with a safe default: everything dangerous is off, everything mock is on. The table below is the operator's map; GET /api/health reports the live values.
| Mode | Env flag | Default | What it controls |
|---|---|---|---|
| Paper / mock (current public) | NEXT_PUBLIC_ENABLE_MOCKS (mock AI + oracles) | on | Deterministic mock strategist and mock oracle prices. Everything simulated, zero keys required. |
| Registry-readonly | — (always on) | on | The canonical asset registry and validation rules apply in every mode; there is no flag to bypass them. |
| Bankr-enabled strategy | AI_PROVIDER + BANKR_API_KEY (server-only) | bankr_or_mock, no key → mock | Bankr answers whispers when a key is configured; graceful mock fallback otherwise. Planning only. |
| x402 mock | NEXT_PUBLIC_ENABLE_X402 | off → free mock envelopes | Paid endpoints answer for free, labeled cacheStatus "mock". The current public behavior. |
| x402 verified | NEXT_PUBLIC_ENABLE_X402 + Bankr facilitator verification | not yet available | Real settlement verification with replay protection. Not enabled anywhere until verification ships. |
| Live execution | NEXT_PUBLIC_ENABLE_LIVE_ONCHAIN | off | On-chain execution paths. Stays off until feed proxies are pinned and contracts are audited. |
| Vault deposits | NEXT_PUBLIC_ENABLE_VAULTS | off | ERC-4626-style vault deposits (unaudited beta). Off in every public build. |
| MCP planning surfaces | NEXT_PUBLIC_ENABLE_MCP_MODE | on | Shows MCP export UI. Exports are text plans only; see MCP export docs. |
The rule for dangerous flows
Nothing dangerous turns on by accident. Live execution, vault deposits, and verified x402 settlement each require an explicit flag flip and production credentials — and the flags alone are not sufficient: live valuation also needs pinned Chainlink feed proxies (currently none are pinned), and x402 verified mode needs Bankr facilitator settlement verification plus replay protection. Absent those, the flags degrade to safe behavior rather than half-enabled danger.
- Flag aliases exist for convenience (
NEXT_PUBLIC_ENABLE_LIVE_TRADING,NEXT_PUBLIC_ENABLE_VAULT_DEPOSITS, and the mock umbrellaNEXT_PUBLIC_ENABLE_MOCKS); the first set value wins. - Mock switches can also be set individually:
NEXT_PUBLIC_MOCK_AIandNEXT_PUBLIC_MOCK_ORACLES. - Server-only secrets (
BANKR_API_KEYand friends) never use theNEXT_PUBLIC_prefix — see Bankr integration.