Skip to main content

Overview

Self-hosted Mistle deployments are configured with a TOML file plus optional environment overrides. Use config/config.sample.toml as the complete reference for the resource-oriented TOML shape. Set MISTLE_CONFIG_PATH to the TOML file path used by each service. Current resource-oriented MISTLE_* environment variables can override TOML values after the file is loaded.

Deployment Shape

A simple deployment can point the control plane and data plane at the same Postgres, PgBouncer, Valkey, and object storage instances. Larger deployments can split those resources by plane. The config file keeps these shared resources separate from individual service settings:
SectionPurpose
services.*Service hosts, ports, public URLs, internal URLs, and service-owned settings
postgres.*Plane-specific Postgres URLs
kv.*Plane-specific Valkey configuration
object_store.*Shared object stores
workflow.*OpenWorkflow namespaces
email.smtpSMTP delivery settings
internal_authService-to-service authentication
sandbox.*Sandbox provider, base image, publish, and token settings
telemetry.*OpenTelemetry export settings

Services

Service sections define where each service listens and how other services reach it.
SectionRequired settings
services.dashboardpublic_url, control_plane_api_origin
services.control_plane_apihost, port, public_url, internal_url
services.data_plane_apihost, port, internal_url
services.data_plane_gatewayhost, port, internal_url, sandbox WebSocket URLs
services.control_plane_workerworkflow_concurrency, workflow_database_pool_max
services.data_plane_workerworkflow_concurrency, workflow_database_pool_max
Use public URLs for browser-facing and provider-facing traffic. Use internal URLs for service-to-service traffic inside the deployment network.

Postgres

Postgres is configured separately for the control plane and data plane.
FieldUsed for
direct_urlMigrations and other direct database ownership tasks
pooled_urlRuntime application traffic through PgBouncer
Simple deployments can set both planes to the same database. Split deployments can use separate databases for postgres.control_plane and postgres.data_plane.

KV

kv.data_plane describes the data-plane Valkey dependency used by the gateway runtime-state layer. kv.control_plane is available for future control-plane Valkey use, but no service requires it today. Only valkey is supported today:
[kv.data_plane]
backend = "valkey"
url = "redis://valkey:6379"
key_prefix = "mistle:runtime-state"

Object Stores

object_store.assets stores application assets.

Authentication

Control-plane user authentication is configured under services.control_plane_api.auth. enabled_methods controls which login methods are available. otp is required by the current runtime. Add google only when Google OAuth is configured:
[services.control_plane_api.auth]
enabled_methods = ["otp", "google"]
allow_signups = true
Set allow_signups = false to let existing users continue signing in while blocking first-time OTP and Google users from creating accounts. Service-to-service auth is configured under internal_auth. The method field is currently optional and kept for future expansion; the runtime uses shared-token auth while using internal_auth.shared_token.token.

Workflows

Workflow config is split by plane:
[workflow.control_plane]
namespace_id = "production"

[workflow.data_plane]
namespace_id = "production"
Workers consume the namespace and their service-specific concurrency. Managed deployments should run database and workflow migrations as deployment steps instead of relying on long-lived worker startup.

Sandbox

Managed sandbox providers are enabled per provider section. Docker is enabled with sandbox.docker.enabled = true plus its socket settings. E2B is enabled with sandbox.e2b.enabled = true plus its API credentials. A provider is available as a managed provider only when it is enabled and its required provider config is present.

Environment Overrides

TOML should be the primary authored config. Environment variables are override inputs for deployment systems and secret managers.
  • set MISTLE_CONFIG_PATH to the config file path
  • use the resource-oriented MISTLE_POSTGRES_*, MISTLE_KV_*, MISTLE_SERVICES_*, and related MISTLE_* environment namespaces
  • internal-only and test-only overrides, such as MISTLE_INTERNAL_AUTH_* and MISTLE_TEST_SANDBOXD_TEST_FAULTS_ENABLED, are also supported when needed.
Environment overrides win when both TOML and env provide the same runtime setting.

Full TOML Key Reference

This table covers the operator-facing TOML keys accepted by @mistle/config.
KeyRequiredNotes
global.envYesdevelopment or production.
telemetry.enabledYesEnables or disables telemetry export.
telemetry.debugYesEnables debug telemetry behavior.
telemetry.resource_attributesNoOpenTelemetry resource attributes string.
telemetry.traces.endpointYes when telemetry is enabledOptional when telemetry is disabled.
telemetry.logs.endpointYes when telemetry is enabledOptional when telemetry is disabled.
telemetry.metrics.endpointYes when telemetry is enabledOptional when telemetry is disabled.
services.dashboard.public_urlYesPublic dashboard origin.
services.dashboard.control_plane_api_originYesBrowser-facing control-plane API origin used by the dashboard build.
services.dashboard.posthog.enabledNoManaged-cloud only. Self-hosted deployments should leave this commented out.
services.dashboard.posthog.project_api_keyRequired when PostHog is enabledManaged-cloud only. PostHog project API key.
services.dashboard.posthog.hostRequired when PostHog is enabledManaged-cloud only. PostHog ingestion host.
services.control_plane_api.hostYesBind host.
services.control_plane_api.portYesBind port.
services.control_plane_api.public_urlYesPublic control-plane API URL.
services.control_plane_api.internal_urlYesInternal control-plane API URL.
services.control_plane_api.auth.secretYesAuth signing secret.
services.control_plane_api.auth.trusted_originsYesAllowed dashboard/browser origins.
services.control_plane_api.auth.enabled_methodsNoSupported values: otp, google. Google requires credentials. If omitted, only OTP is exposed to users.
services.control_plane_api.auth.allow_signupsNoWhether first-time OTP and Google sign-ins may create users. Defaults to true.
services.control_plane_api.auth.otp.lengthYesOTP code length.
services.control_plane_api.auth.otp.expires_in_secondsYesOTP expiry.
services.control_plane_api.auth.otp.allowed_attemptsYesMaximum OTP attempts.
services.control_plane_api.auth.google.client_idRequired when Google auth is enabledGoogle OAuth client ID.
services.control_plane_api.auth.google.client_secretRequired when Google auth is enabledGoogle OAuth client secret.
services.control_plane_api.integrations.active_master_encryption_key_versionYesActive integration credential key version.
services.control_plane_api.integrations.master_encryption_keys.<version>YesOne or more positive integer string versions.
services.data_plane_api.hostYesBind host.
services.data_plane_api.portYesBind port.
services.data_plane_api.internal_urlYesInternal data-plane API URL.
services.data_plane_gateway.hostYesBind host.
services.data_plane_gateway.portYesBind port.
services.data_plane_gateway.internal_urlYesInternal data-plane gateway URL.
services.data_plane_gateway.sandbox_ws_public_urlYesPublic sandbox WebSocket tunnel URL.
services.data_plane_gateway.sandbox_ws_internal_urlYesInternal sandbox WebSocket tunnel URL.
services.data_plane_gateway.port_access.authorization_timeout_msNoSandbox target authorization timeout in milliseconds. Defaults to 5000.
services.control_plane_worker.workflow_concurrencyYesControl-plane workflow worker concurrency.
services.control_plane_worker.workflow_database_pool_maxYesMaximum direct Postgres connections for the control-plane worker OpenWorkflow pool.
services.data_plane_worker.workflow_concurrencyYesData-plane workflow worker concurrency.
services.data_plane_worker.workflow_database_pool_maxYesMaximum direct Postgres connections for the data-plane worker OpenWorkflow pool.
workflow.control_plane.namespace_idYesControl-plane workflow namespace.
workflow.data_plane.namespace_idYesData-plane workflow namespace.
postgres.control_plane.direct_urlYesDirect control-plane Postgres URL for migrations.
postgres.control_plane.pooled_urlYesPooled control-plane Postgres URL for runtime traffic.
postgres.data_plane.direct_urlYesDirect data-plane Postgres URL for migrations.
postgres.data_plane.pooled_urlYesPooled data-plane Postgres URL for runtime traffic.
kv.control_plane.backendNoOptional control-plane Valkey backend. Currently valkey when set.
kv.control_plane.urlRequired when kv.control_plane is setControl-plane Valkey URL.
kv.control_plane.key_prefixRequired when kv.control_plane is setControl-plane Valkey key prefix.
kv.data_plane.backendYesCurrently valkey.
kv.data_plane.urlYesData-plane Valkey URL.
kv.data_plane.key_prefixYesData-plane Valkey key prefix.
object_store.assets.bucket_nameYesAsset object store bucket.
object_store.assets.regionYesAsset object store region.
object_store.assets.endpointNoCustom object store endpoint.
object_store.assets.force_path_styleNoS3 path-style setting.
object_store.assets.access_key_idYesAsset object store access key.
object_store.assets.secret_access_keyYesAsset object store secret key.
email.smtp.from_addressYesSMTP sender address.
email.smtp.from_nameYesSMTP sender name.
email.smtp.hostYesSMTP host.
email.smtp.portYesSMTP port.
email.smtp.secureYesWhether SMTP uses TLS.
email.smtp.usernameYesSMTP username.
email.smtp.passwordYesSMTP password.
internal_auth.methodNoOptional; currently shared_token when present.
internal_auth.shared_token.tokenYesShared service-to-service token.
billing.stripe.enabledNoManaged-cloud only. Self-hosted deployments should leave this commented out.
billing.stripe.secret_keyRequired when Stripe is enabledManaged-cloud only. Stripe secret key for customer provisioning.
sandbox.default_base_imageYesSandbox base image reference.
sandbox.publish_base_domainYesBase domain for published sandbox URLs.
sandbox.docker.enabledNoEnables managed Docker sandbox provider config when Docker credentials are present.
sandbox.docker.socket_pathRequired when Docker is enabledDocker daemon socket path.
sandbox.docker.network_nameNoDocker network name for sandbox containers.
sandbox.e2b.enabledNoEnables managed E2B sandbox provider config when E2B credentials are present.
sandbox.e2b.api_keyRequired when E2B is enabledE2B API key.
sandbox.e2b.domainNoE2B API domain.
sandbox.tokens.connect.secretYesConnect token signing secret.
sandbox.tokens.connect.issuerYesConnect token issuer.
sandbox.tokens.connect.audienceYesConnect token audience.
sandbox.tokens.bootstrap.secretYesBootstrap token signing secret.
sandbox.tokens.bootstrap.issuerYesBootstrap token issuer.
sandbox.tokens.bootstrap.audienceYesBootstrap token audience.
sandbox.publish.access_token.secretYesPublished sandbox access token signing secret.
sandbox.publish.access_token.issuerYesPublished sandbox access token issuer.
sandbox.publish.access_token.audienceYesPublished sandbox access token audience.
sandbox.publish.session.cookie_signing_secretYesPublished sandbox session cookie signing secret.
sandbox.docker.socket_pathRequired when sandbox provider is dockerDocker socket path.
sandbox.docker.network_nameNoDocker sandbox network name.
sandbox.e2b.api_keyRequired when sandbox provider is e2bE2B API key.
sandbox.e2b.domainNoE2B domain. Defaults to e2b.app when unset.
sandbox.e2b.cpu_countNoE2B sandbox CPU count. Defaults to 2 when unset.
sandbox.e2b.memory_mbNoE2B sandbox memory in MiB. Defaults to 4096 when unset.
sandbox.sandboxd_test_faults_enabledNoInternal test-only flag to inject sandbox service faults.