Skip to main content

Configuration reference

All configuration is through environment variables. Copy .env.example to .env and set your values before you start the stack. The local stack runs with no changes; every variable below has a working default or is only needed in cloud mode.

Required means the gateway will not start without it. Cloud-required means it is only required when SP_DEPLOYMENT_MODE=cloud. Variables not listed here are internal and not part of the supported configuration surface.

Core

VariableDefaultWhat it does
SP_DEPLOYMENT_MODElocallocal or cloud. Cloud mode turns on multi-tenant plan enforcement, Clerk sign-in, and the startup hardening checks described in Run in production.
LOG_LEVELinfoLog verbosity for the gateway and worker.
SP_DATA_DIR~/.signalpilotDirectory for the encryption salt, schema annotations, and the local development API key.
SP_GATEWAY_URLhttp://localhost:3300URL of this gateway as browsers and clients reach it. Set it when you reverse-proxy or change the port.
SP_PUBLIC_GATEWAY_URLhttp://gateway:3300Cloud-required. URL that sandboxes use to call the gateway back. The local default is rejected in cloud mode.
SP_PUBLIC_GATEWAY_PORT3300Port that goes with SP_PUBLIC_GATEWAY_URL.
SP_WEB_URLhttp://localhost:3200Public URL of the web app, used for OAuth redirects.
SP_PUBLIC_URLunsetPublic URL of the whole deployment when it differs from SP_GATEWAY_URL.

Database

VariableDefaultWhat it does
DATABASE_URLunsetRequired. Postgres connection URL for the gateway's own state, in the form postgresql+asyncpg://user:pass@host:5432/db. The Compose stack sets it for you.
SP_DB_POOL_MAX_CONNECTIONS5Connection pool size per warehouse connection, from 1 to 20.
SP_DB_POOL_ACQUIRE_TIMEOUT_SECONDS30How long a query waits for a pooled connection before it fails.

Auth and encryption

VariableDefaultWhat it does
SP_ENCRYPTION_KEYgenerated locallyCloud-required. Fernet key or passphrase that encrypts stored warehouse credentials. The Compose file ships a public example value. Replace it before you store real credentials.
SP_ENCRYPTION_SALTunsetSalt used when SP_ENCRYPTION_KEY is a passphrase. Keep it with the key; a different salt derives a different key.
SP_ENCRYPTION_KEY_OLDunsetComma-separated retired keys. They decrypt only. Rows are re-encrypted under the current key as they are read. See key rotation.
SP_SESSION_JWT_SECRETgenerated locallyCloud-required. Signs the session tokens the gateway issues to notebooks and sandboxes. Local mode generates one and keeps it in the signalpilot-gateway-secrets volume.
SP_SESSION_JWT_TTL_SECONDS28800Lifetime of a gateway-issued session token.
SP_JWT_LEEWAY30Allowed clock skew, in seconds, when verifying tokens.
CLERK_PUBLISHABLE_KEYunsetCloud-required. Clerk publishable key. The JWKS endpoint is derived from it.
CLERK_SECRET_KEYunsetCloud-required. Clerk secret key.
CLERK_JWT_AUDIENCEunsetExpected aud claim on Clerk tokens. Leave unset unless your Clerk JWT template emits one.
SP_EXPECTED_AZPunsetComma-separated origins allowed in the azp claim, for example https://app.your-domain.example. Recommended in cloud mode.
SP_ADMIN_USER_IDSlocalCloud-required. Comma-separated user ids that count as platform admins for security administration and eval routes. local is the single-user sentinel for local mode.
SP_ORG_IDlocalOrganization id used in local mode.
SP_BACKEND_URLunsetURL of a separate backend API. When set, every MCP request must carry an sp_ API key.

The gateway no longer reads ciphertext produced by retired pre-PBKDF2 key derivations. If you are upgrading from a very old release, rotate every credential on that release first.

BYOK

VariableDefaultWhat it does
SP_BYOK_PROVIDERlocalEncryption provider for bring-your-own-key plans.
SP_BYOK_PROVIDER_CONFIGunsetJSON configuration for the provider.
SP_BYOK_ALLOW_CUSTOM_ENDPOINTtrue locally, false in cloudAllow a custom key-service endpoint, for testing.

Network and limits

VariableDefaultWhat it does
SP_ALLOWED_ORIGINSunsetCloud-required. Comma-separated CORS origins. In cloud mode every entry must be https:// or a loopback address, and wildcards are refused.
SP_GATEWAY_CSP_POLICYbuilt-in policyOverride the Content-Security-Policy header.
SP_ALLOW_PRIVATE_CONNECTIONSunsetSet to true to allow warehouse connections into private address ranges. Loopback and link-local stay blocked. Meant for self-hosted gateways on the same network as the warehouse.
SP_PER_KEY_RPM1000MCP tool calls per minute per API key.
SP_PER_ORG_RPM5000MCP tool calls per minute per organization, cloud mode.
SP_MAX_EXPORT_ROWS50000Maximum rows in one audit export.
SP_ANNOTATIONS_TTL60Cache lifetime, in seconds, for schema annotation files.
SP_GIT_MAX_PUSH_BYTES524288000Ceiling on a single push from a workspace (500 MiB).

MCP

VariableDefaultWhat it does
SP_MCP_TRANSPORTstdiostdio or streamable-http. The Compose stack uses streamable-http.
SP_MCP_PORT8000Port for the standalone MCP server when the transport is streamable-http.
SP_MCP_ALLOWED_HOSTSunsetComma-separated hostnames accepted in the Host header on /mcp. Empty accepts any host.
SP_MCP_OAUTH_DISABLEDfalseTurn off OAuth sign-in on /mcp, leaving API keys as the only method.
SP_MCP_OAUTH_RESOURCE_URLderivedThe resource identifier advertised to OAuth clients.
SP_MCP_OAUTH_REQUIRE_AUDIENCEtrueRequire OAuth access tokens to name this gateway in their audience.
SP_MCP_OAUTH_PUBLIC_URLSP_GATEWAY_URLPublic URL used in OAuth metadata when it differs from the gateway URL.

Storage

VariableDefaultWhat it does
SP_WORKSPACE_ROOTunsetRoot directory for workspace files.
SP_REPOS_DIR/reposWhere the gateway checks out project repositories.
SP_FILE_BROWSE_ROOTunsetDirectory the file browser is confined to.
SP_WORKSPACE_S3_BUCKETunsetBucket for workspace files.
SP_WORKSPACE_S3_ENDPOINT, SP_WORKSPACE_S3_REGION, SP_WORKSPACE_S3_ACCESS_KEY, SP_WORKSPACE_S3_SECRET_KEYunsetEndpoint, region, and credentials for the workspace bucket. Any S3-compatible service works; the local stack uses MinIO.
SP_CHAT_OBJECTS_BUCKETunsetBucket for chat artifacts.
SP_CHAT_OBJECTS_S3_ENDPOINT, SP_CHAT_OBJECTS_S3_REGION, SP_CHAT_OBJECTS_S3_ACCESS_KEY, SP_CHAT_OBJECTS_S3_SECRET_KEYunsetEndpoint, region, and credentials for the chat artifacts bucket.

Notebooks and sandboxes

VariableDefaultWhat it does
SP_NOTEBOOK_EXECUTION_BACKEND""Which backend runs notebook and chat sessions. Empty picks by environment: direct when SP_NOTEBOOK_DIRECT_URL is set, otherwise the hosted sandbox backend. direct uses one shared notebook container. vercel selects the hosted sandbox backend.
SP_NOTEBOOK_DIRECT_URLunsetURL of the shared notebook container. Local mode only. Any value is refused in cloud mode.
SP_NOTEBOOK_VERCEL_IMAGEunsetImage for hosted sandboxes. Must be a digest reference (@sha256:...) in cloud mode.
SP_NOTEBOOK_TOKEN, SP_NOTEBOOK_TOKEN_FILEgenerated locallyShared token for gateway-to-notebook calls, inline or read from a file.
SP_NOTEBOOK_SESSION_GRANT_SECONDS1800Lifetime of the session grant handed to a sandbox.
SP_NOTEBOOK_IDLE_SNAPSHOT_SECONDS900Idle time before a session is snapshotted and its sandbox destroyed.
SP_NOTEBOOK_SNAPSHOT_EXPIRATION_SECONDS604800How long a snapshot can be resumed from (7 days).
SP_NOTEBOOK_START_TIMEOUT_SECONDS90How long to wait for a sandbox to become ready.
SP_NOTEBOOK_VCPUS2CPUs per sandbox.
SP_NOTEBOOK_MEMORY_MB4096Memory per sandbox.
SP_NOTEBOOK_EGRESS_ALLOWunsetComma-separated hosts a sandbox may reach in addition to DNS and the gateway.
SP_NOTEBOOK_MAX_RUNNING_PER_ORG20Maximum running sandboxes per organization.
SP_SANDBOX_ENABLEDfalseEnable sandboxed DuckDB and SQLite execution over local files through the sandbox manager.
SP_DISABLE_SANDBOXunsetKill switch for sandboxed execution. Refused in cloud mode.
SP_SANDBOX_MANAGER_URLhttp://localhost:8180URL of the sandbox manager service.
SP_SANDBOX_TOKENunsetShared secret between the gateway and the sandbox manager.

Chat and agent

VariableDefaultWhat it does
ANTHROPIC_API_KEYunsetAnthropic API key for chat and agent runs.
CLAUDE_CODE_OAUTH_TOKENunsetAlternative credential for chat and agent runs.
SP_CHAT_AGENT_MODELprovider defaultModel used by the chat agent.
SP_CHAT_DATASET_CONNECTORSpostgres,snowflakeConnector types that expose dataset references in chat.
SP_CHAT_APPROVAL_WARM_SECONDS900How long a sandbox stays warm while a query approval is pending.
SP_AGENT_EFFORTmediumReasoning effort for agent runs.
SP_AGENT_MAX_CONCURRENT_PER_ORG2Concurrent agent runs per organization.
CHAT_WORKER_CONCURRENCY4Runs one worker process handles at once.
CHAT_WORKER_LEASE_SECONDS45Lease a worker holds on a run before another worker may claim it.
CHAT_WORKER_POLL_SECONDS1.0How often a worker polls for new runs.
SIGNALPILOT_DELIVERY_MODELprovider defaultModel used for delivery flows such as Slack and Notion.

Feature flags. Each accepts true or false:

VariableDefaultWhat it does
SP_FEATURE_STANDALONE_CHATunsetEnable the standalone chat page.
SP_FEATURE_MCP_AGENTtrueExpose the agent tools over MCP.
SP_FEATURE_CHAT_QUERY_APPROVALunsetAsk before the agent runs a query.
SP_FEATURE_CHAT_STRUCTURED_RESULTSunsetReturn structured results in chat.
SP_FEATURE_CHAT_SIZE_ROUTERunsetRoute large results through the size router.
SP_FEATURE_CHAT_RUNTIME_RESULTSunsetShow runtime query results in the chat panel.
SP_FEATURE_CHAT_RUNTIME_ARTIFACTSunsetCapture files the agent writes as chat artifacts.
SP_FEATURE_CHAT_DATASET_REFSunsetLet chats reference saved datasets.
SP_FEATURE_CHAT_ORG_SHARINGunsetAllow sharing chats across the organization.
SP_FEATURE_CHAT_FORKINGunsetAllow forking a chat.

Integrations

VariableDefaultWhat it does
SP_GITHUB_APP_IDunsetGitHub App id. Needed to clone private project and eval repositories.
SP_GITHUB_APP_CLIENT_ID, SP_GITHUB_APP_CLIENT_SECRETunsetOAuth credentials for the GitHub install flow.
SP_GITHUB_APP_PRIVATE_KEYunsetApp private key (PEM) used to mint short-lived installation tokens.
SP_GITHUB_APP_SLUGsignalpilotApp slug, used to build install URLs.
SP_GITHUB_BOT_TOKENunsetToken used to comment on pull requests and set statuses when no App is configured.
SP_GITHUB_WEBHOOK_SECRETunsetHMAC secret for /api/github/webhook.
SP_GITHUB_BOT_CONNECTIONunsetDefault connection the pull request verification battery runs against.
NOTION_OAUTH_CLIENT_ID, NOTION_OAUTH_CLIENT_SECRETunsetNotion integration credentials.
NOTION_OAUTH_REDIRECT_URIunsetRedirect URI registered with the Notion integration.
NOTION_WEBHOOK_VERIFICATION_TOKENunsetVerification token for Notion webhooks.
NOTION_DASHBOARD_MAX_BYTESunsetCeiling on a dashboard payload written to Notion.
SLACK_OAUTH_CLIENT_ID, SLACK_OAUTH_CLIENT_SECRETunsetSlack app credentials.
SLACK_OAUTH_REDIRECT_URIunsetRedirect URI registered with the Slack app.
SLACK_OAUTH_SCOPESsee .env.exampleScopes requested at install.
SLACK_SIGNING_SECRETunsetVerifies Slack event signatures.
SLACK_BOT_TOKENunsetBot token for posting.
SLACK_APP_TOKENunsetApp-level token for Socket Mode.
SLACK_DELIVERY_MODEhttphttp for the Events API or socket for Socket Mode.

Evals

The eval harness has its own configuration surface: runner image, execution backend, evidence store, branch provider, quotas, and notifications. See Deploying the harness for the full list.

Settings that are not environment variables

  • Row limit. query_database accepts a row_limit parameter (default 1000, maximum 10000). There is no global override.
  • Budget caps. Registered per session through /api/budget. The check_budget tool reports remaining spend.
  • Audit log. Always on. Every query is logged.
  • PII redaction in audit. Always on. SQL string literals are replaced with <REDACTED>.