Feature flags

OpenBelt controls optional features and deployment modes through OPENBELT_* environment variables. Every flag is validated at startup; an invalid value stops the server and names the offending variable.

Feature toggles

FlagValuesCode defaultbun run devSelf-hosted (compose.yaml)Hosted (deploy/compose.server.yaml)What it controls
OPENBELT_AI_APIresponses | completionsresponsesresponsesresponsesnot forwarded (responses)Wire format for custom OpenAI-compatible AI endpoints (apps/platform/src/ai/index.ts).
OPENBELT_AI_CHATGPTon | offonononoffOptional Sign in with ChatGPT on /_ai/connect and stored provider='chatgpt' token usage. off returns 404 on /_ai/connect/{start,callback,finish} while leaving OpenRouter OAuth and BYOK keys active (AI).
OPENBELT_AI_STUBoff | onoffoffoffoffDeterministic offline AI stub for check_app and verification runs (AI).
OPENBELT_STUDIOoff | on | <ws1,ws2>offoffoffoffBuilt-in Studio app builder (/build, /_studio/*, workspace dock, Archived filter). Accepts on, off, or a comma-separated workspace allowlist (apps/platform/src/objects/studio/config.ts).
OPENBELT_UPLOADSon | offoffonoffoffApp file uploads (files.put() and upload MCP tools). off refuses new uploads and omits upload docs for agents while still serving stored files (Self-hosting).
OPENBELT_TRIALSon | offoffoffoffoff (not forwarded)Agent-started trial workspaces (/trial, /claim/*) under OPENBELT_SIGNIN=email only (Self-hosting).
OPENBELT_ALLOW_LOCAL_CONNECTIONS1 | unsetoff1offoffLets workspace MCP connections target http://localhost. For local development and verification only (Architecture).
OPENBELT_BROWSERlocal | cloudflare | cdp | offlocallocallocallocalHeadless browser backend for check_app and link preview cards (packages/runtime/src/browser.ts).
OPENBELT_SIGNINoff | tailscale | emailoffemail (with owner door)tailscaleoff (set email in stage env)Viewer authentication mode: anonymous (off), identity proxy headers (tailscale), or email codes and OIDC (email) (Who is viewing).
OPENBELT_APP_PAGESframe | hostframeframeframenot forwarded (frame)Whether page loads on <app>--<workspace>.<host> redirect into the workspace frame (/a/<app>/...) or render directly on the app host (Architecture).

Verified toggle forwarding

Generated directly from Config.Literals in apps/platform/src/ and the compose, deploy, and tailnet configs (bun run docs:sync):

FlagValuesCode defaultbun run devcompose.yamldeploy/compose.server.yamlscripts/dev/tailnet/index.tsSource
OPENBELT_AI_APIresponses | completionsresponsesresponsesnot forwardednot forwardedforwardedapps/platform/src/ai/index.ts
OPENBELT_AI_CHATGPTon | offononforwardedforwardedforwardedapps/platform/src/ai/index.ts
OPENBELT_AI_STUBoff | onoffoffnot forwardednot forwardedforwardedapps/platform/src/ai/index.ts
OPENBELT_APP_PAGESframe | hostframeframenot forwardednot forwardedforwardedapps/platform/src/gateway/context.ts
OPENBELT_CLASSIFIERauto | cloudflare | ai | clef | offautoautonot forwardedforwardednot forwardedapps/platform/src/ai/classifier.ts
OPENBELT_TRIALSon | offoffoffnot forwardednot forwardednot forwardedapps/platform/src/billing/trials.ts
OPENBELT_UPLOADSon | offoffconfigured in dev.tsnot forwardedforwardedforwardedapps/platform/src/lib/files.ts

Capability gates (enabled when configured)

These features have no separate on/off toggle. Setting the primary variable enables them; leaving it empty keeps them off.

Variable(s)When unsetWhat setting it enables
OPENBELT_STRIPE_SECRET_KEY (+ _WEBHOOK_SECRET, _PRICE_PRO)Plan limits offStripe billing, checkout, and workspace plan quotas (apps/platform/src/billing/index.ts).
OPENBELT_PUBLIC_HOSTNo public appsServes apps marked "public" in openbelt.json to signed-out visitors on <app>--<workspace>.<public host> (requires OPENBELT_SIGNIN=email; Apps).
OPENBELT_AI_API_KEYNo server fallback keyOperator OpenAI-compatible API key used for signed-in workspace members when no personal AI connection is active (AI).
OPENBELT_GOOGLE_CLIENT_ID / _SECRETEmail codes onlyContinue with Google button on the email sign-in page (Who is viewing).
OPENBELT_SSO_ISSUER / _CLIENT_ID / _SECRETNo custom SSOCustom OpenID Connect SSO button on the email sign-in page (Who is viewing).
OPENBELT_CATALOG_URLBuilt-in catalog onlyExternal provider catalog feed JSON URL (off disables; cached on disk and refreshed via ETag or POST /_ops/catalog/refresh; Connections).
OPENBELT_CONNECT_<FAMILY>_CLIENT_ID / _SECRETWorkspaces register own appsShared platform OAuth apps for MCP and API connections (GITHUB, GOOGLE, ASANA, LINKEDIN, or feed families; Connections).
OPENBELT_JOURNAL (+ _KEY, _UPLOAD_URL)No incident journalRolling per-process incident journal and sealed bundle uploads (packages/runtime/src/journal.ts).
OPENBELT_BACKUP_URL (+ _KEY_ID, _SECRET)Local disk onlyContinuous SQLite WAL replication to S3 or R2 (Self-hosting).
OPENBELT_MAIL_TOKEN (+ _ACCOUNT, _FROM, OPENBELT_APP_MAIL_FROM)Logged only (no email sent)Cloudflare Email Sending for sign-in codes (OPENBELT_MAIL_FROM, default hello@<base host>) and app emails via ctx.email.send (OPENBELT_APP_MAIL_FROM, separate sender domain defaulting to notifications@mail.<host>; Functions).
OPENBELT_WEB_ANALYTICSNo beaconCloudflare Web Analytics beacon on the public landing pages only (Architecture).

Adding or changing a flag

  1. Read it with Effect Config in apps/platform/src/ with an explicit, safe default.
  2. Forward it to hosted deploys if operators need it in prod: add it to both scripts/ops/deploy/index.ts (envFile) and deploy/compose.server.yaml (environment). scripts/ops/deploy/index.ts refuses to deploy if a stage .env sets a key that deploy/compose.server.yaml would drop.
  3. Forward it to self-hosted and tailnet installs in compose.yaml and FORWARDED_ENV in scripts/dev/tailnet/index.ts (~/.config/openbelt/tailnet.env) when self-hosters should control it.
  4. Update docs/feature-flags.md, run bun run docs:sync, and test both off and on states in scripts/verify/checks/.