Operations

Environment variables

Reference the required local and deployment configuration for the workspace, API service, and secure runner.

This page lists the primary environment variables. Cloudflare bindings such as database access, KV, R2, service bindings, and runtime resources remain in each app's Wrangler configuration.

Web

VariablePurpose
VITE_BRAIN_BASE_URLAPI service HTTP origin
VITE_MUSCLE_BASE_URLSecure runner HTTP origin
VITE_MUSCLE_WS_URLSecure runner WebSocket origin

Deploy builds fail when these are missing.

API service

VariablePurpose
GITHUB_CLIENT_IDPublic GitHub OAuth application identifier
GITHUB_CLIENT_SECRETGitHub OAuth secret
GITHUB_REDIRECT_URIGitHub OAuth callback URL
FRONTEND_URLPost-authentication agents URL
PRIVATE_ALPHA_ACCESS_MODEopen locally or allowlist for gated production access
PRIVATE_ALPHA_GITHUB_LOGINSComma-separated approved GitHub logins
PRIVATE_ALPHA_WAITLIST_URLRedirect for unapproved OAuth identities
SESSION_SECRETSession signing material
GITHUB_TOKEN_ENCRYPTION_KEYGitHub token encryption material
BYOK_CREDENTIAL_ENCRYPTION_KEYActive provider credential encryption key
BYOK_CREDENTIAL_ENCRYPTION_KEY_VERSIONActive encryption key version
MUSCLE_BASE_URLLocal secure runner URL
CORS_ALLOWED_ORIGINSExplicit comma-separated browser origins
DATABASE_MIGRATIONS_MODEmanual or auto; defaults to manual

The API service also defines launch rate and concurrency limits. Keep production values in environment-specific Wrangler configuration.

Secure runner

VariablePurpose
CORS_ALLOWED_ORIGINSExplicit browser origins
CORS_ALLOW_DEV_ORIGINSAllow localhost development origins
LAUNCH_RATE_LIMIT_REQUIREDRequire the launch limiter
LAUNCH_EMERGENCY_SHUTOFF_MODEOperational run shutoff mode
INTERNAL_RUNTIME_EVENT_SECRETAuthenticates runtime-event ingestion

Secret handling

Store local secrets in ignored .dev.vars files and production secrets with wrangler secret put. Do not place secrets in vars, committed .env files, logs, screenshots, docs examples, or CI command output.

Encryption-key rotation supports an active key and an explicitly configured previous key. Keep the previous key only for the bounded rotation window required to decrypt existing records.