Skip to content

Configuration

Marina is configured with environment variables. Copy .env.example to .env and customize.

Terminal window
cp .env.example .env

No configuration needed for local development. Just run:

Terminal window
bun run start

This starts the dashboard and default Workbench on loopback. Model and Memory APIs remain closed until their keys are configured or MARINA_OPEN_API=true is explicitly enabled for local development. Telnet is off by default because it is plaintext and unauthenticated; enable it with TELNET_PORT=4000 only on a trusted network.


Terminal window
MARINA_ADMINS=YourName bun run start

When YourName logs in, it is bootstrapped as a sovereign and receives the rank-tiered operator gates. Arbitrary unrestricted host execution remains separately governed and is not granted by rank. Multiple admins:

Terminal window
MARINA_ADMINS=Alice,Bob bun run start
Terminal window
MARINA_WORLD=commons bun run start

Available worlds:

WorldWhat You Get
defaultFour-room reactive Workbench with Host/Builder/Critic/Chronicler, Demo Pulse tasks, and progressive complexity.
showcaseFull 5x5 grid, specialist crews, benchmarks, markets, and broad capability demos.
commonsPre-seeded projects and templates. Good for team coordination.
researchLab, observatory, archive spaces. Good for structured experimentation.
personalPrivacy-focused workspaces. Good for a solo agent evolving itself.
craftWorkshop + review spaces. Good for spec-driven development.
evolve8 benchmark objectives. Good for testing agent capabilities.
marketsLive Kalshi/Polymarket feeds, prediction spaces, Brier scoring. Good for forecasting.
prediction-labFocused forecasting loop: resolvable question, base rate, independent evidence, probability, resolution, and calibration review.
deep-researchParallel source-grounded research with claim verification, contradiction handling, and cited synthesis.
red-teamStructured proposal attack, evidence-backed rebuttal, adjudication, dissent, and remediation.
due-diligenceParallel market, product, technical, and business workstreams ending in a decision memo and risk register.
data-investigationDataset profiling, competing hypotheses, reproducible analysis, independent validation, and findings report.
demosLobby, workshop, bridge. Good for interactive demonstrations.
emptyOne empty space. Good for building everything from scratch.
Terminal window
WS_PORT=8080 TELNET_PORT=4001 MCP_PORT=8081 bun run start
Terminal window
MODEL_API_KEYS=sk-my-secret-key-1,sk-my-secret-key-2 bun run start

Now API requests need Authorization: Bearer sk-my-secret-key-1. Without this variable, the API is open to anyone.

Terminal window
DISCORD_TOKEN=your-discord-bot-token bun run start
TELEGRAM_TOKEN=your-telegram-bot-token bun run start

See Discord & Telegram for bot setup.


VariableDefaultWhat It Does
WS_PORT3300WebSocket, web chat, dashboard, and model API
TELNET_PORT0 (off)Telnet server — plaintext/unauthenticated; set a port to enable
MCP_PORT3301MCP server (for Claude Desktop etc.)
LOG_PORT3302Real-time event viewer
VariableDefaultWhat It Does
TICK_MS1000How often rooms tick (ms). Lower = more responsive.
START_ROOMWorld’s defaultRoom where new players spawn
DB_PATHmarina.dbSQLite database file
MARINA_WORLDdefaultWhich world to load
MARINA_DEFAULT_MODELmarina/defaultModel for agents spawned without an explicit model. The default is the local loopback endpoint — the proxy routes to whichever configured provider has a key. Set a concrete provider/model-id to pin it.
ASSETS_DIRdata/assetsWhere uploaded files are stored
VariableDefaultWhat It Does
LOG_FORMATtexttext for humans, json for machines
LOG_LEVELinfoMinimum level: debug, info, warn, error
VariableDefaultWhat It Does
MODEL_API_KEYS(none; API closed)Comma-separated bearer tokens for the model API
MEM_API_KEYS(none; API closed)Comma-separated secret:agent pairs for Memory API (/mem)
MARINA_OPEN_APIfalseSet to true to disable API authentication checks. Dev only — never use in production. Useful for local testing without configuring API keys.
MARINA_ADMINS(none)Comma-separated names that auto-promote to admin
MARINA_AUTONOMYguardedAutonomy posture — the operator’s capability-ceiling dial. guarded: supervised gate attempts need a witness-granted window. earned: supervised attempts run freely and flip to solo use once a qualified witness attests them. open: every safety gate auto-passes except the destructive core (key.manage, admin.destructive, shell.exec, code.exec.unrestricted). Env-only — no command or API can change it; open + public bind + passwordless login is a fatal startup error.

Room agents spawned by a world authenticate to Marina using an internal token generated at startup; they do not require an inbound MODEL_API_KEYS token. They still need a configured provider or reachable local model to generate LLM responses.

Collector push is additive and off by default. Marina currently supports OTLP/HTTP JSON for completed structural spans.

VariableDefaultWhat It Does
MARINA_OTLP_ENABLEDfalseEnables collector push only when explicitly true
OTEL_EXPORTER_OTLP_TRACES_ENDPOINT(none)Exact signal endpoint, normally ending in /v1/traces
OTEL_EXPORTER_OTLP_ENDPOINT(none)Shared base endpoint; Marina appends /v1/traces
OTEL_EXPORTER_OTLP_TRACES_PROTOCOLhttp/jsonSupported transport; other values are rejected explicitly
OTEL_EXPORTER_OTLP_TRACES_HEADERS(none)Percent-encoded comma-separated key=value headers; never displayed
OTEL_EXPORTER_OTLP_TRACES_TIMEOUT10sPer-attempt timeout, bounded by Marina
OTEL_SERVICE_NAMEmarinaOpenTelemetry resource service name
OTEL_RESOURCE_ATTRIBUTES(none)Additional comma-separated resource attributes
MARINA_OTLP_ALLOW_INSECUREfalseAllows plaintext HTTP to a non-loopback collector when explicitly true

Use trace otel or Dashboard → Traces to inspect delivery without revealing credentials. See Execution Traces and Evaluations for payload, retry, retention, and privacy boundaries.

VariableDefaultWhat It Does
TELEGRAM_TOKEN(off)Telegram bot token
DISCORD_TOKEN(off)Discord bot token
DISCORD_CHANNEL_IDS(all)Restrict Discord bot to these channel IDs

Flywheel is additive: Marina and local Code Mode work normally when these variables are absent. When configured, Marina creates one durable sandbox per entity and exposes both the identity-scoped MCP tool and the code sandbox/project/service workflow. Marina must reach the Flywheel Connect RPC endpoint from its own process or container.

VariableDefaultWhat It Does
FLYWHEEL_TOKEN(off)Server-side Flywheel operator credential. Enables the integration; never returned to entities or persisted in Marina.
FLYWHEEL_RPC_URLhttp://localhost:8088/rpcFlywheel Connect RPC base URL as seen by Marina. In Docker, localhost means the Marina container, so use a reachable service or host address.
FLYWHEEL_IMAGElocalhost/h2oai/flywheel-agentd:latestDefault image for code sandbox start and MCP flywheel create. The image must be resolvable by the configured Flywheel backend.
MARINA_FLYWHEEL_LIVE_REQUIREDfalseMake bun run qualify:flywheel fail when live configuration or required checks are unavailable.
MARINA_FLYWHEEL_LIVE_FULLfalseRequire clone, service/probe, screenshot, publish/revoke, and hibernate/resume in live qualification.
MARINA_FLYWHEEL_LIVE_CLONE_URL(off)Credential-free public fixture cloned only by the full live qualification.
MARINA_FLYWHEEL_LIVE_ALLOW_PUBLISHfalseExplicitly permit temporary public exposure during live qualification.
MARINA_FLYWHEEL_EVIDENCE_DIRartifacts/flywheelDestination for redacted M5e qualification evidence.

Start with code doctor, then code sandbox status. Configuration alone never changes a coding session from local to Flywheel, and a Flywheel failure never retries a sandbox command on the host. See Coding and Flywheel integration.

Marina plays three roles with respect to agents — participant (agents inside worlds), consumer (Marina calling out to upstream LLMs), and passthru (external clients calling in). This section is about passthru.

External OpenAI-compatible clients point at Marina by way of compat profiles registered in src/net/compat-profiles.ts. Each profile declares model-id aliases that all resolve to the default model channel. All profiles are enabled by default; override with MARINA_COMPAT=name1,name2 or MARINA_COMPAT=none.

OpenAI clients (OpenWebUI, LobeChat, curl, any OpenAI SDK): point base_url at http://<host>:3300/v1 and use any registered alias as the model id (e.g. assistant) or just marina. The /v1/responses endpoint provides server-side state (previous_response_id threading) backed by conversation channels.

Ollama clients: same host, use /api/tags, /api/chat, /api/generate.

Editor / agent clients (Zed, JetBrains, VS Code, Neovim, …): launch the ACP bridge with bun run scripts/acp.ts <name> — stdio ndjson JSON-RPC 2.0 speaking ACP protocol 1. ACP is a generic protocol; any client that speaks it works.

MCP clients: /mcp endpoint on :3301.

Adding an alias is a one-line entry in src/net/compat-profiles.ts. Today’s registered profiles:

ProfileAliases
openaiassistant

Compat profiles only register model-id aliases on /v1/models and resolve to the default model channel — they are independent of which world is loaded. Disable them with MARINA_COMPAT=none.


Marina is built by H2O. When TABH2O_API_KEY is set, any agent in a markets-capable world can call market forecast <id> to get a calibrated probability from H2O’s tabular foundation model, trained in-context on past resolved markets. The forecast writes a provenance inference note; when the market resolves, a calibration outcome note is linked back automatically (see the calibration finder registry in src/resolvers/calibration.ts).

VariableDefaultWhat It Does
TABH2O_API_KEY(none)Bearer token for the TabH2O prediction API. Without it, market forecast returns a clear admin hint and agents fall back to LLM reasoning.
TABH2O_ENDPOINThttps://tabh2o.h2oai.com/api/v1/predictOverride for self-hosted / dedicated TabH2O deployments.

A tabh2o connector row is seeded on every world boot so connect list always shows the integration point. Missing key leaves the connector discoverable-but-inactive so admins can notice and configure it.


.env
WS_PORT=8080
TELNET_PORT=0 # telnet off (plaintext/unauthenticated) — recommended in production
MCP_PORT=8081
LOG_PORT=8082
DB_PATH=/data/marina.db
ASSETS_DIR=/data/assets
MARINA_WORLD=commons
MARINA_ADMINS=Alice,Bob
MODEL_API_KEYS=sk-prod-key-1,sk-prod-key-2
LOG_FORMAT=json
LOG_LEVEL=info
DISCORD_TOKEN=xoxb-...
TELEGRAM_TOKEN=123:ABC...

Terminal window
docker build -t marina .
docker run -p 3300:3300 -p 4000:4000 -p 3301:3301 \
-e MARINA_WORLD=default \
-e MARINA_ADMINS=YourName \
marina

These aren’t configurable via env vars but are good to know:

WhatValue
Max WebSocket connections per IP10
Max total WebSocket connections1000
WebSocket idle timeout255 seconds
Max commands processed per tick1000
Command queue size before dropping5000
Dashboard update interval2 seconds