Environment variables

Deployment variables and capability bindings, what breaks without them, and which host needs them. Operator configuration may additionally name environment variables explicitly; those names are not source authority.

The minimum that runs

Configure Auth0 and the app URLs, with local file storage unless Mongo is selected. Copy applications/main/.env.example and provision secret values outside source control. Presence-only startup logging is diagnostic, not proof that credentials, endpoints or keyrings are valid.

APP_BASE_URL=http://localhost:3000
NEXT_PUBLIC_APP_BASE_URL=http://localhost:3000
# Supply required AUTH0_* through your local secret configuration.

See Auth0 setup, installation and deployment bindings.

Core and storage

VariablePurpose
APP_BASE_URLServer-generated public process links and application redirects
NEXT_PUBLIC_APP_BASE_URLPublic browser origin used by compiled presentation links
STORAGE_DRIVERExplicit memory, file or mongo; memory is ephemeral, not durable production storage
MONGO_URLMongo connection when selected; without an explicit driver, its presence selects Mongo. Publishing a template version needs a replica set (replicaSet=rs0; see operations/mongo-replica-set.md)
TEMPLATE_PUBLISH_SETTLE_MSRelease step (npm run release): how long to wait for in-flight work on a template's processes to settle, default 60000, at most 150000 (one budget for every wait in the step)
NODE_ENVFramework runtime mode

Auth0

VariablePurpose
AUTH0_DOMAINTenant domain
AUTH0_AUDIENCEAPI identifier the access token is issued for
AUTH0_CLIENT_ID / AUTH0_CLIENT_SECRETApplication credentials
AUTH0_SECRETSession configuration
AUTH0_MGMT_CLIENT_ID / AUTH0_MGMT_CLIENT_SECRETOrganization picker and directory/impersonation resolution
AUTH0_JWKS_URLBackend: override of the token signing-key source, for synthetic test key servers. Honoured only when it is a loopback URL; any other value is ignored and the tenant's https://<AUTH0_DOMAIN>/.well-known/jwks.json is used
PROCESS_LOCAL_IDENTITY_URLBackend: loopback origin of the offline local identity provider (e.g. http://127.0.0.1:4319). Sends authorize, token, key and directory calls there instead of Auth0, and drops the Management API requirement. Refused (startup fails) unless the whole environment is loopback-only with a .invalid AUTH0_DOMAIN; set by npm run qa:local, never by hand. See offline local development
PROCESS_IDENTITY_CACHE_TTL_MSBackend: per-user verified-identity cache lifetime, default 30000; 0 disables. This is the revocation lag for blocked/changed identities
PROCESS_IDENTITY_CACHE_MAX_ENTRIESBackend: identity cache bound, default 1000 (least recently used evicted)
AUTH0_EMAIL_CLAIM / NEXT_PUBLIC_AUTH0_EMAIL_CLAIMOptional custom email claim
HIDDEN_ACTOR_ROLE_NAMESComma-separated role names omitted from actor display; does not remove permission to act

Integrations

The main application maps these names to stable capability aliases. Missing optional credentials leave a capability unavailable at dispatch; they do not change the compiled program. Malformed supplied key/JSON configuration, or absent required persistent keyring material when signing is configured, can fail host initialization.

VariableDefault app binding
SLACK_BOT_TOKENSlack
TELEGRAM_BOT_TOKENTelegram
DUNE_API_KEYDune
GEMINI_API_KEYProcess AI requests and web editor AI assistance
NOTION_API_KEYNotion
GOOGLE_SERVICE_ACCOUNT_JSONSheets service-account JSON; takes precedence over split variables
GOOGLE_SERVICE_ACCOUNT_EMAIL / GOOGLE_SERVICE_ACCOUNT_PRIVATE_KEYAlternative Sheets credentials when JSON is absent; split private key expands literal escaped newlines
SAFE_API_KEYSafe Transaction Service
SAFE_EXECUTOR_PRIVATE_KEYSafe broadcaster/payer signing key
ETH_RPC_URLDefault Safe RPC endpoint

The old requireSafeExecuteEnvOrExit helper no longer exists. Source privateKeyEnv / rpcUrlEnv overrides are compatibility identifiers, not permission to read arbitrary environment variables. Nondefault pairs require a bindings.safeAliases entry in PROCESS_APP_CONFIG, selected with the app's safeBindingKey; that alias must resolve to configured signing and endpoint capabilities.

Default RPC provisioning strips supported Alchemy/Infura path credentials into protected insertion. Other authenticated endpoint shapes require explicit public URL and secret-placement configuration. Public endpoint definitions must not contain raw credentials.

Closed-runtime provisioning

VariablePurpose
PROCESS_APP_CONFIGMain-app trusted JSON path containing authoring bindings and optional generic effects; replaces default provisioning
PROCESS_DOCS_ROOTOptional trusted served-Markdown asset directory; root wrappers default it to applications/main/docs, while a direct main-app command defaults to cwd docs
PROCESS_BACKEND_CONFIGStandalone backend trusted JSON path containing compiled registrations, relative document assets and optional effect provisioning; no config means no shipped app registry
PROCESS_EXTRA_TEMPLATESOptional trusted absolute path to a JSON array of compiled registrations, published at startup alongside the app's or backend's templates (same key replaces). Validated (closed registration + execution digest); receives no extra effect approvals. Used by isolated verification; never an HTTP path
PROCESS_EFFECT_ENCRYPTION_KEYDefault main-app protected-store encryption key: 32 bytes encoded as base64, required when Safe or Sheets signing is configured
PROCESS_EFFECT_DERIVATION_KEYSeparate persistent 32-byte base64 handle-derivation key, required with signing; do not reuse the encryption key

Never accept provisioning paths from an untrusted request. For explicit effects, encryption.keys, derivationKeyEnvironment, credential environment and signing-key environment select operator-owned names; they need not be the defaults above. Provision their values out-of-band and keep keyrings durable and consistent across workers sharing protected storage. Regenerating random keys does not recover existing protected handles. Never place secrets in authoring metadata, logs, committed config or NEXT_PUBLIC_* variables.

Main-app policy: repository templates compiled into the app may use the current deployment's configured capabilities. There is no runtime authoring path (templates:write is retired). That does not create arbitrary destinations or let source metadata manufacture grants. Generic standalone deployments remain operator-explicit and deny capabilities by default. Follow deployment bindings.

Frontend

VariablePurpose
NEXT_PUBLIC_FRONTEND_IDMain-app skin: default, allocation-risk or spell-request; unknown ids fail configuration
PROCESS_BACKEND_ORIGINIndependent Spell frontend's one configured HTTP(S) backend origin; not a user-supplied proxy target
PROCESS_APPLICATION_IDApp frontends (Spell, allocation-risk, generic): the declared applicationId their proxy stamps as the trusted list scope, e.g. workflow:spell-request. Optional; unset lists every member app. Must match the backend access policy or lists return 404

Next.js public variables require static property access to be inlined in browser output. Set them for the intended build; private capability configuration belongs only on authorized server hosts.

Files and CORS

VariablePurpose
PROCESS_FILES_ROOTFile repository root; make durable/shared where the deployment requires it
PROCESS_FILES_DRIVERfs for filesystem or memory for ephemeral fixtures; normal production default is filesystem
MAX_PROCESS_FILE_BYTESUpload size cap
CORS_ALLOWED_ORIGINSExplicit permitted browser origins for direct cross-origin API calls; standalone defaults deny

Storage

STORAGE_DRIVER=memory|file|mongo → explicit override
otherwise MONGO_URL set         → MongoDB
otherwise                       → files in .process-platform/

VITEST selects synthetic defaults in tests, not production. Configuration changes require a restart. Old formats require offline conversion; startup does not reinterpret or migrate records automatically. See storage.

Which deploy needs what

  • Web/API and worker must agree on registration, storage and public capability aliases. Configuring signing also requires the protected keyring during host construction.
  • Workers need the secrets/endpoints for process integration effects and a durable protected store.
  • Main-app Edit with AI runs on the web authoring service, so that host needs its Gemini capability. “All credentials belong only on the worker” is not correct for this path.
  • A separate frontend normally needs its backend origin, browser/session settings and public URLs; standalone backend/worker effects are explicitly provisioned.

Build secrets are not needed to determine the stable compiled program. Do not copy production secrets into fixtures to prove a build. See deployment before activation.

Required deployment access policy

Set exactly one of PROCESS_ACCESS_CONFIG (private JSON file path) or PROCESS_ACCESS_CONFIG_JSON. All web services and workers require the same reviewed owner/application policy. A file is preferable for large membership policies. Missing/invalid policy fails closed; applicationAccess inside backend provisioning is no longer supported. See application access. AUTH0_ONBOARDING_ORGANIZATION_ID is an explicit invitation destination, not a data tenant assignment.