Skip to content

Latest commit

 

History

History
491 lines (415 loc) · 57.3 KB

ENVIRONMENT.md

File metadata and controls

491 lines (415 loc) · 57.3 KB

Environment Variables

This document lists all environment variables used in the Kilo Code cloud monorepo.

Core / System

  • NODE_ENV - Node environment (development, production, test); used by virtually every package. [SERVER]
  • CI - Set to true in CI environments; detected by Next.js, Playwright, Vitest, and various tooling to alter behavior (non-interactive, skip prompts, etc.). [SERVER]
  • PORT - Port for local dev servers. Next.js defaults to 3000; used by packages/web-shared/src/lib/constants.ts and various test servers. [SERVER]
  • HOME - User home directory; used by child processes spawned by services (OpenClaw resolves ~/.openclaw, Expo devcert for mkcert certs). [SYSTEM]
  • PATH - System executable search path; modified by tooling (OpenClaw, tsx, etc.) to locate CLIs. [SYSTEM]
  • TMUX - Set when running inside a tmux session; used by dev/local/tmux.ts to detect tmux environment. [SYSTEM]
  • GITHUB_ACTIONS - Set to true by GitHub Actions CI; detected by tooling (Rye log groups, Playwright, Vitest) to enable GitHub Actions-specific output/reporting. [SERVER]
  • NEXT_RUNTIME - Set by Next.js to 'node', 'edge', or 'browser'; used in apps/web/src/instrumentation.ts to select appropriate Sentry instrumentation. [SERVER]
  • DOTENV_CONFIG_QUIET - Set by dotenv to suppress load output; set to 'true' in dev/seed/lib/preflight.ts:9 during seeding. [SERVER]

App (apps/web)

Manage shared web env var additions and rotations with pnpm web:env set <VARIABLE>. The helper coordinates tracked root and apps/web dotenv defaults, the kilocode-app and kilocode-global-app Vercel deployments, and 1Password storage for sensitive Production values. See DEVELOPMENT.md for the full workflow.

Configuration & Constant URLs

  • APP_URL_OVERRIDE - Optional base application URL override in any environment; used in packages/web-shared/src/lib/constants.ts and next.config.mjs. When unset, Vercel's staging target uses https://staging-app.kilo.ai, production uses https://app.kilo.ai, and local development uses PORT. [SERVER]
  • KILOCLAW_INSTANCE_URL_TEMPLATE - URL template for KiloClaw instances; used in packages/web-shared/src/lib/config.server.ts. [SERVER]
  • NEXTAUTH_URL - Base URL for NextAuth.js; used across many auth-related files. [SERVER]
  • NEXTAUTH_SECRET - Secret key for NextAuth.js session encryption and five-minute, audience-bound user assertions verified by internal Workers such as user data export. [SECRET]
  • DEBUG_SHOW_DEV_UI - Enables dev-only UI elements (debug panels, admin buttons); checked in packages/web-shared/src/lib/constants.ts and apps/web/src/app/(app)/profile/page.tsx. [SERVER]
  • TRPC_TIMING_LOGGING - Enables tRPC timing logs in development; checked in packages/web-shared/src/lib/trpc/init.ts. [SERVER]
  • TRPC_TIMING_SAMPLE_RATE - Sample rate (0-1) for non-mobile request timing lines; mobile clients are always logged. Defaults to 0.01 when unset or malformed; read in packages/web-shared/src/lib/observability/request-timing.ts. [SERVER]
  • JEST_MAX_WORKERS - Limits max worker threads for Jest; read in apps/web/jest.config.ts. [SERVER]
  • JEST_SILENT - When false, shows verbose Jest output; read in apps/web/jest.config.ts and apps/web/.env.test. [SERVER]
  • JEST_WORKER_ID - Set by Jest to identify the current worker thread; used by db connection pooling and libraries to handle worker-specific state. [SERVER]
  • IS_SCRIPT - Set to 'true' by apps/web/src/scripts/index.ts to indicate a script-mode run (bypasses web server logic). Used by Drizzle in packages/db/src/database-url.ts. [SERVER]
  • SECURITY_AGENT_AUDIT_RELIABLE_COVERAGE_START - Earliest ISO timestamp from which Security Agent Audit Report event coverage is reliable. [SERVER]

Analytics & Monitoring

  • NEXT_PUBLIC_POSTHOG_KEY - PostHog public API key for client-side analytics; used in apps/web/src/components/PostHogProvider.tsx. [PUBLIC]
  • NEXT_PUBLIC_POSTHOG_DEBUG - Enables PostHog debug logging; checked in apps/web/src/components/PostHogProvider.tsx and apps/web/src/lib/stytch.ts. [PUBLIC]
  • POSTHOG_PERSONAL_API_KEY - PostHog personal API key used by user-deletion PostHog cleanup. [SECRET]
  • POSTHOG_ENVIRONMENT_ID - PostHog project/environment ID used by user-deletion PostHog cleanup. [SERVER]
  • POSTHOG_HOST - Optional PostHog API host override for user-deletion cleanup; defaults to https://us.posthog.com. [SERVER]
  • PYLON_API_KEY - Pylon REST API key used by user-deletion contact and reply cleanup. [SECRET]
  • PYLON_HOST - Optional Pylon API host override for local user-deletion cleanup; defaults to https://api.usepylon.com. [SERVER]
  • PYLON_FINAL_EMAIL_AUTHOR_USER_ID - Optional Pylon staff user id used to match an already-posted deletion reply. [SERVER]
  • CUSTOMERIO_TRACK_BASE - Optional Customer.io Track API base override for local user-deletion cleanup; defaults to https://track.customer.io. [SERVER]
  • SUBSTACK_PUBLICATION_URL - Substack publication origin used by user-deletion subscriber cleanup; defaults to https://blog.kilo.ai. Must be blog.kilo.ai or a *.substack.com host. The Substack admin search URL is hardcoded to https://kilocode.substack.com/publish/subscribers, not this publication. [SERVER]
  • CSA_APP_BASE_URL - CSA origin used by the Cloud deletion worker to call POST /api/internal/cloud/users/gdpr-scrub. Example: the production CSA app URL. [SERVER]
  • CSA_VERCEL_PROTECTION_BYPASS - CSA Vercel Deployment Protection automation bypass. Cloud sends it as the x-vercel-protection-bypass header on Cloud → CSA POST /api/internal/cloud/users/gdpr-scrub, never as a query parameter. Required when CSA has Vercel Authentication enabled; without it Vercel returns 401 before the CSA route. Distinct from SUPPORT_API_SECRET. [SECRET]
  • SENTRY_ORG - Sentry organization slug for source map uploads; used in apps/web/next.config.mjs. [SECRET]
  • SENTRY_PROJECT - Sentry project slug for source map uploads; used in apps/web/next.config.mjs. [SECRET]
  • SENTRY_AUTH_TOKEN - Sentry auth token for source map uploads; used in apps/web/next.config.mjs. [SECRET]
  • NEXT_PUBLIC_SENTRY_DSN - Sentry DSN for server and Edge runtime error reporting; used in apps/web/sentry.edge.config.ts and apps/web/sentry.server.config.ts. [PUBLIC]

Marketing Tags

  • NEXT_PUBLIC_GTM_ID - Google Tag Manager container ID; rendered in apps/web/src/app/layout.tsx and exposed via apps/web/src/app/api/marketing-tags/gtm/route.ts. [PUBLIC]
  • NEXT_PUBLIC_IMPACT_UTT_ID - Impact.com UTT (Universal Tracking Token) ID; rendered in apps/web/src/app/layout.tsx and exposed via apps/web/src/app/api/marketing-tags/impact/route.ts. [PUBLIC]

Vercel & Build Info

  • VERCEL_ENV - Vercel environment (development, preview, production); used in apps/web/next.config.mjs, packages/web-shared/src/lib/constants.ts, and apps/web/.env.test. [SERVER]
  • VERCEL_TARGET_ENV - Vercel system or custom deployment environment (development, preview, production, staging, etc.); used in apps/web/src/app/layout.tsx to identify staging UI. [SERVER]
  • VERCEL_URL - Auto-injected by Vercel; current deployment URL. Used in apps/web/src/lib/buildInfo.ts. [SERVER]
  • VERCEL_GIT_COMMIT_SHA - Auto-injected by Vercel; Git commit SHA of the current deployment. Used in apps/web/src/lib/buildInfo.ts. [SERVER]
  • NEXT_PUBLIC_VERCEL_URL - Client-exposed Vercel deployment URL from build info. [PUBLIC]
  • NEXT_PUBLIC_VERCEL_GIT_COMMIT_REF - Client-exposed Git branch/ref from build info. [PUBLIC]
  • NEXT_PUBLIC_VERCEL_GIT_COMMIT_SHA - Client-exposed Git commit SHA from build info. [PUBLIC]
  • NEXT_PUBLIC_VERCEL_GIT_REPO_OWNER - Client-exposed Git repo owner from build info. [PUBLIC]
  • NEXT_PUBLIC_VERCEL_GIT_REPO_SLUG - Client-exposed Git repo slug from build info. [PUBLIC]
  • GITHUB_SHA - GitHub Actions commit SHA; used in apps/web/src/lib/buildInfo.ts during CI builds. [SERVER]

Security & Auth

  • NEXT_PUBLIC_TURNSTILE_SITE_KEY - Cloudflare Turnstile public site key; used in apps/web/src/components/auth/sign-in/TurnstileView.tsx. [PUBLIC]
  • TURNSTILE_SECRET_KEY - Cloudflare Turnstile secret key; used in test files. [SECRET]
  • NEXT_PUBLIC_STYTCH_PROJECT_ENV - Stytch public project environment identifier; used in apps/web/src/components/auth/StytchClient.tsx. [PUBLIC]
  • NEXT_PUBLIC_STYTCH_PUBLIC_TOKEN - Stytch public token for client SDKs; used in apps/web/src/components/auth/StytchClient.tsx. [PUBLIC]
  • STYTCH_PROJECT_ID - Stytch project ID for secret-side SDK calls. [SECRET]
  • STYTCH_PROJECT_SECRET - Stytch project secret. [SECRET]
  • STYTCH_PUBLIC_TOKEN - Stytch legacy public token alias used in some test fixtures. [PUBLIC]
  • INTERNAL_API_SECRET - Shared secret for internal API calls between services; used in apps/web/src/lib/kiloclaw/cli-runs.test.ts, kiloclaw-router.test.ts, dev seed scripts, and other service routers. [SECRET]
  • SUPPORT_API_SECRET - Shared bearer token for Customer Support Automation (CSA) internal API calls. Cloud uses it to authorize CSA → Cloud apps/web/src/app/api/internal/support/ and Cloud → CSA POST /api/internal/cloud/users/gdpr-scrub. A CSA compromise can also call Cloud deletion and Cloud can scrub CSA-local PII. Leak can look up any email and enqueue deletion for non-admin, non-bot, non-live-subscription customers; access disable is deferred to worker preflight and pending requests can be cancelled. Keep production values off preview deployments; rotate Cloud and CSA together. [SECRET]
  • BOUNDED_INTERNAL_SERVICE_TOKENS_ENABLED - Set to exact true to enable modern, purpose-labelled internal assertions at the Phase 5.1 bounded Git broker, export, deletion, and Session Ingest callsites. Unset or any other value retains their existing legacy token formats. Enable only after compatible readers, including the dedicated GitHub disconnect audience, are deployed; generic human/control/runtime signers are not affected. [SERVER]
  • NATIVE_RESOURCE_TOKENS_ENABLED - Set to exact true to permit fresh native adoption of separate one-hour API/gateway access tokens only for clients explicitly requesting api-gateway-v1, provided SHARED_RESOURCE_TOKENS_ENABLED is also exact true. Default-off. Unsupported clients keep legacy responses. Turning this flag off affects subsequent native issuance/refreshes only; active modern device credentials can continue receiving bounded control tokens while their owned device session and current user pepper remain valid. [SERVER]
  • SHARED_RESOURCE_TOKENS_ENABLED - Master default-off readiness gate. Fresh modern producer issuance requires both this flag and its family flag below to be exact true; unset or any other value disables adoption. Native adoption separately requires NATIVE_RESOURCE_TOKENS_ENABLED and this master, independent of producer families; old CLI negotiation is unchanged. These flags do not revoke existing credentials. Valid modern device access credentials retain bounded control issuance after rollback, with current owned-session, pepper, and requested organization membership validation and a one-hour/parent-expiry cap. Chat likewise retains bounded three-audience issuance for validated modern devices; modern credentials never fall back to broad legacy tokens. Persisted modern workload renewal does not use adoption gates. Separately deployed readers/producers must be verified before activation. [SERVER]
  • CLOUD_AGENT_RESOURCE_TOKENS_ENABLED - Default-off family gate for Cloud Agent Next request control and workflow control tokens; requires the master and exact true. [SERVER]
  • GASTOWN_RESOURCE_TOKENS_ENABLED - Default-off family gate for Gastown control tokens; requires the master and exact true. This is not a safe-activation declaration: known ingest-audience and live-token-transport blockers remain deferred. [SERVER]
  • WASTELAND_RESOURCE_TOKENS_ENABLED - Default-off family gate for Wasteland control tokens; requires the master and exact true. [SERVER]
  • CHAT_RESOURCE_TOKENS_ENABLED - Default-off family gate for fresh chat resource issuance; requires the master and exact true. Validated modern devices retain chat/event-service/notifications issuance after rollback, capped by one hour and parent expiry. [SERVER]
  • DELEGATED_RESOURCE_TOKENS_ENABLED - Default-off family gate for explicit API, gateway, attribution, and HTML-deploy delegation, including the organization user-token resource route; requires the master and exact true. Disabled explicit delegation remains unavailable. [SERVER]
  • WORKFLOW_GATEWAY_RESOURCE_TOKENS_ENABLED - Default-off family gate for server workflow gateway tokens; requires the master and exact true. [SERVER]
  • BENCHMARK_RESOURCE_TOKENS_ENABLED - Default-off family gate for benchmark resource tokens; requires the master and exact true. [SERVER]
  • RUNTIME_ISOLATION_ENABLED - Cloud Agent Worker rollout control for new modern control-plane sessions and worktree destinations. Production and dev Worker configs set this to true; exact true permits adoption, while unset/other values reject it before durable work. Legacy attachments keep directory-shared Kilo runtimes. Persisted modern runtime authorization continues selecting per-session isolation after rollback, and the connected wrapper must advertise the isolation capability. Actual web issuance remains off behind its separate issuance gates. Outstanding smoke failures must be resolved before merge; enabling this Worker admission gate does not remove that merge prerequisite. Foreground expiry recovery retains the same session identity and requires acknowledged idle transport retirement; this flag does not establish complete real-provider smoke coverage. See docs/token-issuance-policy.md, Phase 5.2 merge, automatic deployment, and activation. [SERVER]
  • CALLBACK_TOKEN_SECRET - Secret for signing callback tokens. Required for local development. [SECRET]
  • INTERNAL_SECRET - Alias/fallback for INTERNAL_API_SECRET; used in KiloClaw E2E scripts (services/kiloclaw/e2e/). [SECRET]

Social OAuth Clients

  • ANACONDA_CLIENT_ID - Anaconda OAuth app client ID. [PUBLIC]
  • ANACONDA_CLIENT_SECRET - Anaconda OAuth app client secret. [SECRET]
  • OPENAI_CLIENT_ID - OpenAI (Sign in with ChatGPT) OAuth client ID. Read only from the environment; the literal must never appear in source. [SECRET]
  • OPENAI_CLIENT_SECRET - OpenAI (Sign in with ChatGPT) OAuth client secret; server-side only, sent only in the token endpoint's HTTP Basic authorization header. [SECRET]
  • OPENAI_DISCOVERY_URL - Optional override for the OpenAI OpenID Connect discovery document; defaults to the production issuer's document. [SERVER]
  • OPENAI_TOKEN_ENDPOINT - Optional override for the OpenAI token endpoint; defaults to the production issuer's endpoint. [SERVER]
  • OPENAI_CHATGPT_API_URL - Optional override for the base URL that token-sharing requests use with a "Sign in with ChatGPT" connection; defaults to https://api.openai.com/v1. Set it wherever OPENAI_DISCOVERY_URL/OPENAI_TOKEN_ENDPOINT are overridden, so delegated inference stays in the same environment as the token issuer. [SERVER]
  • GITHUB_CLIENT_ID - GitHub OAuth app client ID. [PUBLIC]
  • GITHUB_CLIENT_SECRET - GitHub OAuth app client secret. [SECRET]
  • GITHUB_APP_ID - GitHub App ID; used in integration adapter and tests. [SECRET]
  • GITHUB_APP_PRIVATE_KEY - GitHub App private key (PEM); used in integration adapter and tests. [SECRET]
  • GITHUB_APP_CLIENT_ID - GitHub OAuth Client ID for the app install/login flow; used in apps/web/src/lib/integrations/platforms/github/app-selector.ts. [PUBLIC]
  • GITHUB_LITE_APP_ID - Lighter/secondary GitHub App ID for select integrations. [SECRET]
  • GITHUB_LITE_APP_PRIVATE_KEY - Private key for the lite GitHub App. [SECRET]
  • GITHUB_LITE_APP_CLIENT_ID - OAuth Client ID for the lite GitHub App install/login flow. [PUBLIC]
  • GITHUB_MULTIPLE_INSTALLATION_ORGANIZATION_IDS - Comma-separated Kilo organization UUIDs allowed to connect multiple GitHub App installations. Unset or empty disables multiple installations for all organizations. [SERVER]
  • GITHUB_SHARED_INSTALLATION_ORGANIZATION_IDS - Comma-separated destination Kilo organization UUIDs allowed to create an association to a GitHub App installation already associated elsewhere. Unset or empty disables new shared associations without revoking existing ones. [SERVER]

Organizations already in GITHUB_SHARED_INSTALLATION_ORGANIZATION_IDS can create restricted secondary connections without another feature flag. The original connection retains workflow authority; secondaries support Slack and Cloud Agent only. Removing an organization from the allowlist prevents new admission without revoking active connections or promoting another owner. Do not roll Workers back to role-unaware authorization after admitting secondary connections.

Apply the role migrations and deploy the role-aware writers and consumers close together, including git-token-service before web/Cloud Agent consumers. The migration automatically classifies eligible existing associations. A rare in-flight legacy write after the backfill snapshot can remain unassigned and fail-closed; a later verified reconnect can recover an unambiguous legacy association without changing an existing role. This affects availability only and does not grant secondary access. No manual role repair is part of rollout. The broker authorization RPC must be available before consumers use pinned associations; a missing RPC intentionally fails closed, including for cached capabilities.

The connection-role migration preserves a sole eligible connection, prefers an unambiguous existing workflow binding, and otherwise uses the oldest eligible connection. Deduplication losers and unhealthy unbound legacy rows are excluded. Shared groups with conflicting workflow bindings, unbound eligible rows, or pending-request history without a unique workflow claimant remain unassigned and fail closed. Inspect them with the read-only pnpm --filter web script src/scripts/backfill-github-installations.ts --reportRoles=true --limit=100 report (paginate with --cursor=<last-integration-id>). Review unresolved historical rows separately; timestamps are not proof of historical ownership. Never recalculate roles during normal reconnect or disconnect.

  • GITHUB_CONNECTION_MANAGEMENT_ENABLED - Set to exact true to admit new existing-installation connection management and local disconnect. Unset or any other value keeps new management admission disabled without changing incumbent GitHub integration workflows. [SERVER]
    • Keep disabled for at least one OAuth state TTL (10 minutes) after deploying reservation-aware callbacks so purpose-less states issued by the previous version can complete.
    • During the migration-to-app promotion window, old pending-install callbacks may fail against the replaced pending indexes. Keep the window brief, monitor deploy health, and retry the GitHub connection after promotion completes.
  • GITHUB_ADMIN_STATS_TOKEN - Token for admin GitHub API stats lookups; used in apps/web/src/scripts/backfill-pr-author-github-ids.ts. [SECRET]
  • GITHUB_CLI_PAT - GitHub personal access token for gh CLI operations inside contractors; used in services/gastown/container/src/process-manager.ts. [SECRET]
  • GITHUB_TOKEN - Generic GitHub token for API calls used as fallback when GIT_TOKEN or GITHUB_CLI_PAT is absent; used in services/gastown/container/src/process-manager.ts. [SECRET]
  • GH_TOKEN - Short alias used by GitHub CLI processes. [SECRET]
  • GIT_TOKEN - Dynamic git credential token (often a GitHub App installation token) scoped for git clone/push; propagated from Town DO to containers in services/gastown/src/dos/town/container-dispatch.ts and services/gastown/container/src/agent-runner.ts. [SECRET]
  • GOOGLE_WORKSPACE_OAUTH_CLIENT_ID - Google Workspace OAuth client ID; used in tests and integration code. [PUBLIC]
  • GOOGLE_WORKSPACE_OAUTH_CLIENT_SECRET - Google Workspace OAuth client secret. [SECRET]
  • GOOGLE_WORKSPACE_OAUTH_REDIRECT_URI - Redirect URI for Google Workspace OAuth flow. [SERVER]
  • GOOGLE_CLIENT_ID - Primary Google OAuth client ID. [PUBLIC]
  • GOOGLE_CLIENT_SECRET - Primary Google OAuth client secret. [SECRET]
  • GOOGLE_SERVICE_ACCOUNT_EMAIL - Google service account email. [SECRET]
  • GOOGLE_WEB_RISK_API_KEY - API key for Google Web Risk API. [SECRET]
  • GOOGLE_SHEETS_SPREADSHEET_ID - ID of the Google Sheet used for specific app integrations. [SERVER]
  • GITLAB_CLIENT_ID - GitLab OAuth app client ID. [PUBLIC]
  • GITLAB_CLIENT_SECRET - GitLab OAuth app client secret. [SECRET]
  • BITBUCKET_OAUTH_CREDENTIAL_ACTIVE_KEY_ID - Active platform-credential envelope key ID. The legacy name is shared by Bitbucket and encrypted GitLab credentials. [SERVER]
  • BITBUCKET_OAUTH_CREDENTIAL_ACTIVE_PUBLIC_KEY - Base64-encoded active platform-credential RSA public key; available to web and git-token-service. The legacy name is shared by Bitbucket and GitLab. [SECRET]
  • BITBUCKET_OAUTH_CREDENTIAL_ACTIVE_PRIVATE_KEY - Base64-encoded active platform-credential RSA private key; available only to git-token-service. The legacy name is shared by Bitbucket and GitLab. [SECRET]
  • LINKEDIN_CLIENT_ID - LinkedIn OAuth app client ID. [PUBLIC]
  • LINKEDIN_CLIENT_SECRET - LinkedIn OAuth app client secret. [SECRET]
  • DISCORD_CLIENT_ID - Discord OAuth app client ID. [PUBLIC]
  • DISCORD_CLIENT_SECRET - Discord OAuth app client secret. [SECRET]
  • DISCORD_BOT_TOKEN - Discord bot token. [SECRET]
  • DISCORD_PUBLIC_KEY - Discord app public key (for interactions). [PUBLIC]
  • DISCORD_OAUTH_CLIENT_ID - Discord OAuth client ID for the bot/app. [PUBLIC]
  • DISCORD_OAUTH_CLIENT_SECRET - Discord OAuth client secret for the bot/app. [SECRET]
  • DISCORD_OAUTH_BOT_TOKEN - Discord bot OAuth token (separate from standard bot token). [SECRET]
  • DISCORD_SERVER_ID - ID of the primary Discord guild/server. [SERVER]
  • DOLTHUB_APP_CLIENT_ID - DoltHub OAuth app client ID. [PUBLIC]
  • DOLTHUB_APP_CLIENT_SECRET - DoltHub OAuth app client secret. [SECRET]
  • DOLTHUB_APP_DEV_CLIENT_ID - Dev-only DoltHub OAuth client ID; used in apps/web/.env.test. [PUBLIC]
  • DOLTHUB_APP_DEV_CLIENT_SECRET - Dev-only DoltHub OAuth client secret; used in apps/web/.env.test. [SECRET]
  • DOLTHUB_TOKEN - DoltHub personal access token; used by the wl-sdk package for Dolt operations. [SECRET]

Billing & Stripe

  • STRIPE_SECRET_KEY - Stripe secret API key (sk_*). [SECRET]
  • NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY - Stripe publishable key for client-side 3DS and payment Element initialization. [PUBLIC]
  • STRIPE_TEAMS_SUBSCRIPTION_PRODUCT_ID - Stripe product ID for Teams subscription. [SERVER]
  • STRIPE_ENTERPRISE_SUBSCRIPTION_PRODUCT_ID - Stripe product ID for Enterprise subscription. [SERVER]
  • STRIPE_TEAMS_MONTHLY_PRICE_ID - Stripe price ID for Teams monthly plan (test). [SERVER]
  • STRIPE_TEAMS_ANNUAL_PRICE_ID - Stripe price ID for Teams annual plan (test). [SERVER]
  • STRIPE_ENTERPRISE_MONTHLY_PRICE_ID - Stripe price ID for Enterprise monthly plan (test). [SERVER]
  • STRIPE_ENTERPRISE_ANNUAL_PRICE_ID - Stripe price ID for Enterprise annual plan (test). [SERVER]
  • STRIPE_TOP_UP_PRICE_ID - Stripe price ID for credit top-up purchases. [SERVER]
  • STRIPE_KILO_PASS_TIER_19_MONTHLY_PRICE_ID - Stripe price ID for Kilo Pass $19/mo tier. [SERVER]
  • STRIPE_KILO_PASS_TIER_19_YEARLY_PRICE_ID - Stripe price ID for Kilo Pass $19/yr tier. [SERVER]
  • STRIPE_KILO_PASS_TIER_49_MONTHLY_PRICE_ID - Stripe price ID for Kilo Pass $49/mo tier. [SERVER]
  • STRIPE_KILO_PASS_TIER_49_YEARLY_PRICE_ID - Stripe price ID for Kilo Pass $49/yr tier. [SERVER]
  • STRIPE_KILO_PASS_TIER_199_MONTHLY_PRICE_ID - Stripe price ID for Kilo Pass $199/mo tier. [SERVER]
  • STRIPE_KILO_PASS_TIER_199_YEARLY_PRICE_ID - Stripe price ID for Kilo Pass $199/yr tier. [SERVER]
  • STRIPE_KILOCLAW_2026_03_19_STANDARD_INTRO_PRICE_ID - Legacy KiloClaw Standard intro price ID (pre-rollout). [SERVER]
  • STRIPE_KILOCLAW_2026_03_19_STANDARD_PRICE_ID - Legacy KiloClaw Standard recurring price ID (pre-rollout). [SERVER]
  • STRIPE_KILOCLAW_2026_03_19_COMMIT_PRICE_ID - Legacy KiloClaw Commit price ID (pre-rollout). [SERVER]
  • STRIPE_KILOCLAW_2026_05_10_STANDARD_PRICE_ID - Current KiloClaw Standard recurring price ID. [SERVER]
  • STRIPE_KILOCLAW_2026_05_10_COMMIT_PRICE_ID - Current KiloClaw Commit price ID. [SERVER]
  • STRIPE_KILOCLAW_EARLYBIRD_PRICE_ID - KiloClaw early-bird price ID (test-only). [SERVER]
  • STRIPE_KILOCLAW_EARLYBIRD_COUPON_ID - Coupon ID for KiloClaw early-bird pricing. [SERVER]
  • CHURNKEY_API_SECRET - Secret for Churnkey (cancellation flows). [SECRET]
  • NEXT_PUBLIC_CHURNKEY_APP_ID - Public app ID for Churnkey widget. [PUBLIC]

Apple / In-App Purchases

  • APPLE_APP_APPLE_ID - Apple App ID for IAP verification. [SECRET]
  • APPLE_IAP_ENVIRONMENT - Apple IAP environment (Sandbox or Production). [SERVER]
  • APPLE_IAP_KEY_ID - Apple IAP key identifier. [SECRET]
  • APPLE_IAP_ISSUER_ID - Apple IAP issuer (team) ID. [SECRET]
  • APPLE_IAP_PRIVATE_KEY - Apple IAP private key (PEM/ES256) for receipt validation. [SECRET]
  • APPLE_ROOT_CERTIFICATES_PEM - Apple root CA certs (PEM) for validating IAP receipts. [SERVER]
  • GOOGLE_PLAY_PUBLISHER_SERVICE_ACCOUNT_JSON - Service account JSON for the Android Publisher API (subscriptions v2 get). [SECRET]
  • GOOGLE_PLAY_RTDN_PUSH_AUDIENCE - Expected OIDC audience for Play Real-time Developer Notification Pub/Sub push (the HTTPS URL of POST /api/kilo-pass/play/notifications). [SERVER]
  • GOOGLE_PLAY_RTDN_PUSH_SERVICE_ACCOUNT_EMAIL - Expected service-account email for the Play RTDN Pub/Sub push OIDC token; the token email claim must match it. [SERVER]
  • APPLE_APP_BUNDLE_ID - iOS app bundle ID for Apple App Attest and Sign In verification. [SERVER]
  • NATIVE_ADMISSION_MODE - Native admission enforcement mode: off (default), report, or enforce. [SERVER]
  • NATIVE_ADMISSION_SIMULATOR_BYPASS - When true in non-production, bypasses Play Integrity API verification. [SERVER]
  • GOOGLE_PLAY_INTEGRITY_PROJECT_NUMBER - Google Cloud project number for Play Integrity API. Also read by the mobile build, where it ships in the bundle; it is an identifier, not a secret. [SERVER]
  • GOOGLE_PLAY_INTEGRITY_SERVICE_ACCOUNT_KEY - Service account JSON key for Play Integrity API. [SECRET]
  • GOOGLE_PLAY_INTEGRITY_PACKAGE_NAME - Expected Android package name (e.g., com.kilocode.app), verified against the Play Integrity verdict. [SERVER]
  • GOOGLE_PLAY_INTEGRITY_CERT_DIGESTS - Comma-separated SHA-256 signing certificate digests (hex) accepted for the Android app. [SERVER]

Ablation / Experimentation

  • GLOBAL_KILO_BACKEND - Override to select the global backend region/endpoint; used in next.config.mjs. [SERVER]
  • ANALYZE - Next.js bundle analyzer switch; enables @next/bundle-analyzer in next.config.mjs. [SERVER]

Database

  • POSTGRES_URL - Primary Postgres connection string. [SECRET]
  • POSTGRES_SCRIPT_URL - Alternate Postgres URL used by one-off scripts/backfills in src/scripts/ and tests. [SECRET]
  • POSTGRES_URL_PRODUCTION - Production Postgres connection string override; used by packages/db/src/database-url.ts. [SECRET]
  • POSTGRES_CONNECT_TIMEOUT - Postgres connect timeout in ms (default/typical: 10000). [SERVER]
  • POSTGRES_MAX_QUERY_TIME - Max allowed query time in ms. [SERVER]
  • USE_PRODUCTION_DB - Forces use of the production DB URL in non-production contexts; used by packages/db/src/database-url.ts. [SERVER]
  • DATABASE_CA - CA certificate content (PEM) for TLS connections to Postgres; used by packages/db/src/database-url.ts in tests and scripts. [SERVER]
  • DATABASE_URL - Generic/alternate Postgres URL used by E2E tests and some services (cloud-agent-next, kiloclaw). [SECRET]
  • DATA_EXPORT_POSTGRES_URL - Connection string for the separate, read-only data export database, loaded out of band and read by apps/web/src/lib/data-export/db.ts. Optional: when unset, data export reads are disabled and the application still starts. [SECRET]
  • DATA_EXPORT_DATABASE_CA - Optional CA certificate content (PEM) for the data export database, for when it does not share the primary's CA. Falls back to DATABASE_CA; remote connections require TLS either way. [SERVER]

Redis & Queue

  • REDIS_URL - Redis connection URL; used by packages/web-shared/src/lib/redis.ts and bot state. [SECRET]

Encryption & Secrets

  • BYOK_ENCRYPTION_KEY - Base64 encryption key for Bring-Your-Own-Key encryption of sensitive app data. [SECRET]
  • USER_DELETION_AUDIT_HMAC_KEY - Base64 32-byte HMAC key for user-deletion email hashes and audit subjects. [SECRET]
  • USER_DELETION_ENCRYPTION_KEY - Base64 32-byte AES key for user-deletion effect checkpoints and provider credentials. [SECRET]
  • BYTEPLUS_CODING_PLAN_ACCESS_KEY_ID - Server-only BytePlus access key ID for Coding Plan seat resolution and quota usage APIs. Optional at startup; install with pnpm web:env set BYTEPLUS_CODING_PLAN_ACCESS_KEY_ID. [SECRET]
  • BYTEPLUS_CODING_PLAN_SECRET_ACCESS_KEY - Server-only BytePlus secret access key for Coding Plan seat resolution and quota usage APIs. Optional at startup; install with pnpm web:env set BYTEPLUS_CODING_PLAN_SECRET_ACCESS_KEY. [SECRET]
  • CREDIT_CATEGORIES_ENCRYPTION_KEY - Legacy encryption key for credit category labels/values, retained during key rotation for deployments running older source. [SECRET]
  • CREDIT_CATEGORIES_ENCRYPTION_KEY_V2 - Active encryption key for credit category labels/values. Falls back to CREDIT_CATEGORIES_ENCRYPTION_KEY when unset. [SECRET]
  • AGENT_ENV_VARS_PUBLIC_KEY - RSA public key (base64) used to encrypt agent environment variables. [SERVER]
  • AGENT_ENV_VARS_PRIVATE_KEY - Legacy alias for the above — the actual private key used to decrypt agent env vars (kept server-side). [SECRET]

Internal Services

  • WEBHOOK_AGENT_URL - URL for the webhook agent worker. [SERVER]
  • MODEL_EVAL_INGEST_URL - URL for model evaluation ingest worker. [SERVER]
  • SESSION_INGEST_WORKER_URL - URL for the session ingest worker. [SERVER]
  • NOTIFICATIONS_WORKER_URL - URL for the push-notifications worker internal dispatch endpoint. [SERVER]
  • USER_DATA_EXPORT_WORKER_URL - Internal user data export Worker URL. Production: https://user-data-export.kilosessions.ai; local development is generated by dev:env. [SERVER]
  • NEXT_PUBLIC_SESSION_INGEST_WS_URL - WebSocket URL for session ingest from the browser. [PUBLIC]
  • CODE_REVIEW_WORKER_URL - URL for the code review worker. [SERVER]
  • CODE_REVIEW_WORKER_AUTH_TOKEN - Auth token for the code review worker. [SECRET]
  • AUTO_TRIAGE_URL - URL for the auto-triage worker. [SERVER]
  • AUTO_TRIAGE_AUTH_TOKEN - Auth token for the auto-triage worker. [SECRET]
  • AUTO_FIX_URL - URL for the auto-fix worker. [SERVER]
  • AUTO_FIX_AUTH_TOKEN - Auth token for the auto-fix worker. [SECRET]
  • APP_BUILDER_URL - URL for the App Builder worker. [SERVER]
  • APP_BUILDER_AUTH_TOKEN - Auth token for the App Builder worker. [SECRET]
  • KILOCLAW_API_URL - Base URL for KiloClaw API; used heavily by apps/web/src/routers/kiloclaw-router.ts and tests. [SERVER]
  • USER_DEPLOYMENTS_API_BASE_URL - Base URL for the user deployments builder. [SERVER]
  • USER_DEPLOYMENTS_API_AUTH_KEY - Auth key for the user deployments builder. [SECRET]
  • USER_DEPLOYMENTS_DISPATCHER_URL - URL for the deployments dispatcher (local dev). [SERVER]
  • USER_DEPLOYMENTS_DISPATCHER_AUTH_KEY - Auth key for the deployments dispatcher. [SECRET]
  • USER_DEPLOYMENTS_ENV_VARS_PUBLIC_KEY - Public key for encrypting user deployment env vars. [SERVER]
  • USER_DEPLOYMENTS_ENV_VARS_PRIVATE_KEY - Private key counterpart for decrypting user deployment env vars. [SECRET]
  • CLOUD_AGENT_NEXT_API_URL - URL for the Cloud Agent Next API; used by App Builder chat and other clients. [SERVER]
  • NEXT_PUBLIC_CLOUD_AGENT_NEXT_WS_URL - WebSocket URL for Cloud Agent Next from the browser. [PUBLIC]
  • CLOUD_AGENT_R2_ATTACHMENTS_BUCKET_NAME - R2 bucket for cloud agent file attachments. [SERVER]
  • GASTOWN_SERVICE_URL - URL for the Gastown service. [SERVER]
  • GASTOWN_BILLING_ENABLED - Enables Gastown container usage billing enforcement: admission checks and low-balance stops. Does not control metering — usage is always reported to the meter whenever the CONTAINER_USAGE binding is present. Enabled in the Gastown Wrangler development environment and defaults to false in production. [SERVER]
  • GASTOWN_BILLING_ANNOUNCEMENT_ENABLED - Set to exactly true to show the upcoming usage-based container billing announcement on Gastown town overview pages. Always enabled when Next.js runs in development and defaults to off otherwise. [SERVER]
  • NEXT_PUBLIC_GASTOWN_URL - Client-side base URL for Gastown. [PUBLIC]
  • O11Y_SERVICE_URL - URL for the observability (O11Y) service. [SERVER]
  • O11Y_KILO_GATEWAY_CLIENT_SECRET - Client secret for the O11Y Kilo Gateway. [SECRET]
  • BOUNCER_URL - Bouncer Worker URL. Defaults to https://bouncer.kiloapps.io in production. Inference reports remain report-only and never gate the provider request. [SERVER]
    • Usage and decide requests have 30-second transport budgets. Every inference endpoint reports its API kind.
    • Anonymous usage uses the client IP, without a payer. Signed-in usage excludes shared infrastructure addresses for server-side Kilo features.
    • Usage, decide, and request-initiated charge.attempted events carry the Vercel x-vercel-ja4-digest client fingerprint when the request has a valid one, lowercased and bounded to ^[a-z0-9_]{1,128}$; a missing or invalid header is omitted whole, never truncated. It describes the client TLS/HTTP characteristics of the peer that reached Kilo's edge (often shared proxy infrastructure), not a person or device, and is correlation evidence only — see https://vercel.com/docs/vercel-firewall/firewall-concepts.
    • Financial events enter the durable bouncer_credit_event_outbox before acknowledgment. The dispatcher sends /api/v2/credit-event with a 5-second transport budget.
    • Delivery retries use the same event ID and type. Eight failed attempts produce a visible terminal failure; terminal rows remain for 30 days.
    • Apple originalTransactionId identifies a subscription chain, not an Apple ID. Refund requests and declined requests use distinct event types.
    • Deploy Bouncer v2 before this cloud change. Bouncer retains v1 for the current cloud deployment; the new outbox sends only v2.
  • CRON_SECRET - Shared secret for authenticated cron endpoints; used in dev/discord-gateway-cron.ts and .env.test. [SECRET]
  • dispatch-invite-email-outbox - Vercel cron path (/api/cron/dispatch-invite-email-outbox) that drains the organization invite-email outbox; reuses CRON_SECRET for auth. [SERVER]
  • dispatch-bouncer-credit-event-outbox - Vercel cron path (/api/cron/dispatch-bouncer-credit-event-outbox) that drains the Bouncer credit-event outbox every minute; reuses CRON_SECRET for auth. [SERVER]
  • WORKOS_API_KEY - WorkOS API key for enterprise SSO. [SECRET]
  • WORKOS_CLIENT_ID - WorkOS client ID for enterprise SSO. [PUBLIC]

AI Providers

  • OPENROUTER_API_KEY - Primary OpenRouter API key for model inference through the AI gateway; provider definition in packages/web-shared/src/lib/ai-gateway/providers/definitions/openrouter.ts pointing to https://openrouter.ai/api/v1. [SECRET]
  • OPENAI_API_KEY - OpenAI API key supplied as a managed BYOK credential when managed inference requests route through the Vercel AI Gateway and permit the OpenAI provider. [SECRET]
  • OPENAI_CHATGPT_API_KEY - Partner project key for the delegated "Sign in with ChatGPT" route (packages/web-shared/src/lib/ai-gateway/openai-chatgpt/routing.ts); sent as Authorization: Bearer alongside the user's OpenAI-On-Behalf-Of-Token. OpenAI requires this key to come from the project that owns the OAuth client (oaiapp_Abz1xcqSQAvvIwtxyemZbXBJ); a key from another project makes every delegated call fail with an opaque 400 Bad Request. [SECRET]
  • MISTRAL_API_KEY - Mistral API key; used in apps/web/src/lib/ai-gateway/embeddings/embedding-providers.ts for codestral-embed-2505 and mistral-embed embeddings, in the FIM completions proxy at packages/web-shared/src/lib/ai-gateway/handlers/fim-completions.ts (routes Mistral Codestral vs. La Plateforme keys), and as a provider config in packages/web-shared/src/lib/config.server.ts. [SECRET]
  • INCEPTION_API_KEY - Inception Labs API key; used in packages/web-shared/src/lib/ai-gateway/handlers/fim-completions.ts and packages/web-shared/src/lib/ai-gateway/handlers/edit-completions.ts as a fill-in-the-middle (FIM) provider, with endpoint https://api.inceptionlabs.ai/v1/fim/completions. Defined in packages/web-shared/src/lib/config.server.ts. [SECRET]
  • AI_ATTRIBUTION_ADMIN_SECRET - Admin secret for the AI Attribution service (apps/web/src/lib/ai-attribution-service.ts); sent as X-Admin-Secret header. [SECRET]
  • ARTIFICIAL_ANALYSIS_API_KEY - API key for Artificial Analysis (apps/web/src/lib/model-stats/sync-artificial-analysis.ts); sent as x-api-key header for model benchmarking data sync. [SECRET]
  • ENKRYPT_API_KEY - API key for the Enkrypt scores endpoint; sent only in the server-side apikey header. Required when Enkrypt ingestion is enabled, but optional at application startup. See Enkrypt operations for release gates, monitoring, and independent shutdown controls. [SECRET]
  • FAKE_LLM_URL - Local-only URL for the fake-llm service. Next.js uses it in development to list and route fake-deterministic through the real gateway (apps/web/.env.development.local.example, packages/web-shared/src/lib/ai-gateway/local-fake-llm.ts). The cloud-agent-next E2E driver uses the same var for /test/* side channels (test/e2e/client.ts, test/e2e/fake-llm-server.ts, test/e2e/README.md). Defaults to http://localhost:8811. Ignored on Vercel. [SERVER]

Vector DBs

  • QDRANT_HOST - Qdrant vector DB host. [SERVER]
  • QDRANT_API_KEY - Qdrant API key. [SECRET]
  • MILVUS_ADDRESS - Milvus vector DB address. [SERVER]
  • MILVUS_TOKEN - Milvus auth token. [SECRET]

Email & Notifications

  • MAILGUN_API_KEY - Mailgun API key for transactional email. Used only when VERCEL_TARGET_ENV is production or staging. [SECRET]
  • MAILGUN_DOMAIN - Mailgun sending domain. Used only when VERCEL_TARGET_ENV is production or staging. [SERVER]
  • NEVERBOUNCE_API_KEY - NeverBounce API key for email verification. In staging, only the effective internal sink is verified. [SECRET]
  • STAGING_EMAIL_REDIRECT_TO - Required when VERCEL_TARGET_ENV=staging. Must contain exactly one valid address in the kilocode.ai domain; every staging message is redirected there with a staging subject prefix and safe Reply-To. [SERVER]
  • LOCAL_EMAIL_OPEN_BROWSER - Set to false to stop locally captured emails from opening in a browser tab. Defaults to opening each capture. Local development only. [SERVER]

When VERCEL_TARGET_ENV is absent in local development or a script process, transactional messages are captured as owner-only clickable HTML under dev/logs/emails/ instead of being sent. Automated tests (including IS_IN_AUTOMATED_TEST) and non-production Vercel targets suppress provider delivery and report successful no-op delivery. A production-mode process without VERCEL_TARGET_ENV fails delivery as a configuration error so retryable email markers are not consumed as successful sends.

Slack

  • SLACK_CLIENT_ID - Slack OAuth app client ID. [PUBLIC]
  • SLACK_CLIENT_SECRET - Slack OAuth app client secret. [SECRET]
  • SLACK_SIGNING_SECRET - Slack request signing secret for webhooks. [SECRET]
  • SLACK_ENCRYPTION_KEY - Encrypts the Slack bot token at rest (AES-256-GCM) in the Chat SDK state store. Generate with openssl rand -base64 32; must decode to exactly 32 bytes or apps/web fails at startup. [SECRET]
  • SLACK_CREDENTIAL_KEYSET_JSON - RSA keyset for encrypting Slack bot credentials at rest, as JSON or base64-encoded JSON: {"active":{"keyId":"...","publicKeyPem":"..."},"decrypt":[{"keyId":"...","privateKeyPem":"..."}]}. Web holds the private half because the Slack webhook decrypts in-process; the active key ID must also appear in decrypt with a private key. [SECRET]
  • SLACK_ADMIN_NOTIFICATIONS_WEBHOOK_URL - Slack incoming webhook used by server-side Admin UI code to send events, summaries, reminders, and actions. [SECRET]
  • SLACK_USER_FEEDBACK_WEBHOOK_URL - Slack incoming webhook for user feedback. [SERVER]
  • SLACK_DEPLOY_THREAT_WEBHOOK_URL - Slack incoming webhook for deploy threat alerts. [SERVER]

Feature Flags

  • ENKRYPT_SYNC_ENABLED - Enables daily Enkrypt ingestion and mapped-model catalog enrollment only when exactly true; defaults to disabled. Does not enable publication. Configure the API key and an external monitor for the read-only health endpoint before enabling. [SERVER]
  • ENKRYPT_PUBLICATION_ENABLED - Exposes stored Enkrypt scores through public model catalogs and model-statistics endpoints only when exactly true; defaults to disabled. Does not enable ingestion. Keep disabled until redistribution approval and the release gates in Enkrypt operations are satisfied. Disabling suppresses existing and cached scores after the updated deployment is serving traffic; previously delivered client responses cannot be recalled. [SERVER]
  • KILOCLAW_BILLING_ENFORCEMENT - Feature flag controlling KiloClaw billing enforcement. [SERVER]
  • BRIEFING_DEBUG - Enables verbose debug logging for the KiloClaw morning briefing plugin; checked in services/kiloclaw/plugins/kiloclaw-morning-briefing/src/index.ts. [SERVER]
  • KILOCLAW_DISABLE_AI_COAUTHOR - Disables AI co-author features in Gastown; checked in services/gastown/container/src/control-server.ts. [SERVER]
  • KILOCLAW_GOOGLE_LEGACY_MIGRATION_FAILED - Set when the legacy Google migration flow fails in the KiloClaw controller. [SERVER]
  • KILOCLAW_GOOGLE_LEGACY_MIGRATION_REASON - Human-readable reason for legacy Google migration failure in the KiloClaw controller. [SERVER]
  • IMPACT_ADVOCATE_DEBUG_LOGGING - Enables verbose Impact Advocate debug logs. [SERVER]
  • IMPACT_REFERRAL_DEBUG - Enables verbose Impact referral debug logs. [SERVER]

Impact.com Affiliate/Advocate

  • IMPACT_ACCOUNT_SID - Impact.com account SID for API auth. [SECRET]
  • IMPACT_AUTH_TOKEN - Impact.com API auth token for affiliate/click events. [SECRET]
  • IMPACT_ADVOCATE_ACCOUNT_SID - Impact.com account SID for Advocate (referral) API. [SECRET]
  • IMPACT_ADVOCATE_AUTH_TOKEN - Impact.com Advocate API auth token. [SECRET]
  • IMPACT_ADVOCATE_KILO_PASS_PROGRAM_ID - Impact.com Advocate program ID for the Kilo Pass referral program. [SERVER]
  • IMPACT_ADVOCATE_KILO_PASS_WIDGET_ID - Impact.com Advocate widget ID for the Kilo Pass referral program. [SERVER]
  • IMPACT_ADVOCATE_TENANT_ALIAS - Impact.com Advocate tenant alias. [SERVER]
  • IMPACT_ADVOCATE_API_BASE_URL - Impact.com Advocate API base URL. Defaults to https://app.referralsaasquatch.com. [SERVER]
  • IMPACT_CAMPAIGN_ID - Impact.com campaign ID for event tracking. [SERVER]

Cloudflare Analytics

  • CLOUDFLARE_ACCOUNT_ID - Cloudflare account ID used as the GraphQL accountTag for Containers Analytics queries and admin dashboard deep links; used in packages/web-shared/src/lib/config.server.ts and apps/web/src/lib/cloudflare/container-usage-analytics.ts. [SERVER]
  • CLOUDFLARE_ANALYTICS_API_TOKEN - Cloudflare API token with Account Analytics: Read only, used by the web app to query containersUsageAdaptiveGroups for on-demand admin reconciliation; used in packages/web-shared/src/lib/config.server.ts and apps/web/src/lib/cloudflare/container-usage-analytics.ts. Optional at process start — missing values surface as actionable errors at point of use. [SECRET]

R2 / Object Storage

  • R2_ACCOUNT_ID - Cloudflare R2 account ID for CLI session storage. [SERVER]
  • R2_ACCESS_KEY_ID - R2 access key ID for CLI session storage. [SECRET]
  • R2_SECRET_ACCESS_KEY - R2 secret access key for CLI session storage. [SECRET]
  • R2_CLI_SESSIONS_BUCKET_NAME - R2 bucket name for CLI session blobs. [SERVER]
  • R2_API_REQUEST_LOG_BUCKET_NAME - R2 bucket for api_request_log request and response bodies. [SERVER]
  • R2_API_REQUEST_LOG_ACCESS_KEY_ID - R2 access key ID used only for the api_request_log bucket; uses the R2_ACCOUNT_ID account. [SECRET]
  • R2_API_REQUEST_LOG_SECRET_ACCESS_KEY - R2 secret access key paired with R2_API_REQUEST_LOG_ACCESS_KEY_ID. [SECRET]

Services

Notifications Worker

  • APNS_TEAM_ID - Apple Developer team ID for the token-based APNs key used to send Live Activity pushes. Set in services/notifications/wrangler.jsonc under vars. [SERVER]
  • APNS_KEY_ID - APNs key identifier (kid) for the Live Activity push key. Set beside APNS_TEAM_ID. [SERVER]
  • APNS_PRIVATE_KEY - PKCS#8 ES256 .p8 private key contents for APNs provider-token signing. Stored as one line: the PEM decoder strips every whitespace character, so the newlines are not needed. Store the key in the Secrets Store first, then add its secrets_store_secrets binding; a binding for a missing secret fails the deploy. [SECRET]
  • APNS_TOPIC - iOS app bundle id (com.kilocode.kiloapp); Live Activity pushes use <topic>.push-type.liveactivity. Already set in vars. [SERVER]
  • KILO_WEB_API_BASE_URL - Base origin of the web app, used to reach the internal glanceable-agents-snapshot route; https://app.kilo.ai in production. [SERVER]

Until all four values reach the worker it logs APNs Live Activity credentials missing and skips Live Activity pushes. Every other glanceable delivery, including the Expo aggregate push, keeps working.

The key is team-scoped for all topics and valid in both the sandbox and production APNs environments. A backup of the .p8 lives in the 1Password "Eng / Product" vault as "Apple AuthKey KRYMZL626P (.p8)"; Apple never serves it a second time.

KiloClaw Controller

  • KILOCODE_API_KEY - API key used by the KiloClaw controller for internal gateway identity. [SECRET]
  • FLY_MACHINE_ID - Fly.io machine ID; auto-injected by the Fly runtime, used in services/kiloclaw/controller/src/checkin.ts for machine identity. [SERVER]
  • KILOCLAW_MACHINE_CPU_KIND - CPU architecture label used in KiloClaw gateway health checks/tests. [SERVER]
  • KILOCLAW_RUNTIME_PROVIDER - Runtime provider identifier used in KiloClaw gateway tests (e.g. fly). [SERVER]
  • OPENCLAW_OAUTH_DIR - Directory path for OpenClaw OAuth credentials; managed by OpenClaw runtime. [SERVER]
  • OPENCLAW_STATE_DIR - Directory path for OpenClaw persistent state; managed by OpenClaw runtime. [SERVER]
  • GOG_KEYRING_PASSWORD - Password for the legacy Google keyring migration in KiloClaw controller. [SECRET]
  • KILOCLAW_PROVISION_LOCK_POOL_MAX - Max concurrency for KiloClaw provision locks; used in apps/web/src/lib/kiloclaw/provision-lock.ts. [SERVER]
  • OPENCLAW_GATEWAY_TOKEN - Token for authenticating with the OpenClaw gateway. Used by kiloclaw plugins (kilo-chat, morning-briefing) and OpenClaw internals. [SECRET]
  • KILOCLAW_KILO_CLI - Set by the KiloClaw controller route when the Kilo CLI is invoking a run; gates CLI-specific code paths in services/kiloclaw/controller/src/routes/kilo-cli-run.ts. [SERVER]
  • KILO_API_KEY - API key for the Kilo API; used by CLI run route and customizer plugin tests. [SECRET]

KiloClaw Plugins

  • KILOCLAW_CONTROLLER_URL - Base URL for the KiloClaw controller service; used across plugins (kilo-chat, morning-briefing) and tests. [SERVER]
  • KILOCLAW_SANDBOX_ID - Sandbox identifier for isolated KiloClaw execution environments; used by morning-briefing plugin. [SERVER]
  • KILOCLAW_USER_LOCATION - User location string used by the morning briefing plugin for timezone-aware scheduling. [SERVER]
  • KILOCLAW_USER_TIMEZONE - User timezone string used by the morning briefing plugin. [SERVER]
  • LINEAR_API_KEY - Linear API key for issue integration in the morning briefing plugin. [SECRET]
  • KILOCHAT_BASE_URL - Base URL for the KiloChat service. [SERVER]
  • KILO_API_URL - Kilo API base URL used by the customizer Exa web search plugin. [SERVER]
  • KILOCODE_API_BASE_URL - KiloCode API base URL for the customizer plugin. [SERVER]
  • KILOCODE_ORGANIZATION_ID - Organization ID for KiloCode API calls. [SERVER]
  • OPENCODE_CONFIG_CONTENT - JSON/Toml/YAML string containing OpenCode configuration injected into agent environments at runtime (used as an alternative to KILO_CONFIG_CONTENT). [SERVER]
  • KILO_CONFIG_CONTENT - JSON/Toml/YAML string containing Kilo configuration injected into agent environments at runtime (session config, skills, etc.); read by @kilocode/sdk and Gastown process manager. [SERVER]

Cloud Agent Services

  • CREDENTIAL_CONTAINMENT_ENABLED - Controls GitHub, GitLab, Bitbucket, and Kilo credential containment together for new non-devcontainer Cloud Agent sessions. Enabled unless set to false; local dev defaults to false. Existing sessions retain their persisted containment flags. [SERVER]
  • KILOCODE_TOKEN - Auth token for KiloCode/Session service identity; used by the Cloud Agent Next wrapper and Gastown containers. [SECRET]
  • KILOCODE_TOKEN_FILE - Path to a file containing the KiloCode token (alternative to the env var). [SERVER]
  • KILO_SESSION_INGEST_URL - URL used by the Cloud Agent Next wrapper to ingest session data. [SERVER]
  • KILO_PLATFORM - Target platform identifier used by the Cloud Agent Next wrapper (darwin, linux, etc.). [SERVER]
  • WRAPPER_LOG_PATH - File path for the Cloud Agent Next wrapper's log output. [SERVER]
  • KILO_BIN_PATH - Path or name of the kilo CLI binary; used by services/cloud-agent-next/scripts/update-default-slash-commands.mjs. [SERVER]
  • WORKSPACE_PATH - Filesystem path of the agent workspace. [SERVER]
  • SESSION_ID - Reserved session identifier for the cloud-agent-next runtime; reserved in RESERVED_ENV_VARS. [SERVER]
  • CONTROL_PLANE_IDS - Comma-separated user or org IDs admitted to the call-home control plane at interactive web (cloud-agent-web) session creation. Empty admits nobody. * includes personal accounts. Omitted from production wrangler.jsonc so the Cloudflare dashboard value survives deploy; unset admits nobody. Wrangler dev and .dev.vars.example default to *. Non-interactive origins (Slack, scheduled, code review, and similar) keep legacy agent_ sessions even when enrolled. Does not enable new worktree creation by itself; that also requires WORKTREE_CREATION_ENABLED_IDS enrollment. [SERVER]
  • WORKTREE_CREATION_ENABLED_IDS - Comma-separated user or org IDs allowed to create new worktrees, or * for all, including personal accounts. Omitted from production wrangler.jsonc so the Cloudflare dashboard value survives deploy; unset is off. Wrangler dev and .dev.vars.example default to *. Also requires enrollment in CONTROL_PLANE_IDS. Disabling it does not block existing worktrees or sibling chats in them. [SERVER]
  • SANDBOX_SELECTION_IDS - Comma-separated user or org IDs allowed to pick a Cloud Agent sandbox destination on the new-session page. Empty admits nobody. * includes personal accounts. Omitted from production wrangler.jsonc so the Cloudflare dashboard value survives deploy; unset admits nobody. Wrangler dev and .dev.vars.example default to *. [SERVER]
  • VERCEL_SANDBOX_ORG_IDS - Comma-separated org IDs routed to Vercel sandboxes. Empty is off. * includes personal accounts. [SERVER]
  • HOME - Reserved in RESERVED_ENV_VARS for cloud-agent-next session home management. [SYSTEM]

Gastown

  • GASTOWN_TOWN_ID - Unique identifier for a Gastown town (isolated environment/agent pool). [SERVER]
  • GASTOWN_RIG_ID - Rig (hardware profile) identifier for Gastown scheduling. [SERVER]
  • GASTOWN_AGENT_ID - Unique identifier for an individual Gastown agent instance. [SERVER]
  • GASTOWN_AGENT_ROLE - Role assigned to a Gastown agent (e.g. coder, reviewer). [SERVER]
  • GASTOWN_API_URL - Base URL for the Gastown control API. [SERVER]
  • GASTOWN_CONTAINER_TOKEN - Auth token for Gastown container authentication; refreshed via token-refresh.ts. [SECRET]
  • GASTOWN_SESSION_TOKEN - Per-session auth token for Gastown. [SECRET]
  • GASTOWN_ORGANIZATION_ID - Organization ID associated with the Gastown town. [SERVER]
  • GASTOWN_GIT_AUTHOR_NAME - Git author name used by agents in Gastown for commits. [SERVER]
  • GASTOWN_GIT_AUTHOR_EMAIL - Git author email used by agents in Gastown for commits. [SERVER]
  • AGENT_IDLE_TIMEOUT_MS - Timeout in ms before an idle Gastown agent is terminated; used in services/gastown/container/src/process-manager.ts. [SERVER]
  • REFINERY_IDLE_TIMEOUT_MS - Timeout in ms before an idle Refinery sub-process is killed; used in services/gastown/container/src/process-manager.ts. [SERVER]

Deploy Infra (Dispatcher)

  • LOCAL_AUTH_TOKEN - Auth token for the local deployment dispatcher env. [SECRET]
  • STAGING_AUTH_TOKEN - Auth token for the staging deployment dispatcher env. [SECRET]
  • PROD_AUTH_TOKEN - Auth token for the production deployment dispatcher env. [SECRET]

Other Services

  • DOCKER_SOCKET - Path or URL for the Docker daemon socket; used by services/cloud-agent-next/scripts/docker-privileged-proxy.mjs. [SERVER]
  • DOCKER_PROXY_SOCKET - Path to the Docker privileged proxy socket. [SERVER]
  • SECRET - Generic secret env var used in services/kiloclaw/src/auth/sandbox-id-adversarial.test.ts for sandbox auth tests. [SECRET]

Browser Extension (apps/extension)

  • VITE_POSTHOG_API_KEY - PostHog public project API key baked into extension builds; read in apps/extension/src/shared/analytics.ts; absent → analytics disabled. [PUBLIC]
  • VITE_KILO_API_BASE_URL - Selects the Kilo API base URL at build time; read in apps/extension/src/shared/auth.ts. [PUBLIC]
  • VITE_CLOUD_AGENT_WS_URL - WebSocket URL for Cloud Agent Next streaming from the extension; read in apps/extension/src/shared/cloud-agent-config.ts. Falls back to localhost during wxt serve and the production Cloud Agent endpoint otherwise. [PUBLIC]
  • VITE_SESSION_INGEST_WS_URL - WebSocket URL for session ingest from the extension; read in apps/extension/src/shared/cloud-agent-config.ts. Falls back to localhost during wxt serve and the production session ingest endpoint otherwise. [PUBLIC]

Mobile

  • API_BASE_URL - Base HTTPS URL for the mobile app's API (e.g. https://api.kilo.ai). Bundled into the binary. [PUBLIC]
  • WEB_BASE_URL - Base HTTPS URL for the mobile in-app web views (e.g. https://app.kilo.ai). Bundled into the binary. [PUBLIC]
  • CLOUD_AGENT_WS_URL - WebSocket URL for Cloud Agent Next streaming in the mobile app. Bundled into the binary. [PUBLIC]
  • SESSION_INGEST_WS_URL - WebSocket URL for session ingest from the mobile app. Bundled into the binary. [PUBLIC]
  • APPSFLYER_DEV_KEY - AppsFlyer development key for mobile attribution. Bundled into the binary (not secret — it's a device-level SDK key). [PUBLIC]
  • APPSFLYER_APP_ID - AppsFlyer app ID for mobile attribution tracking. [PUBLIC]
  • KILO_CHAT_URL - Base URL for Kilo Chat in the mobile app. Bundled into the binary. [PUBLIC]
  • EVENT_SERVICE_URL - WebSocket URL for the event service from mobile. Bundled into the binary. [PUBLIC]
  • NOTIFICATIONS_URL - HTTP URL for the push-notifications backend from mobile. [PUBLIC]
  • MOBILE_DEV_HOST - LAN host override for mobile dev (replaces localhost on physical devices); read in dev/local/mobile-env.ts. [SERVER]

Tests / Dev

  • IS_IN_AUTOMATED_TEST - Set to 1 to put the app in automated-test mode (e.g. skip Turnstile challenges). [SERVER]
  • AUTH_TOKEN - Generic auth token used in services/app-builder/src/_integration_tests/git-test-helpers.ts to authenticate integration tests against local services. [SECRET]
  • CANDIDATE_TAG - Tag string used by scripts/test-rollout-bucket.mjs to test rollout bucket assignment. [SERVER]
  • PERCENT - Percentage value (0-100) used by scripts/test-rollout-bucket.mjs when testing rollout bucket logic. [SERVER]
  • SNOWFLAKE_MAX_POLL_ATTEMPTS - Max poll attempts for Snowflake job completion in services/kiloclaw-billing/src/snowflake.ts. [SERVER]
  • CF_AE_TOKEN - Cloudflare Account/Enterprise API token for the local dev CLI (dev/local/cli.ts). [SECRET]
  • KILO_PORT_OFFSET - Port offset for the local dev tmux dashboard; applied by dev/local/cli.ts and dev/local/services.ts to prevent port conflicts. [SERVER]
  • COMPOSE_PROJECT_NAME - Docker Compose project for the local infrastructure; written to dev/.env by dev/local/infra-env.ts so a worktree with a port offset owns its own containers and volumes. [SERVER]
  • KILO_POSTGRES_PORT, KILO_REDIS_PORT, KILO_REDIS_HTTP_PORT, KILO_GRAFANA_PORT - Host ports for the local infrastructure containers; written to dev/.env by dev/local/infra-env.ts, read by dev/docker-compose.yml. Default to 5432, 6379, 8079, and 4000. [SERVER]
  • CLOUDFLARE_HYPERDRIVE_LOCAL_CONNECTION_STRING_HYPERDRIVE - Overrides the localConnectionString each wrangler.jsonc commits, so a worktree's workers reach that worktree's database; set on every worker command by dev/local/services.ts. [SERVER]

E2E

  • DATABASE_URL - Postgres URL for E2E test runs across cloud-agent-next and kiloclaw E2E suites. [SECRET]
  • WORKER_URL - Base URL of the worker under test (Kiloclaw E2E). [SERVER]
  • E2E_GIT_URL - Git server URL for E2E tests (clones repos during runs). [SERVER]
  • E2E_MODEL - Model identifier string for E2E inference tests (e.g. a fake/small model name). [SERVER]
  • KILOCLAW_USER_LOCATION - User location parameter for lifecycle tests of the morning briefing plugin. [SERVER]
  • KILOCLAW_USER_TIMEZONE - User timezone parameter for lifecycle tests of the morning briefing plugin. [SERVER]