Docs / Configuration

Reference

Configuration reference

Maskin is configured through environment variables. Only DATABASE_URL is strictly required to boot; everything else has sensible dev defaults and is opt-in for production and integrations.

i In this monorepo, env vars must be declared in turbo.json's globalPassThroughEnv or they're filtered out of builds. This page lists the runtime variables; check the repo for the current canonical list.

Core

VariableDefaultPurpose
DATABASE_URLRequired. PostgreSQL connection string.
POSTGRES_URLOptional override for DATABASE_URL.
DATABASE_URL_DIRECTNon-pooled connection for PG LISTEN/NOTIFY when you run behind a pooler.
PORT3000API server port.
NODE_ENVSet to production for prod builds (logging, error handling).
MASKIN_AUTO_BOOTSTRAPtrueAuto-create a dev actor, workspace, and API key on a fresh DB. Set false to disable.

Object storage (S3-compatible)

VariableDefaultPurpose
S3_ENDPOINThttp://localhost:8333S3 endpoint (SeaweedFS in dev; any S3-compatible store in prod).
S3_BUCKETagent-filesBucket name.
S3_ACCESS_KEY · S3_SECRET_KEYadminCredentials.
S3_REGIONus-east-1Region.

Integrations

VariablePurpose
INTEGRATION_ENCRYPTION_KEY32-byte hex (64 chars) for encrypting stored OAuth tokens (auto-generated by pnpm dev).
GITHUB_APP_ID, GITHUB_CLIENT_ID, GITHUB_CLIENT_SECRET, GITHUB_APP_WEBHOOK_SECRET, GITHUB_APP_PRIVATE_KEY, GITHUB_APP_SLUGGitHub App / OAuth credentials.
SLACK_CLIENT_ID, SLACK_CLIENT_SECRET, SLACK_SIGNING_SECRET, MASKIN_MACHINE_ICON_URLSlack OAuth + signing; optional agent avatar URL.
LINEAR_CLIENT_ID, LINEAR_CLIENT_SECRET, LINEAR_WEBHOOK_SECRETLinear OAuth + webhook signing.
GMAIL_CLIENT_ID, GMAIL_CLIENT_SECRET, GMAIL_PUBSUB_TOPIC, GMAIL_PUBSUB_AUDIENCE, GMAIL_PUBSUB_SERVICE_ACCOUNTGmail OAuth + Pub/Sub push config.

Full per-provider setup is on the Integrations setup page.

LLM

The Anthropic API key and any workspace custom-LLM endpoint are configured in the app (Settings → Integrations / LLM keys), stored encrypted per workspace — not via environment. The environment only configures the optional system fallback used when a workspace has no model configured:

VariableDefaultPurpose
MASKIN_FALLBACK_OPENROUTER_KEYEnables the OpenRouter-based fallback model.
MASKIN_FALLBACK_BASE_URLhttps://openrouter.ai/apiFallback provider base URL.
MASKIN_FALLBACK_MODEL · MASKIN_FALLBACK_SMALL_MODELdeepseek/deepseek-v4-flashFallback main / small models.
MASKIN_FALLBACK_DAILY_TOKEN_LIMIT550000Per-actor daily token cap on the fallback.

Agent execution

VariableDefaultPurpose
AGENT_BASE_IMAGEagent-base:latestOCI image for agent sessions; use a full registry path in prod.
AGENT_SERVERSComma-separated url|secret list to distribute sessions to remote agent servers.
AGENT_SERVER_SECRET · MASKIN_AGENT_SERVER_PUBLIC_HOST · AGENT_SERVER_MAX_SESSIONSAgent-server auth, public host, and concurrency cap.
AGENT_SESSION_ROOTRoot directory for agent session storage.
WARM_POOL_IMAGE · WARM_POOL_REFRESH_MINUTESWarm-pool image and refresh interval to cut cold starts.
MASKIN_BACKEND_URLhttp://host.docker.internal:3000Backend URL injected into agent containers.

Security & network

VariableDefaultPurpose
WEBHOOK_BASE_URLPublic base URL providers call back to (/api/webhooks/<provider>).
CORS_ORIGINhttp://localhost:5173Comma-separated allowed origins.
TRUSTED_PROXY_CIDRS127.0.0.1/32,::1/128CIDRs allowed to set X-Forwarded-For (set to your CDN/proxy in prod).
FRONTEND_URL · API_BASE_URLFrontend URL for redirects; backend URL for MCP agents.

Analytics (optional)

VariableDefaultPurpose
POSTHOG_API_KEY · POSTHOG_HOST· https://eu.i.posthog.comBackend analytics (runtime telemetry).
VITE_POSTHOG_KEY · VITE_POSTHOG_HOST· https://eu.i.posthog.comFrontend analytics (blank in dev → console only).