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
| Flag | Values | Code default | bun run dev | Self-hosted (compose.yaml) | Hosted (deploy/compose.server.yaml) | What it controls |
|---|---|---|---|---|---|---|
OPENBELT_AI_API | responses | completions | responses | responses | responses | not forwarded (responses) | Wire format for custom OpenAI-compatible AI endpoints (apps/platform/src/ai/index.ts). |
OPENBELT_AI_CHATGPT | on | off | on | on | on | off | Optional 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_STUB | off | on | off | off | off | off | Deterministic offline AI stub for check_app and verification runs (AI). |
OPENBELT_STUDIO | off | on | <ws1,ws2> | off | off | off | off | Built-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_UPLOADS | on | off | off | on | off | off | App 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_TRIALS | on | off | off | off | off | off (not forwarded) | Agent-started trial workspaces (/trial, /claim/*) under OPENBELT_SIGNIN=email only (Self-hosting). |
OPENBELT_ALLOW_LOCAL_CONNECTIONS | 1 | unset | off | 1 | off | off | Lets workspace MCP connections target http://localhost. For local development and verification only (Architecture). |
OPENBELT_BROWSER | local | cloudflare | cdp | off | local | local | local | local | Headless browser backend for check_app and link preview cards (packages/runtime/src/browser.ts). |
OPENBELT_SIGNIN | off | tailscale | email | off | email (with owner door) | tailscale | off (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_PAGES | frame | host | frame | frame | frame | not 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):
| Flag | Values | Code default | bun run dev | compose.yaml | deploy/compose.server.yaml | scripts/dev/tailnet/index.ts | Source |
|---|---|---|---|---|---|---|---|
OPENBELT_AI_API | responses | completions | responses | responses | not forwarded | not forwarded | forwarded | apps/platform/src/ai/index.ts |
OPENBELT_AI_CHATGPT | on | off | on | on | forwarded | forwarded | forwarded | apps/platform/src/ai/index.ts |
OPENBELT_AI_STUB | off | on | off | off | not forwarded | not forwarded | forwarded | apps/platform/src/ai/index.ts |
OPENBELT_APP_PAGES | frame | host | frame | frame | not forwarded | not forwarded | forwarded | apps/platform/src/gateway/context.ts |
OPENBELT_CLASSIFIER | auto | cloudflare | ai | clef | off | auto | auto | not forwarded | forwarded | not forwarded | apps/platform/src/ai/classifier.ts |
OPENBELT_TRIALS | on | off | off | off | not forwarded | not forwarded | not forwarded | apps/platform/src/billing/trials.ts |
OPENBELT_UPLOADS | on | off | off | configured in dev.ts | not forwarded | forwarded | forwarded | apps/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 unset | What setting it enables |
|---|---|---|
OPENBELT_STRIPE_SECRET_KEY (+ _WEBHOOK_SECRET, _PRICE_PRO) | Plan limits off | Stripe billing, checkout, and workspace plan quotas (apps/platform/src/billing/index.ts). |
OPENBELT_PUBLIC_HOST | No public apps | Serves apps marked "public" in openbelt.json to signed-out visitors on <app>--<workspace>.<public host> (requires OPENBELT_SIGNIN=email; Apps). |
OPENBELT_AI_API_KEY | No server fallback key | Operator OpenAI-compatible API key used for signed-in workspace members when no personal AI connection is active (AI). |
OPENBELT_GOOGLE_CLIENT_ID / _SECRET | Email codes only | Continue with Google button on the email sign-in page (Who is viewing). |
OPENBELT_SSO_ISSUER / _CLIENT_ID / _SECRET | No custom SSO | Custom OpenID Connect SSO button on the email sign-in page (Who is viewing). |
OPENBELT_CATALOG_URL | Built-in catalog only | External 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 / _SECRET | Workspaces register own apps | Shared platform OAuth apps for MCP and API connections (GITHUB, GOOGLE, ASANA, LINKEDIN, or feed families; Connections). |
OPENBELT_JOURNAL (+ _KEY, _UPLOAD_URL) | No incident journal | Rolling per-process incident journal and sealed bundle uploads (packages/runtime/src/journal.ts). |
OPENBELT_BACKUP_URL (+ _KEY_ID, _SECRET) | Local disk only | Continuous 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_ANALYTICS | No beacon | Cloudflare Web Analytics beacon on the public landing pages only (Architecture). |
Adding or changing a flag
- Read it with Effect
Configinapps/platform/src/with an explicit, safe default. - Forward it to hosted deploys if operators need it in prod: add it to both
scripts/ops/deploy/index.ts(envFile) anddeploy/compose.server.yaml(environment).scripts/ops/deploy/index.tsrefuses to deploy if a stage.envsets a key thatdeploy/compose.server.yamlwould drop. - Forward it to self-hosted and tailnet installs in
compose.yamlandFORWARDED_ENVinscripts/dev/tailnet/index.ts(~/.config/openbelt/tailnet.env) when self-hosters should control it. - Update
docs/feature-flags.md, runbun run docs:sync, and test both off and on states inscripts/verify/checks/.