This document lists all environment variables used in the Kilo Code cloud monorepo.
NODE_ENV- Node environment (development,production,test); used by virtually every package. [SERVER]CI- Set totruein 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 bypackages/web-shared/src/lib/constants.tsand 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 bydev/local/tmux.tsto detect tmux environment. [SYSTEM]GITHUB_ACTIONS- Set totrueby 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 inapps/web/src/instrumentation.tsandapps/ai-gateway/src/instrumentation.tsto select appropriate Sentry instrumentation. [SERVER]DOTENV_CONFIG_QUIET- Set by dotenv to suppress load output; set to'true'indev/seed/lib/preflight.ts:9during seeding. [SERVER]
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-ai-gateway Vercel deployments, and 1Password storage for sensitive Production values. pnpm web:env copy fills a new project from an existing one. See DEVELOPMENT.md for the full workflow.
ADMIN_STEP_UP_ENABLED- Binary kill switch for session-bound MFA step-up. the literal stringtrueenforces step-up (any other value, includingTRUE, is off) on admin tRPC procedures, specialized admin procedures,adminOnlyREST routes, and the admin layout; unset or any other value disables it and leaves admin behavior unchanged. Admin enrollment freshness and other independent security fixes apply regardless. [SERVER]
CODE_REVIEW_HEALTH_SECRET is a dedicated server-only monitor credential. [SECRET]
The monitor must send Authorization: Bearer <configured value>. An unset or empty
value disables access. Each running instance shares its cached health response
across authorized callers for 60 seconds; simultaneous refreshes share one evaluation.
Apply packages/db/src/migrations/0307_review_window_index.sql before deploying
the application.
For initial deployment or rotation, the owner runs
pnpm web:env set CODE_REVIEW_HEALTH_SECRET, supplies a newly generated secret, and
coordinates the application deployment with the external monitor's header update.
Verify the monitor after the deployment and header update. Only one configured
secret is accepted; deployment and monitor configuration must agree.
Keep credentials out of tracked defaults. For local monitor development, generate
a separate value with openssl rand -base64 32 and set it in the local environment;
ordinary local startup does not require this credential.
CLOUD_AGENT_DISPATCH_HEALTH_SECRET is a dedicated server-only monitor credential for
GET /api/cloud-agent/dispatch-health. [SECRET] The monitor must send
Authorization: Bearer <configured value>. An unset or empty value disables access, and the
endpoint accepts no other credential, including request parameters.
For initial deployment or rotation, the owner runs
pnpm web:env set CLOUD_AGENT_DISPATCH_HEALTH_SECRET, supplies a newly generated secret, and
coordinates the application deployment with the external monitor's header update.
Verify the monitor after the deployment and header update. Only one configured
secret is accepted; deployment and monitor configuration must agree.
Keep credentials out of tracked defaults. For local monitor development, generate
a separate value with openssl rand -base64 32 and set it in the local environment;
ordinary local startup does not require this credential.
MODELS_HEALTH_SECRET is a dedicated server-only credential for GET /api/models/up. [SECRET]
The caller must send Authorization: Bearer <configured value>; an unset or empty value
answers 401 with { "healthy": false }, and the endpoint accepts no other credential,
including request parameters. Every response carries Cache-Control: no-store.
For initial deployment or rotation, the owner runs
pnpm web:env set MODELS_HEALTH_SECRET, supplies a newly generated secret, and coordinates
the application deployment with the external monitor's header update. Order the cutover so no
poll lands on an unroutable credential: set the secret first, then add the Authorization: Bearer header to the external monitor, then deploy the application. Verify the monitor after
the deployment and header update. Only one configured secret is accepted; deployment and
monitor configuration must agree.
Keep the credential out of tracked defaults. For local monitor development, generate a
separate value with openssl rand -base64 32 and set it in the local environment; ordinary
local startup does not require this credential.
UPTIME_PROBE_SECRET is a dedicated server-only credential for GET /api/up. [SECRET]
The caller must send Authorization: Bearer <configured value>; an unset or empty value
answers 401 with { "database": false, "recentAIActivity": false }, and the endpoint
accepts no other credential, including request parameters. Every response, including the
401, carries Cache-Control: no-store. Each running instance shares one evaluation of
the probe across authorized callers for 60 seconds, and simultaneous requests share one
evaluation, so the endpoint performs at most one database read per instance per minute
whatever the caller's request rate.
Order the cutover so no poll lands on an unauthenticated endpoint: first run
pnpm web:env set UPTIME_PROBE_SECRET and supply a newly generated value, then add the
Authorization: Bearer header to the external monitor, then deploy the application. Verify
the monitor after the deployment. Only one configured secret is accepted; deployment and
monitor configuration must agree.
Keep the credential out of tracked defaults. For local probing, generate a separate value
with openssl rand -base64 32 and set it in the local environment; ordinary local startup
does not require this credential.
APP_URL_OVERRIDE- Optional base application URL override in any environment; used inpackages/web-shared/src/lib/constants.tsandnext.config.mjs. When unset, Vercel'sstagingtarget useshttps://staging-app.kilo.ai, production useshttps://app.kilo.ai, and local development usesPORT. [SERVER]AI_GATEWAY_URL- Optional origin of theapps/ai-gatewayapp thatapps/webrewrites its AI gateway routes to; read at build time inapps/web/ai-gateway-rewrites.mjs. When unset, Vercel'sproductiontarget useshttps://ai-gateway.kilo.ai, itsstagingtarget useshttps://staging-ai-gateway.kilo.ai, other Vercel targets fail the build, and outside Vercel it defaults tohttp://localhost:<3010 + KILO_PORT_OFFSET>.apps/webhas no gateway routes of its own.pnpm dev:startsets it to the local ai-gateway app. [SERVER]KILOCLAW_INSTANCE_URL_TEMPLATE- URL template for KiloClaw instances; used inpackages/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]SESSION_SYNC_SECRET- Signs short-lived grants for the native session sync service. Keep it separate from user credentials andNEXTAUTH_SECRET.[SECRET]PAGES_AUTH_SECRET- What the Pages deployment atpages.kiloapps.iopresents when it trades a sign-in code, or a Pages-audience token minted at/api/auth/resource-token, at/api/pages-auth/exchange. The exchange answers with the person's account id, name and organizations, plus their primary email address when a sign-in method verified it. At least 32 characters. While it is unset, thepagesaudience cannot sign anyone in.[SECRET]PAGES_DEV_AUTH_SECRET- The same forpages-dev.kiloapps.io, for both the code and the token trade. Keep it different fromPAGES_AUTH_SECRET.[SECRET]DEBUG_SHOW_DEV_UI- Enables dev-only UI elements (debug panels, admin buttons); checked inpackages/web-shared/src/lib/constants.tsandapps/web/src/app/(app)/profile/page.tsx. [SERVER]TRPC_TIMING_LOGGING- Enables tRPC timing logs in development; checked inpackages/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 to0.01when unset or malformed; read inpackages/web-shared/src/lib/observability/request-timing.ts. [SERVER]USAGE_RECORD_COMPLETION_SAMPLE_RATE- Production success sample rate (0-1) for shared gateway/HTTP writerusage_record_completionlogs; defaults to1(100%) when unset, blank, malformed or out of range.0disables recorded/duplicate completion logs;1logs every success. Not-recorded/errors and nonproduction completions always log. Set consistently on gateway and HTTP writer apps and redeploy to change it; read inpackages/web-shared/src/lib/ai-gateway/usage-record-diagnostics.ts. [SERVER]JEST_MAX_WORKERS- Limits max worker threads for Jest; read inapps/web/jest.config.ts. [SERVER]JEST_SILENT- Whenfalse, shows verbose Jest output; read inapps/web/jest.config.tsandapps/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'byapps/web/src/scripts/index.tsto indicate a script-mode run (bypasses web server logic). Used by Drizzle inpackages/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]
NEXT_PUBLIC_POSTHOG_KEY- PostHog public project key for client analytics and server feature evaluation. Configure the same project for the web app and AI gateway. The web app has a tracked public default inapps/web/.env; verify runtime configuration in both deployments before rollout. [PUBLIC]NEXT_PUBLIC_POSTHOG_DEBUG- Enables PostHog debug logging; checked inapps/web/src/components/PostHogProvider.tsxandapps/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 tohttps://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 tohttps://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 tohttps://track.customer.io. [SERVER]SUBSTACK_PUBLICATION_URL- Substack publication origin used by user-deletion subscriber cleanup; defaults tohttps://blog.kilo.ai. Must beblog.kilo.aior a*.substack.comhost. The Substack admin search URL is hardcoded tohttps://kilocode.substack.com/publish/subscribers, not this publication. [SERVER]SENTRY_ORG- Sentry organization slug for source map uploads; used inapps/web/next.config.mjsandapps/ai-gateway/next.config.mjs.[SECRET]SENTRY_PROJECT- Sentry project slug for source map uploads; used inapps/web/next.config.mjsandapps/ai-gateway/next.config.mjs.[SECRET]SENTRY_AUTH_TOKEN- Sentry auth token for source map uploads; used inapps/web/next.config.mjs,apps/ai-gateway/next.config.mjs, and Cloud Agent deployment CI. Cloud Agent uploads targetkilo-code/kilo-cloud-agent; the token must never enter sandbox environments or image build arguments.[SECRET]NEXT_PUBLIC_SENTRY_DSN- Sentry DSN for server and Edge runtime error reporting; used inapps/web/sentry.edge.config.tsandpackages/web-shared/src/lib/observability/sentry-server.ts.[PUBLIC]
NEXT_PUBLIC_GTM_ID- Google Tag Manager container ID; rendered inapps/web/src/app/layout.tsxand exposed viaapps/web/src/app/api/marketing-tags/gtm/route.ts. [PUBLIC]NEXT_PUBLIC_IMPACT_UTT_ID- Impact.com UTT (Universal Tracking Token) ID; rendered inapps/web/src/app/layout.tsxand exposed viaapps/web/src/app/api/marketing-tags/impact/route.ts. [PUBLIC]
VERCEL_ENV- Vercel environment (development,preview,production); used inapps/web/next.config.mjs,packages/web-shared/src/lib/constants.ts, andapps/web/.env.test. [SERVER]VERCEL_TARGET_ENV- Vercel system or custom deployment environment (development,preview,production,staging, etc.); used inapps/web/src/app/layout.tsxto identify staging UI and inapps/web/ai-gateway-rewrites.mjsto pick the AI gateway origin. [SERVER]VERCEL_URL- Auto-injected by Vercel; current deployment URL. Used inapps/web/src/lib/buildInfo.ts. [SERVER]VERCEL_GIT_COMMIT_SHA- Auto-injected by Vercel; Git commit SHA of the current deployment. Used inapps/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 inapps/web/src/lib/buildInfo.tsduring CI builds. [SERVER]
NEXT_PUBLIC_TURNSTILE_SITE_KEY- Cloudflare Turnstile public site key; used inapps/web/src/components/auth/sign-in/TurnstileView.tsx. [PUBLIC]TURNSTILE_SECRET_KEY- Cloudflare Turnstile secret key; used in test files.[SECRET]EMAIL_SIGNUPS_ENABLED- Set to exacttrueto allow new accounts via email (web magic link and mobile email code). Unset or any other value refuses them. Existing users keep email sign-in either way, and OAuth, passkey, and SSO sign-ups are unaffected. Jest's global setup (apps/web/src/tests/setup/globalSetup.ts) defaults it totrue; keep it out of tracked dotenv files sopnpm web:env setcan set it. Takes effect on redeploy. [SERVER]NEXT_PUBLIC_STYTCH_PROJECT_ENV- Stytch public project environment identifier; used inapps/web/src/components/auth/StytchClient.tsx. [PUBLIC]NEXT_PUBLIC_STYTCH_PUBLIC_TOKEN- Stytch public token for client SDKs; used inapps/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 inapps/web/src/lib/kiloclaw/cli-runs.test.ts,kiloclaw-router.test.ts, dev seed scripts, and other service routers.[SECRET]BOT_TOKEN_MINT_SECRET- Dedicated bearer secret forPOST /api/internal/bot-token, which mints one-hour tokens forbot-internal-*users. It authenticates only the mint and is never a Kilo credential; unset or empty disables the endpoint. Separate fromINTERNAL_API_SECRET.[SECRET]SUPPORT_ACCESS_ENABLED- Enables enforced explicit support-organization access. Only the exact stringtrueenables it; unset, empty,false, or any other value is OFF. OFF keeps today's platform-adminownershortcut; ON requires an active scoped grant for admins who are not members of the organization. Set it for thekilocode-appproject withpnpm web:env set SUPPORT_ACCESS_ENABLED; the value takes effect on redeploy. [SERVER]
Usage-accounting transport is selected from deployment labels alone: staging with VERCEL_TARGET_ENV=staging and VERCEL_ENV not production, or production with both VERCEL_ENV and VERCEL_TARGET_ENV exactly production. There is no per-region, per-payer or exposure switch, and no historical queue rollout variable is read. Eligibility is therefore not a runtime setting: stopping new production queue selection requires reverting this source change and redeploying the gateway, while already accepted work continues draining. Every production function region that runs the gateway queues; deployments whose labels match neither branch keep direct accounting. Selected events await one finalized event publication within the accounting lifetime. HTTP 202 skips the direct usage write and returns a queued identity, not a committed row; spend-watched Bouncer events are delivered by the writer after its outbox commits, with cron retry on failure. Missing or unparseable publisher configuration publishes nothing, so each selected event is written through the direct accounting path (including the SFO primary-region handoff), logs publisher_not_configured with its usage ID, and raises at most one Sentry error per instance per minute. A lifetime registration failure (no request scope or waitUntil) also publishes nothing and uses the same direct fallback. Any other unavailable publication or unexpected rejection logs the finalized usage ID and a failure category and returns a null accounting result without a direct write, because the queue may already hold the event. Apart from those two fallbacks, no gateway billing writer is called on acceptance or failure. Failed accounting retains best-effort Bouncer reporting, which does not persist billing. Events not accepted by the queue have no durable recovery in this path and may be lost; a timeout may also hide an accepted event that the consumer later records. Cloudflare HTTP publication opts into up to four attempts for transient failures, with up to twenty seconds for the first confirmation and five seconds for each later one, within a 40-second overall elapsed budget. Retry waits use exponential full jitter from zero up to (excluding) 500 ms, 1,000 ms, then 2,000 ms; sleeps and attempt timeouts are clipped to remaining budget, with no new attempt after exhaustion. Runtime scheduling can delay deadline observation. Non-retry calls remain one two-second attempt. Publication occurs only for selected queue-only accounting. The obsolete background shadow publisher has been removed; historical shadow events already accepted by the queue must still be reconciled and drained before enabling a processing consumer. This code does not remove queued messages. Ambiguous retries may enqueue duplicates with the same usage ID; the writer deduplicates billing. Publisher logs carry duplicate_possible: true once any attempt timed out, lost its response or received a 5xx. Requires an independently verified processing consumer and authenticated writer; selection does not establish readiness or a durable production publication guarantee. [SERVER]
USAGE_INGEST_URL- Optional complete usage-ingest HTTP endpoint (for example, ending in/usage) for the gateway usage publisher helper. No default; a missing URL or secret, or a URL that is not an absolutehttpsURL (plainhttpis accepted only for a loopback host, as in local fixtures; scheme-less values such aslocalhost:3000/usageare rejected), makes the helper reportpublisher_not_configuredwithout a network call. Accepts only HTTP 202. Selected queue-only Cloudflare HTTP publication makes at most four attempts on timeout, transport failure, HTTP 408/429 or 5xx, reusing the same serialized event and ID. Missing/malformed configuration and other HTTP outcomes are not retried. Redirects are terminal 3xx outcomes and are never followed. The first confirmation allows up to twenty seconds and later ones up to five seconds, with full-jitter retry caps of 500/1,000/2,000 ms within a 40-second elapsed budget. Four full attempts plus the maximum waits take under 38.5 seconds, so the budget only shortens or skips a later attempt when runtime scheduling delays the loop. Timeouts and waits are clipped to remaining budget; runtime scheduling can delay deadline observation. Non-retry HTTP calls retain one two-second attempt. This budget excludes subsequent Bouncer reporting. Exhaustion returns failure without direct billing. For isolated local tests, usehttp://127.0.0.1:<fixture-port>/usagewith the real usage-ingest Worker and a local queue. Configuring it alone does not activate gateway publication. [SERVER]USAGE_QUEUE_TRANSPORT- Removed. The staging Vercel Queues prototype is retired: new gateway builds have no Vercel publisher, queue callback orqueue/v2betatrigger, and the gateway no longer reads this variable. A leftover staging value, includingvercel, is ignored, so eligible staging accounting publishes through Cloudflare. Already deployed staging builds that still contain the prototype keep their own consumer and the writer'squeue_vercelcaller label; whether their queue still holds messages is not verified by source. Leave the hosted variable, queue and writer credentials in place until an operator confirms those deployments no longer have work to drain. A developer checkout that ran a staging gateway build before the retirement may still hold the untracked generated callbackapps/ai-gateway/src/app/api/v1/internal/queues/usage/route.ts, which imports the deleted@kilocode/usage-queue/vercel/callbackand breaks the next gateway build. Check that file once: delete it only if it is that generated callback, then rebuild. Do not delete any other route, and do not use wildcards. [SERVER]USAGE_WRITER_URL- Complete LLM usage-writer endpoint (/api/internal/usage/record) used by the Cloudflareusage-ingestconsumer in production and staging, and by older stagingkilocode-ai-gatewaydeployments that still contain the retired Vercel Queues consumer. Configure it in each consuming runtime to target the corresponding Frankfurt-onlykilocode-appwriter. The Cloudflare consumer derives the sibling Exa and Enkrypt writer endpoints by replacing that path suffix. No default. [SERVER]USAGE_WRITER_SECRET- Writer authentication secret used by the Cloudflareusage-ingestconsumer in production and staging and by older stagingkilocode-ai-gatewaydeployments that still contain the retired Vercel Queues consumer; must match the targetkilocode-appwriter'sINTERNAL_API_SECRET. That retired publisher and consumer also used it with a queue-specific HMAC purpose to authenticate the complete usage envelope before writer I/O. No additional signing credential is required.[SECRET]USAGE_WRITER_PROTECTION_BYPASS- Optional target-writer deployment-protection automation bypass, read by the Cloudflareusage-ingestconsumer in production and staging and by older stagingkilocode-ai-gatewaydeployments that still contain the retired Vercel Queues consumer. When configured, sent asx-vercel-protection-bypass; needed only when the target writer deployment is protected.[SECRET]SCIM_PROTECTION_BYPASS- Optional Vercel automation bypass for thescim-syncWorker, sent asx-vercel-protection-bypass. Needed only under--env staging, becausestaging-app.kilo.aihas Deployment Protection enabled and its edge answers before Next.js runs;app.kilo.aiis unprotected and binds none. A plain Worker secret (wrangler secret put), not a Secrets Store binding, so production can omit it without failing the deploy. Generated by Vercel under the project's Protection Bypass for Automation.[SECRET]USAGE_INGEST_PUBLISH_SECRET- Optional dedicated Bearer secret for the gateway usage publisher helper; must match the usage-ingest Worker's setting of the same name. Separate fromINTERNAL_API_SECRETand user credentials. Use only a synthetic matching value in local fixtures.[SECRET]ENKRYPT_USAGE_QUEUE_ENABLED- Removed. Enkrypt guardrail usage now always goes through the usage queue in every region, like queued LLM accounting; there is no rollout selector to turn it off at runtime. Every Enkrypt usage write is published once, in every region, as the bare Enkrypt usage record to the/enkrypt-usagepath that replaces the documented/usagepath ofUSAGE_INGEST_URL. It is authenticated withUSAGE_INGEST_PUBLISH_SECRETand uses the same retries and budget as queued LLM accounting. HTTP 202 writes nothing directly. A missing secret, aUSAGE_INGEST_URLof any other shape, or a missing request lifetime publishes nothing, and the write takes today's direct path (SFO handoff, then a local write; a local write in Frankfurt). Any failure after a send attempt logs[enkrypt-guardrail] usage queue publication failed; record droppedwith the usage ID and reason, with no direct write, because the queue may already hold it. To stop new production queue selection, revert this source change and redeploy the gateway; already accepted work continues draining. Do not remove theUSAGE_INGEST_URL/USAGE_INGEST_PUBLISH_SECRETvariables or the Worker-side publisher secret while old code that still reads this selector could be running, and reinstate the selector only if rolling back to source that still reads it. [SERVER]EXA_USAGE_QUEUE_FALLBACK_ENABLED- Removed. The usage queue is now always the durable fallback for Exa usage whereverUSAGE_INGEST_URLandUSAGE_INGEST_PUBLISH_SECRETform a valid publisher configuration; there is no rollout selector, so deploying this source enables the fallback in every such environment, including ones where the old selector was off. It matters only on thekilocode-appVercel project (Frankfurt only), which serves/api/exa;kilocode-ai-gatewaydoes not run that route. The direct Exa usage write stays first, and a successful direct write never publishes. The write is bounded against the invocation deadline, with a 45-second publication reserve taken only when the publisher configuration is valid; the writer receives the remaining budget as transaction-local lock, statement and idle-in-transaction timeouts. The route publishes the same record, with the sameidandoccurredAt, once inside the existingafter()work after that direct write fails (stagerecord_write) or is skipped because the remaining budget cannot fit it (stagewrite_skipped); a cost-parse failure (stagecost_parse) publishes nothing. The route publishes to the/exa-usagepath that replaces the documented/usagepath ofUSAGE_INGEST_URL. It is authenticated withUSAGE_INGEST_PUBLISH_SECRETand uses the same transient retries and budget as Enkrypt publication. The Exa writer deduplicates byidandoccurredAt, so a direct write that had in fact committed is answeredduplicatewith no second debit. The direct write is never repeated after a publish attempt. So the Bearer secret never travels in clear text,USAGE_INGEST_URLmust behttps, except plainhttpto a loopback host for local fixtures. A missing secret, a plain-httpnon-loopback URL or aUSAGE_INGEST_URLof any other shape publishes nothing and makes no request. HTTP 400 is terminal. The outcome is a boundedfallbackfield on the existing[exa] usage record failed; charge may be unrecordedline:not_configured,queued,rejected(HTTP 400) orpublish_failed, with a categoricalfallback_reasonand, for an unexpected rejection, only the error's name. To stop new Exa queue publication, either removekilocode-app's publisher configuration and redeploy, or revert this source change and redeploy withEXA_USAGE_QUEUE_FALLBACK_ENABLEDabsent or set to anything other thantrue, because the reverted source publishes whenever that value istrue; already accepted work continues draining. [SERVER]BOUNDED_INTERNAL_SERVICE_TOKENS_ENABLED- Set to exacttrueto 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 exacttrueto permit fresh native adoption of separate one-hour API/gateway access tokens only for clients explicitly requestingapi-gateway-v1, providedSHARED_RESOURCE_TOKENS_ENABLEDis also exacttrue. 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 exacttrue; unset or any other value disables adoption. Native adoption separately requiresNATIVE_RESOURCE_TOKENS_ENABLEDand 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 exacttrue. [SERVER]CHAT_RESOURCE_TOKENS_ENABLED- Default-off family gate for fresh chat resource issuance; requires the master and exacttrue. 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, and attribution delegation, including the organization user-token resource route, and for the five-minute Pages-audience (pages,pages-dev) tokens fromPOST /api/auth/resource-token, which organization credentials cannot mint; requires the master and exacttrue. Disabled explicit delegation remains unavailable. [SERVER]WORKFLOW_GATEWAY_RESOURCE_TOKENS_ENABLED- Default-off family gate for server workflow gateway tokens; requires the master and exacttrue. [SERVER]ORG_PERMISSION_POLICY_WRITES_ENABLED- Default-off web deployment gate for Enterprise organization permission policy writes. Set to exacttrueonly after the web app and both Gateway regions have compatible group-policy readers, older operator-config writers are no longer serving, and web deployments that can write the retired client policy have been drained. Drain older web deployments that can return the retired policy before serving consumers that require the agent-permissions-only response. The organization must also be enabled fororg_permission_policy. After enabling writes, retain compatible readers even if either gate is disabled. [SERVER]INTERNAL_BOT_RESOURCE_TOKENS_ENABLED- Default-off family gate for internal bot tokens fromPOST /api/internal/bot-token; requires the master and exacttrue. [SERVER]CALLBACK_TOKEN_SECRET- Secret for signing callback tokens. Required for local development.[SECRET]INTERNAL_SECRET- Alias/fallback forINTERNAL_API_SECRET; used in KiloClaw E2E scripts (services/kiloclaw/e2e/).[SECRET]- Native (mobile) sign-in rate limits are Vercel Firewall rules configured in the project's firewall configuration, not environment variables.
native-token-addresscounts token exchanges per caller address before the admission gate;native-token-usercounts them per account after it. Both belong in that configuration, andapps/web/src/lib/auth/native-token-rate-limit.tschecks them through the shared firewall helper, which reports a rule that is not configured or an answer the firewall blocked at most once a minute. The address rule must answer: when it is absent, the exchange is refused before any provider call. - Sign-in code email rate limits are Vercel Firewall rules configured in the project's firewall configuration, not environment variables.
magic-link-emailcounts sends per normalized address;sign-in-code-email-ipcounts sends per caller address.apps/web/src/lib/auth/email-signin-eligibility.tssends a magic link or sign-in code only when both rules answer that the caller may proceed; an unconfigured or unevaluable rule refuses the send and is reported to Sentry at most once a minute, so both rules are required configuration. - Native admission rate limiting is a Vercel Firewall rule configured in the project's firewall configuration, not an environment variable.
native-admission-challengecounts challenge issuance per caller address atPOST /api/auth/native/admission-challenge; it belongs in that configuration, becauseapps/web/src/lib/auth/native-admission.tschecks it through the shared helper and refuses the request when the rule is unconfigured or cannot be evaluated, reporting that answer to Sentry at most once a minute.
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 tohttps://api.openai.com/v1. Set it whereverOPENAI_DISCOVERY_URL/OPENAI_TOKEN_ENDPOINTare overridden, so delegated inference stays in the same environment as the token issuer. [SERVER]CLAUDE_SIGN_IN_CLIENT_ID- Client ID of the "Sign in with Claude" OAuth app in the Claude Console. Register<APP_URL>/api/auth/callback/claudeas its redirect URI. The Claude provider is registered only when this value is set. Sign-in and account-link controls follow the configured provider list; email discovery excludes Claude when this value is absent. [SERVER]CLAUDE_SIGN_IN_ASSERTION_AUDIENCE- The audience that the sign-in app's Client authentication tab shows; theaudof its client assertions. [SERVER]CLAUDE_FEDERATION_ISSUER- The issuer URL of Kilo's federation issuer registered with Anthropic (inline JWKS); theissof every Kilo-signed Claude JWT. [SERVER]CLAUDE_FEDERATION_SUBJECT- Thesubof every Kilo-signed Claude JWT; must match the subject pattern of the OAuth apps and the federation rule. [SERVER]CLAUDE_FEDERATION_KEY_ID- Thekidof the federation signing key, as registered in the inline JWKS. [SERVER]CLAUDE_FEDERATION_PRIVATE_KEY- PKCS#8 PEM of Kilo's P-256 federation signing key;\nescapes are accepted. Anthropic holds only the public key.[SECRET]CLAUDE_OIDC_ISSUER- Optional override for the Claude ID-token issuer and discovery base; defaults tohttps://identity.anthropic.com/users. Set it only for the local stub (pnpm dev:mock-anthropic). [SERVER]CLAUDE_AUTH_BASE_URL- Optional override for the Claude authorization server; defaults tohttps://auth.claude.com. Set it only for the local stub. [SERVER]CLAUDE_API_BASE_URL- Optional override for the Claude API; defaults tohttps://api.anthropic.com. Set it only for the local stub. [SERVER]CLAUDE_BILLING_CLIENT_ID- Client ID of the Claude OAuth app for Linked billing with Claude Platform. It links customer organizations. Register<APP_URL>/claude/billing/callbackas its redirect URI. [SERVER]CLAUDE_BILLING_ASSERTION_AUDIENCE- The audience that the billing app's Client authentication tab shows. [SERVER]CLAUDE_OPERATOR_FEDERATION_RULE_ID,CLAUDE_OPERATOR_ORGANIZATION_ID,CLAUDE_OPERATOR_SERVICE_ACCOUNT_ID- Identify the Kilo operator service account and the federation rule that maps Kilo-signed JWTs to it. Without them, a linked owner's requests fail with an explicit error instead of falling back to Kilo credits. [SERVER]CLAUDE_OPERATOR_WORKSPACE_ID- Optional; needed only when the operator federation rule covers more than one workspace. [SERVER]CLAUDE_OPERATOR_TOKEN_AUDIENCE- The audience the operator federation rule expects on the identity JWT Kilo signs. [SERVER]
Claude sign-in, account linking, and Linked billing with Claude Platform require their app and operator credentials.
There is no separate release toggle: the provider is offered only when CLAUDE_SIGN_IN_CLIENT_ID is set.
Anthropic's ID token need not carry email_verified; sign-in still refuses a token that states the address is unverified, and only a true claim auto-links an existing account by email.
Explicit Claude account links require a matching pending link and a current browser session, including its revocation check.
They bind the verified provider subject, not the provider email, and preserve the initiating browser session.
An explicit link does not require an email-verification claim and cannot create an account or link accounts by email.
Claude authentication refusals log a fixed reason and allowlisted claim names, never identity values or tokens.
The submitted discovery email controls offered methods only; ordinary sign-in independently authorizes the verified provider email.
Customer-billed Claude requests require a current link check. Frankfurt reads the authoritative link directly.
The US gateway delegates this check to the web application with INTERNAL_API_SECRET.
A failed check returns a retryable error; it never selects another payer.
Keep the internal secret consistent across both applications before enabling customer billing.
Provider billing failures remain customer failures, including spend-limit refusals.
A generic permission refusal does not disable the link. Only explicit profile refusals trigger that transition.
Account erasure retries temporary remote cleanup failures before deleting the stored profile identifier.
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 inapps/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_APP_WEBHOOK_SECRET- Webhook signing secret of the standard GitHub App;apps/web/src/lib/integrations/platforms/github/app-selector.tsreads it for/api/webhooks/github, which refuses every delivery (401) while it is empty.[SECRET]GITHUB_LITE_APP_WEBHOOK_SECRET- Webhook signing secret of the lite GitHub App; read for/api/webhooks/github-lite, which refuses every delivery (401) while it is empty.[SECRET]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 exacttrueto 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 inapps/web/src/scripts/backfill-pr-author-github-ids.ts.[SECRET]GH_TOKEN- Short alias used by GitHub CLI processes.[SECRET]GITHUB_USER_TOKEN_SOURCE_METADATA_ENABLED- Enables App source/refresh metadata in git-token-service responses after tolerant web readers deploy. Defaults to disabled; provided-token responses always carry this metadata.[SERVER]GIT_TOKEN- Dynamic git credential token (often a GitHub App installation token) scoped for git clone/push; consumed by the Cloud Agent Next wrapper inservices/cloud-agent-next/wrapper/src/control-plane/prepare.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 andgit-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 togit-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 inapps/web/.env.test.[PUBLIC]DOLTHUB_APP_DEV_CLIENT_SECRET- Dev-only DoltHub OAuth client secret; used inapps/web/.env.test.[SECRET]
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_APP_APPLE_ID- Apple App ID for credit-pack receipt and server-notification verification.[SECRET]APPLE_IAP_ENVIRONMENT- Apple credit-pack IAP environment (SandboxorProduction). [SERVER]APPLE_IAP_KEY_ID- Apple server API key identifier, retained for credit-pack consumption requests.[SECRET]APPLE_IAP_ISSUER_ID- Apple server API issuer (team) ID, retained for credit-pack consumption requests.[SECRET]APPLE_IAP_PRIVATE_KEY- Apple server API private key (PEM/ES256), retained for credit-pack consumption requests.[SECRET]APPLE_ROOT_CERTIFICATES_PEM- Apple root CA certs (PEM) for validating credit-pack receipts and server notifications. [SERVER]GOOGLE_PLAY_PUBLISHER_SERVICE_ACCOUNT_JSON- Android Publisher service account JSON for credit-pack purchase verification, consumption, and refund order lookup. Kilo Pass subscription API access is no longer used.[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 tokenemailclaim must match it. [SERVER]APPLE_APP_BUNDLE_ID- iOS app bundle ID for Apple App Attest and Sign In verification. [SERVER]APPLE_JWKS_URL_OVERRIDE- Apple JWKS endpoint override for local verification runs; applies only outside production deployments. [SERVER]NATIVE_APPLE_NONCE_REQUIRED_SINCE- ISO 8601 instant; the native Apple sign-in nonce requirement applies from this instant onward. Before it, requests are accepted without the field while thenative-apple-signin-nonce-relaxed-pathrelease toggle is enabled. Unset, invalid, or past ⇒ the requirement applies unconditionally. [SERVER]NATIVE_APPLE_NONCE_TRANSITION_LOCAL- Whentruein a development environment outside Vercel, the transition window opens without the release toggle, for local verification runs without PostHog credentials. [SERVER]NATIVE_ADMISSION_DEV_SENTINEL- Whentrue, non-production accepts the fixed device-attestation sentinel from devices that cannot attest (simulator, emulator without Play Services). Ignored whenNODE_ENV=production. The mobile build reads the same name. [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- Android package name (com.kilocode.kiloapp), verified against the Play Integrity verdict. [SERVER]GOOGLE_PLAY_INTEGRITY_CERT_DIGESTS- Comma-separated SHA-256 digests of accepted Play signing certificates. Use the base64url encoding fromcertificateSha256Digest, not the hex fingerprint. [SERVER]
ANALYZE- Next.js bundle analyzer switch; enables@next/bundle-analyzerinnext.config.mjs. [SERVER]
POSTGRES_URL- Primary Postgres connection string.[SECRET]POSTGRES_REPLICA_US_URL- US read replica used byreadDbin US Vercel regions (sfo1); seepackages/web-shared/src/lib/drizzle.ts. When unset,readDbfalls back to the primary, so it must be set on every project that runs insfo1, includingkilocode-ai-gateway.[SECRET]POSTGRES_REPLICA_EU_URL,POSTGRES_REPLICA_EU_URL_2- EU read replicas; in EU regionsreadDbpicks one per request by hashing the client IP (per instance at random when there is no IP) and falls back to the primary when neither is set.[SECRET]POSTGRES_REPLICAS_DISABLED- Comma-separated read replica names to switch off without deleting their URLs:us-west,eu-central-1,eu-central-2(the names in replication health alerts).readDbskips them and falls back as if their URL were unset. The replication health check logs the disabled names and skips their probes. Disabling every replica is a health check error in production. An unknown name triggers a startup warning and a health check error. Set it on every project that reads replicas (kilocode-appandkilocode-ai-gateway) and redeploy; seepackages/web-shared/src/lib/read-replicas.ts. [SERVER]POSTGRES_SCRIPT_URL- Alternate Postgres URL used by one-off scripts/backfills insrc/scripts/and tests.[SECRET]POSTGRES_URL_PRODUCTION- Production Postgres connection string override; used bypackages/db/src/database-url.ts.[SECRET]POSTGRES_CONNECT_TIMEOUT- Postgres connect timeout in ms (required; typical: 10000). [SERVER]USE_PRODUCTION_DB- Forces use of the production DB URL in non-production contexts; used bypackages/db/src/database-url.ts. [SERVER]DATABASE_CA- CA certificate content (PEM) for TLS connections to Postgres; used bypackages/db/src/database-url.tsin tests and scripts. When unset, the connection string'ssslmodeparameter decides:require/prefer/no-verifyencrypt,verify-ca/verify-fullalso verify the server certificate against the system trust store,disableor nosslmodekeeps TLS off for local development. [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 byapps/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 toDATABASE_CA; remote connections require TLS either way. [SERVER]
REDIS_URL- Redis connection URL; used bypackages/web-shared/src/lib/redis.tsand bot state.[SECRET]UPSTASH_REDIS_REST_URL- Shared Redis REST endpoint, including Discord message admission. Locally provided byredis-http. [SERVER]UPSTASH_REDIS_REST_TOKEN- Redis REST credential used by the shared client.[SECRET]
Discord message admission requires the shared Redis REST service. Accepted message claims are scoped to the bot and message, expire after 15 minutes, and remain accepted through background processing completion or failure. The gateway uses eight forwarding slots, a 10-second request deadline, and primary-database ownership checks with bounded retries. Listener availability is retained while ownership reads recover. Capacity drops are counted in listener logs. Forwarding slots cover the HTTP request lifecycle; background bot execution has a separate lifecycle. HTTP recovery uses at most three attempts for temporary admission responses within the same slot and deadline.
BYOK_ENCRYPTION_KEY- Base64 encryption key for Bring-Your-Own-Key encryption of sensitive app data.[SECRET]BYOK_KMS_SERVICE_URL- Base URL of the BYOK KMS envelope service. Required to create, update, or decrypt a BYOK key.[SERVER]BYOK_KMS_SERVICE_TOKEN- Bearer token for the BYOK KMS service; required whenBYOK_KMS_SERVICE_URLis set.[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 withpnpm 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 withpnpm 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 toCREDIT_CATEGORIES_ENCRYPTION_KEYwhen 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]
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]AUTO_ROUTING_DECISION_SECRET- HMAC secret the AI gateway uses to verifyx-kilo-auto-decisioncustom router decisions signed by the auto-routing worker (ADR 0005). Must match the worker'sAUTO_ROUTING_DECISION_SECRETSecrets Store binding. When unset, the gateway answers requests that carry the header with HTTP 503.[SECRET]USER_DATA_EXPORT_WORKER_URL- Internal user data export Worker URL. Production:https://user-data-export.kilosessions.ai; local development is generated bydev:env. [SERVER]NEXT_PUBLIC_SESSION_INGEST_WS_URL- WebSocket URL for session ingest from the browser. [PUBLIC]NEXT_PUBLIC_SESSION_SYNC_URL- Optional development-only native remote preview relay URL, defaulting tohttp://localhost:8817for the isolated local session-sync Worker./native-remote, its credential endpoint, and its CSP connection permissions requireNODE_ENV=development; production feature flags cannot enable the preview. This does not change the native CLI or session-sync service endpoints. [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]KILOCLAW_API_URL- Base URL for KiloClaw API; used heavily byapps/web/src/routers/kiloclaw-router.tsand tests. [SERVER]CLOUD_AGENT_NEXT_API_URL- URL for the Cloud Agent Next API. [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]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 tohttps://bouncer.kiloapps.ioin production. Every inference endpoint awaits one decide immediately before its provider request. [SERVER]- Decide has a 1,000 ms budget. Only a verdict with
enforced: truerejects:rate_limitedandspend_limitedreturn 429rate_limit_exceededwithretry-afterandretry-after-ms,restrictedreturns 403account_restricted. A timeout, error, non-2xx, unknown shape, or any other verdict sends the request. Verdict flags are logged server-side and never returned to the client. - Signup calls
/api/v1/signup-decideonly for new users, after account resolution and before Stripe customer creation. Existing sign-in and provider linking never consume signup quotas. The call usesINTERNAL_API_SECRETand a 3,000 ms budget. - Development skips admission. In other environments, signup requires a usable IP and a validated Bouncer verdict. Missing configuration, timeouts, transport errors, HTTP errors, invalid JSON, and unknown response shapes fail closed with
SIGNUP-UNAVAILABLE. - An unavailable verdict creates no Stripe customer, user, or auth provider. Web signup shows a retry message. Native token exchange returns HTTP 503 and releases the email-code reservation so the same code can be retried.
- A validated enforced
signup_rate_limitedresponse returnsSIGNUP-RATE-LIMITED. Cloud accepts at most eight merged IP, domain, and JA4 flags, includingsignup:busy,signup:domain, andsignup:ja4, and never exposes internal flags to the user. - A validated enforced
signup_step_upresponse returnsSIGNUP-STEP-UPwith itsmethods(1 to 8 values of^[a-z0-9-]{1,32}$). It creates no Stripe customer, user, or auth provider. Cloud shows onlygoogleandapple, in that order, and ignores other values. Web signup redirects to sign-in witherror=SIGNUP-STEP-UP&methods=<comma-separated>and asks the user to continue with those methods; the copy never names a signal. Native token exchange returns HTTP 403{ error: "SIGNUP-STEP-UP", methods }; the mobile app names the allowed Apple or Google button when that button is on its screen, and otherwise points to its browser sign-in options. - Signup sends
{ operationId, ip, ja4?, method?, emailDomain? }. JA4 comes only from the original request'sx-vercel-ja4-digestheader, not the Cloud-to-Bouncer TLS fingerprint. It is trimmed, lowercased, and bounded to^[a-z0-9_]{1,128}$; missing or invalid values are omitted whole, never truncated, and IP admission still runs.signupOperationIdhashes the existing normalized email with SHA-256 and prefixes the digest withsignup:. methodis the signup's auth provider ID.emailDomainis the registrable domain (tldtsgetDomain, private suffixes included) of the normalized email's host, or the full host when it has none, so subdomains of one domain share a counter. It is sent for every method; Bouncer counts it only for email signups. Each field is omitted whole when invalid. Withoutmethod, Bouncer applies its method-less policy, as for an old Cloud build.- With
enforcement.signupStepUpon, Bouncer steps up a risky signup instead of rejecting it: it asks for Google or Apple, and admits Apple and WorkOS on a shared IP. Deploy Bouncer withenforcement.signupStepUp=falsebefore this Cloud change, measure the shadowstepUpaudit field, and only then let Igor turn it on. - The identity helper lives in
packages/web-shared/src/lib/bouncer/signup.ts. Live admission and historical import must use the same helper. - Cloud validates the forwarded first-hop IP. Bouncer canonicalizes addresses and groups IPv6 by /64.
- Bouncer defaults to 3 admissions per canonical IP per rolling 30 days. The shorter 24-hour limit is also 3.
- JA4 defaults to 10 admissions per fingerprint per rolling 720 hours (30 days), independently of the IP limits. A shared TLS/HTTP fingerprint can cover unrelated people behind proxies or common clients: JA4 throttling risks false positives and must be evaluated separately from IP enforcement.
- The Bouncer Exemptions tab accepts user IDs and IPs. Exempt requests bypass all Bouncer rules, not Cloud authentication or billing.
- The Bouncer Bans tab bans an IP or an exact JA4 digest from signup. A ban returns an enforced
signup_rate_limitedverdict with onesignup:bannedflag anduntil: null. Cloud maps it toSIGNUP-RATE-LIMITED. - Signed-in decisions carry the actual actor's
userIdseparately from the payer'saccountId, including organization-paid requests. - IP exemptions cover signup and inference; IPv6 covers the whole /64. An exempt signup IP bypasses both IP and JA4 counters. Signup has no user ID before account creation; no JA4 exemption or user fingerprint field is added.
- Admission and creation logs share the operation ID. They exclude raw email and distinguish completed creation, rejection, and Stripe or transaction failure.
- Bouncer owns signup admission. Cloud keeps
signup_ipas evidence and retains all authentication and identity guards. - Deploy Bouncer first with
enforcement.signup=falseandenforcement.signupJa4=false; all signup enforcement ships off. The existingenforcement.signupswitch governs IP rejection, andenforcement.signupJa4independently governs JA4 rejection. The globalenforcement.enabledswitch gates both; no production switch is changed by deployment. - Bouncer evaluates IP first and skips JA4 if IP rejects. It counts admissions, including failed creations: an IP admission remains counted if JA4 later rejects, just as it remains counted after a later Cloud transaction or Stripe failure. There are no refunds. Stable operation IDs deduplicate each bucket independently. Limits and window lengths are configurable in the Bouncer admin panel.
- Historical import counts completed accounts for IP only; never reconstruct historical signup JA4 from usage or payment fingerprints. JA4 coverage starts with live signup reports.
- If the IP is valid, missing or invalid JA4 does not skip IP admission. JA4 enforcement requires a valid fingerprint.
- Deploy the first integration PR fully before this ownership cutover. Its existing Cloud limiter protects the historical import.
- From this checked-out cutover branch, run
pnpm --filter web script:run db import-signup-historywith the production script environment. - The importer reads completed accounts from the last 30 days through a fixed time bound in 100-row pages. It changes no Cloud users.
- Each page requires a full Bouncer acknowledgement. Duplicate admissions are safe. Missing or empty IPs match the old limiter's exclusions.
- Invalid nonempty IPs, partial acknowledgement, HTTP errors, and saturation stop the import with a nonzero exit.
- Run the importer again after all first-PR instances deploy. For an incremental catch-up, append the previous run's
throughtimestamp. - After full acknowledgement and catch-up, only Igor enables IP signup enforcement and the global switch. Check shadow flags before independently enabling JA4 enforcement.
- Verify allowed and rejected signups with live configuration before merging and deploying the ownership cutover PR.
- After the cutover, Bouncer failure deliberately fails open. Revert the cutover PR to restore the old Cloud limiter.
- Signed-in decide requests carry the payer's
created_at,microdollars_used, andtotal_microdollars_acquired(the organization's for an org request);charge.attemptedcarries the payer'smicrodollars_used. - Usage reports have a 30-second transport budget and carry the request's charged
costMicrodollars. Every inference endpoint reports its API kind, with the same request id as its decide. - When the decide verdict says
spendWatch, the usage event enters the durablebouncer_usage_event_outboxin the usage-write transaction, is delivered immediately after commit, and is retried by the cron drainer (eight attempts; delivered rows kept 1 day, failed rows 7 days). - For a spend-watched signed-in request, the gateway calls
/api/v1/releasewith the request id and account once the response has closed, on every path, so Bouncer frees the request's concurrency lease. Release is best-effort and idempotent. - 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.attemptedevents carry the Vercelx-vercel-ja4-digestclient 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_outboxbefore acknowledgment. The dispatcher sends/api/v2/credit-eventwith 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
originalTransactionIdidentifies a subscription chain, not an Apple ID. Refund requests and declined requests use distinct event types. - Checkout calls
/api/v1/charge-decidewithstage: "checkout"before Stripe creates or reuses a Checkout session or updates a subscription: personal Kilo Pass and the KiloClaw upsell, KiloClaw subscription checkout, top-up, organization Kilo Pass, seat checkout, a seat-count increase, and personal or organization auto-top-up setup and payment-method change. Off-session background auto top-up is not gated. The call has a 1,500 ms budget. - Only an enforced charge verdict refuses the checkout: tRPC procedures return
FORBIDDENwith "We could not start this payment. Contact support.", and the top-up route returns HTTP 403 with the same copy in{ error }. Flags are logged server-side and never returned to a client. A timeout, error, non-2xx (including an older Bouncer's 404), or unknown shape fails open and the checkout proceeds. - After a declined charge commits to
bouncer_credit_event_outbox, the webhook delivers that row immediately, then callscharge-decidewithstage: "failure"and the charge id asrequestId. An enforced verdict expires every open Checkout session of the declined charge's Stripe customer, in payment or subscription mode; a charge without a customer falls back to the open session behind its payment intent. A failed immediate delivery leaves the sessions alone and the cron drainer retries it. These steps are bounded and never fail the webhook; a redelivered second Stripe event for the same charge finds the row already delivered and changes nothing. - Bouncer enforces no charge block until
enforcement.enabledis on and a reason is listed inenforcement.chargeBlockReasons, which ships empty; user and IP exemptions still apply. - Deploy Bouncer v2 before this cloud change. Bouncer retains v1 for the current cloud deployment; the new outbox sends only v2.
- Decide has a 1,000 ms budget. Only a verdict with
CRON_SECRET- Shared secret for authenticated cron endpoints; used indev/discord-gateway-cron.tsand.env.test. If the root.env.localvalue is blank,pnpm dev:envfills it with a generated value and copies it toapps/web/.env.development.local.[SECRET]dispatch-invite-email-outbox- Vercel cron path (/api/cron/dispatch-invite-email-outbox) that drains the organization invite-email outbox; reusesCRON_SECRETfor 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; reusesCRON_SECRETfor auth. [SERVER]dispatch-bouncer-usage-event-outbox- Vercel cron path (/api/cron/dispatch-bouncer-usage-event-outbox) that retries the Bouncer usage-event outbox every minute; reusesCRON_SECRETfor auth. [SERVER]expire-credits- Vercel cron path (/api/cron/expire-credits) that expires due personal and organization credit grants every 5 minutes; reusesCRON_SECRETfor auth. It never triggers auto-top-up. [SERVER]PAID_CREDIT_EXPIRATION_EFFECTIVE_AT- ISO-8601 instant when new paid credits start receiving a one-calendar-year expiry. Unset or invalid keeps every new purchase non-expiring. Terms are captured at checkout or term start, so pending purchases and annual terms paid earlier keep legacy terms. Apple in-app purchases never expire. Create the_1year_v2Google Play credit products before setting it. [SERVER]WORKOS_API_KEY- WorkOS API key for enterprise SSO, and for thescim-syncWorker's Events API polling, where it comes from the Cloudflare Secrets Store rather than a dotenv file. The Events API is scoped to whichever WorkOS environment issued the key, so the Worker binds one pair per environment:WORKOS_API_KEY/WORKOS_CLIENT_IDin production andWORKOS_API_KEY_STAGING/WORKOS_CLIENT_ID_STAGINGunder--env staging. That choice, not the Worker'sENVIRONMENTvar, decides which directory stream a deployment consumes.[SECRET]WORKOS_CLIENT_ID- WorkOS client ID for enterprise SSO. [PUBLIC]
The WorkOS Directory Sync (SCIM) write path is apps/web/src/app/api/internal/scim/, authenticated with INTERNAL_API_SECRET in the x-internal-api-key header and documented in services/scim-sync/README.md. The endpoints need no variable of their own: they are idempotent upserts keyed on WorkOS identifiers, and preferredRegion = 'fra1' puts them beside the PostgreSQL primary they write. DELETE /api/internal/scim/users/{externalId}/memberships is the one that is not an upsert — it revokes the directory memberships the bound account holds under the directory named in its required { directoryId } body, for a dsync.user.deleted or an update reporting the user inactive, and converges rather than conflicting on an unknown directory user. The body is what scopes it: an account may also hold a membership another tenant's administrator or invitation created, and that is not the emitting directory's to revoke. The calling side does need variables: the scim-sync Worker holds no database binding and reaches these endpoints over BACKEND_API_URL, https://app.kilo.ai in production and https://staging-app.kilo.ai under --env staging. It reads the shared secret as INTERNAL_API_SECRET from the Cloudflare Secrets Store, bound to the store entry INTERNAL_API_SECRET_PROD in production and INTERNAL_API_SECRET_STAGING under --env staging, so the value lives in the store rather than in the Worker's configuration.
OPENROUTER_API_KEY- Primary OpenRouter API key for model inference through the AI gateway; provider definition inpackages/web-shared/src/lib/ai-gateway/providers/definitions/openrouter.tspointing tohttps://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 asAuthorization: Beareralongside the user'sOpenAI-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 opaque400 Bad Request. The web app's metadata cache refresh cron also uses it to store the project's served-model list, so set it on the web project too.[SECRET]MISTRAL_API_KEY- Mistral API key; used inapps/web/src/lib/embeddings/embedding-providers.tsforcodestral-embed-2505embeddings, in the FIM completions proxy atpackages/web-shared/src/lib/ai-gateway/handlers/fim-completions.ts(routes Mistral Codestral vs. La Plateforme keys), and as a provider config inpackages/web-shared/src/lib/config.server.ts.[SECRET]INCEPTION_API_KEY- Inception Labs API key; used inpackages/web-shared/src/lib/ai-gateway/handlers/fim-completions.tsandpackages/web-shared/src/lib/ai-gateway/handlers/edit-completions.tsas a fill-in-the-middle (FIM) provider, with endpointhttps://api.inceptionlabs.ai/v1/fim/completions. Defined inpackages/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 asX-Admin-Secretheader.[SECRET]ARTIFICIAL_ANALYSIS_API_KEY- API key for Artificial Analysis (apps/web/src/lib/model-stats/sync-artificial-analysis.ts); sent asx-api-keyheader for model benchmarking data sync.[SECRET]ENKRYPT_API_KEY- Kilo-owned Enkrypt API key; sent only in the server-sideapikeyheader. Used by Enkrypt score ingestion and by the opt-in organization input guardrail (enkrypt.input_guardrailin organization settings), which callsPOST /guardrails/detectfrom the AI gateway chat endpoints. Required when Enkrypt ingestion is enabled or any organization enables the guardrail, but optional at application startup; when unset, guardrail-enabled organizations have every scanned request rejected as if Enkrypt were unavailable. Set it onkilocode-ai-gatewayas well as the web app before enabling the guardrail. 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 routefake-deterministicthrough 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 tohttp://localhost:8811. Ignored on Vercel. [SERVER]
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]CODE_INDEXING_ENABLED- Set totrueto enable cloud managed code indexing. Disabled by default; unset, empty, or any other value keeps the feature off. [SERVER]
MAILGUN_API_KEY- Mailgun API key for transactional email. Used only whenVERCEL_TARGET_ENVisproductionorstaging.[SECRET]MAILGUN_DOMAIN- Mailgun sending domain. Used only whenVERCEL_TARGET_ENVisproductionorstaging. [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 whenVERCEL_TARGET_ENV=staging. Must contain exactly one valid address in thekilocode.aidomain; every staging message is redirected there with a staging subject prefix and safe Reply-To. [SERVER]LOCAL_EMAIL_OPEN_BROWSER- Set tofalseto 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_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 withopenssl rand -base64 32; must decode to exactly 32 bytes orapps/webfails 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 indecryptwith 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]
ENKRYPT_SYNC_ENABLED- Enables daily Enkrypt ingestion and mapped-model catalog enrollment only when exactlytrue; 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 exactlytrue; 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 inservices/kiloclaw/plugins/kiloclaw-morning-briefing/src/index.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_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 tohttps://app.referralsaasquatch.com. [SERVER]IMPACT_CAMPAIGN_ID- Impact.com campaign ID for event tracking. [SERVER]
CLOUDFLARE_ACCOUNT_ID- Cloudflare account ID used as the GraphQLaccountTagfor Containers Analytics queries and admin dashboard deep links; used inpackages/web-shared/src/lib/config.server.tsandapps/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 querycontainersUsageAdaptiveGroupsfor on-demand admin reconciliation; used inpackages/web-shared/src/lib/config.server.tsandapps/web/src/lib/cloudflare/container-usage-analytics.ts. Optional at process start — missing values surface as actionable errors at point of use.[SECRET]
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 forapi_request_log_2request and response bodies, stored asYYYY/MM/DD/<id>.json. [SERVER]R2_API_REQUEST_LOG_ACCESS_KEY_ID- R2 access key ID used only for the API request log bucket; uses theR2_ACCOUNT_IDaccount.[SECRET]R2_API_REQUEST_LOG_SECRET_ACCESS_KEY- R2 secret access key paired withR2_API_REQUEST_LOG_ACCESS_KEY_ID.[SECRET]R2_AI_PROVIDER_METADATA_BUCKET_NAME- Optional R2 bucket for AI provider metadata;<microdollar_usage id>.jsoncontains the version-1 gateway routing decision, optionalvercel: { metadata }, and optionalenkrypt(the organization's input guardrail settings and scan steps, without prompt text), and optionalbyok_failover_attempts(each upstream attempt's BYOK provider, status, error code, and duration when a failing BYOK key failed over to the next). [SERVER]R2_AI_PROVIDER_METADATA_ACCESS_KEY_ID- Dedicated R2 access key ID for the AI provider metadata bucket; uses theR2_ACCOUNT_IDaccount.[SECRET]R2_AI_PROVIDER_METADATA_SECRET_ACCESS_KEY- R2 secret access key paired withR2_AI_PROVIDER_METADATA_ACCESS_KEY_ID.[SECRET]
Set manually on the kilocode-ai-gateway-secure-proxy Vercel project; not managed by pnpm web:env.
KILO_AI_GATEWAY_SECURE_PROXY_SECRET- Shared secret the gateway sends asAuthorization: Bearer <secret>; read inapps/ai-gateway-secure-proxy/src/lib/secure-proxy.ts. Admins store the same value asproxy_secretinsecure_proxycustom LLM credentials. When unset, the proxy rejects every request.[SECRET]
APNS_TEAM_ID- Apple Developer team ID for the token-based APNs key used to send Live Activity pushes. Set inservices/notifications/wrangler.jsoncundervars. [SERVER]APNS_KEY_ID- APNs key identifier (kid) for the Live Activity push key. Set besideAPNS_TEAM_ID. [SERVER]APNS_PRIVATE_KEY- PKCS#8 ES256.p8private 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 itssecrets_store_secretsbinding; 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 invars. [SERVER]KILO_WEB_API_BASE_URL- Base origin of the web app, used to reach the internalglanceable-agents-snapshotroute;https://app.kilo.aiin 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.
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 inservices/kiloclaw/controller/src/checkin.tsfor 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 inapps/web/src/lib/kiloclaw/provision-lock.ts. [SERVER]OPENCLAW_GATEWAY_TOKEN- Token for authenticating with the OpenClaw gateway. Used bykiloclawplugins (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 inservices/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_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 toKILO_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. [SERVER]
Cloud Agent Sentry coverage is explicit, not blanket Durable Object instrumentation.
It captures unexpected Worker HTTP/tRPC, queue and scheduled exceptions,
control-plane wrapper startup/crash failures, and exceptions from the instrumented
exports in
services/cloud-agent-next/src/index.ts: SandboxSession, SandboxControl,
SandboxContainers, StreamTicketNonceDO, and UserKiloFacade.
EnvironmentBuild and VercelSnapshotBuild are outside this rollout. Their build
status, failure records and structured logs remain the investigation path;
unexpected standalone RPC/alarm exceptions in those classes are not guaranteed to
reach Sentry. Raw SandboxContainment and SandboxSmallContainment exports are also excluded: they
retain the SDK container lifecycle, billing hooks and outbound-handler registration
without Sentry wrapping. The control-plane wrapper's own crash reporting is
independent of these exports.
Abrupt OOM/SIGKILL failures and synthetic session failure events are not captured.
KILOCODE_TOKEN- Auth token for KiloCode/Session service identity; used by the Cloud Agent Next wrapper.[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]CLOUD_AGENT_SENTRY_DSN- Optional Worker-owned Sentry DSN for thekilo-code/kilo-cloud-agentproject, used for Cloud Agent exceptions and wrapper crashes. Forwarded only at wrapper launch, never taken from agent profiles. Missing or invalid disables reporting. [SERVER]CLOUD_AGENT_SENTRY_ENVIRONMENT- Cloud Agent Sentry environment label; defaults toproductionwhen absent. Invalid nonempty labels disable reporting. Configuration warnings name the variable once per process or Worker isolate, without its value. Use a separate label for nonproduction deployments. [SERVER]KILO_BIN_PATH- Path or name of thekiloCLI binary; used byservices/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 thecloud-agent-nextruntime; reserved inRESERVED_ENV_VARS. [SERVER]SANDBOX_SELECTION_IDS- Comma-separated user or org IDs allowed to choose a Cloud Agent sandbox size. Paid Cloud Agent billing enrollment and Vercel BYOC enrollment also enable selection without this allowlist.*includes personal accounts. Productionwrangler.jsoncsets the allowlist, so a deploy overwrites the Cloudflare dashboard value. Wranglerdevand.dev.vars.exampledefault to*. [SERVER]WORKSPACE_SNAPSHOT_IDS- Comma-separated user or organization IDs enrolled in private registered Cloud Agent workspace tail capture and restore, independent of environment snapshots. Matching either enables the feature;*enrolls everyone, and empty or unset is off. Only native Cloudflare Containers dedicated to one registered workspace are eligible. Sibling sessions share one snapshot; standalone sessions are excluded. Capture uses aggregate workspace activity after one minute. Snapshots may contain workspace secrets. The production Wrangler default is*; the dev default is empty. [SERVER]WORKSPACE_ARTIFACTS_BUCKET- Private R2 binding for synchronized workspace artifacts. Production usescloud-agent-workspace-artifacts; dev usescloud-agent-workspace-artifacts-dev. Objects are keyed<sandboxId>/<uuid>and are never served publicly. [SERVER]WORKSPACE_ARTIFACTS_BUCKET_NAME- Name of the artifacts bucket used as the S3 bucket in presigned download URLs. Must match theWORKSPACE_ARTIFACTS_BUCKETbinding. Presigned downloads reuse the attachments read-only S3 key (R2_ATTACHMENTS_READONLY_ACCESS_KEY_ID/R2_ATTACHMENTS_READONLY_SECRET_ACCESS_KEY); the operator must add the artifacts bucket to that token's read scope. [SERVER]- Do not ship lifecycle retention until there is durable artifact cleanup for pending runtime deletions and account erasure. Pending deletions can fail before the Sandbox DO queues cleanup, and account erasure bypasses that DO. Both paths can leave index rows and R2 objects behind. Once cleanup is in place, remove the old 15-day R2 expiration rule from both artifact buckets before deploying. Deployment does not change bucket rules. An upload-age rule deletes files from live workspaces and leaves their index entries behind.
PREVIEW_HOST_SUFFIX- Hostname suffix the Cloud Agent Next Worker dispatches preview hosts under; a preview host isp<port>-<workspace-uuid-hex>.<suffix>. Unset or empty disables preview dispatch and the/preview/openhop, and the web app hides the preview button (it reads availability from the Worker'sgetPreviewOptions). The web app needs no preview setting. Productionwrangler.jsoncsetscloud-agent.kiloapps.ai.services/cloud-agent-next/.dev.vars.examplesetslocalhost. [SERVER]E2E_MODEL_VALIDATION_BASE_URL- E2E-only base URL for Cloud Agent Next model validation. Only the deployed e2e Worker config sets it (test/e2e/deploy/render-e2e-worker-config.mjs), to point validation at the fake-LLM catalogue. It is honoured only when its origin equals the origin ofKILO_OPENROUTER_BASE; otherwise validation usesKILOCODE_BACKEND_BASE_URL. Unset in production. [SERVER]BYOC_VERCEL_IDS- Comma-separated user or organization IDs enrolled in customer-paid Vercel compute. Empty is off;*enrolls both personal accounts and organizations. An enrolled owner fails closed when its ready credential is absent. [SERVER]HOME- Reserved inRESERVED_ENV_VARSfor cloud-agent-next session home management. [SYSTEM]
KILO_AI_GATEWAY_BASE_URL- Origin of the AI gateway thatservices/auto-routingasks which custom router gateway entries the organization model policy denies (/api/v1/internal/auto-routing/denied-models). Awrangler.jsoncvar for production;pnpm dev:envwrites the local gateway port to.dev.vars. [SERVER]AUTO_ROUTING_DECISION_SECRET- HMAC secret that signs custom router decision IDs; the AI gateway verifies them with the same value. Production Secrets Store nameAUTO_ROUTING_DECISION_SECRET_PROD; locallypnpm dev:envseeds it from.env.local.[SECRET]
DOCKER_SOCKET- Path or URL for the Docker daemon socket;services/cloud-agent-next/scripts/dev.shmaps it toDOCKER_HOSTfor local Wrangler. [SERVER]SECRET- Generic secret env var used inservices/kiloclaw/src/auth/sandbox-id-adversarial.test.tsfor sandbox auth tests.[SECRET]SESSION_SHARE_JWT_SECRET_PROD- Secrets Store binding ofservices/session-ingestthat signs and verifies public session share tokens. Only that Worker reads it, sopnpm dev:envgenerates a random local value (@dev-generate base64 32) and no.env.localkey is needed.[SECRET]
VITE_POSTHOG_API_KEY- PostHog public project API key baked into extension builds; read inapps/extension/src/shared/analytics.ts; absent → analytics disabled. [PUBLIC]VITE_KILO_API_BASE_URL- Selects the Kilo API base URL at build time; read inapps/extension/src/shared/auth.ts. [PUBLIC]VITE_CLOUD_AGENT_WS_URL- WebSocket URL for Cloud Agent Next streaming from the extension; read inapps/extension/src/shared/cloud-agent-config.ts. Falls back to localhost duringwxt serveand the production Cloud Agent endpoint otherwise. [PUBLIC]VITE_SESSION_INGEST_WS_URL- WebSocket URL for session ingest from the extension; read inapps/extension/src/shared/cloud-agent-config.ts. Falls back to localhost duringwxt serveand the production session ingest endpoint otherwise. [PUBLIC]
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]EXPO_PUBLIC_SESSION_SYNC_URL- Native remote preview relay URL for development bundles, inlined into the JS bundle. The preview requires__DEV__and an explicit isolated Worker URL;pnpm dev:env:mobilewrites the local session-sync Worker URL (http://<host>:8817), andpnpm dev:start session-syncstarts that Worker. Release bundles ignore this setting and expose neither the Profile entry nor the/native-remotescreen. [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]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]POSTHOG_API_KEY- PostHog public project key for the mobile app's analytics and feature-flag evaluation, read asposthogApiKeyinapps/mobile/src/lib/env-keys.jsand required at startup byapps/mobile/src/lib/config.ts. Use the same PostHog project as the web app'sNEXT_PUBLIC_POSTHOG_KEY: one person's flag then evaluates identically on both clients. [PUBLIC]EXPO_PUBLIC_POSTHOG_DEV_HOST- Development-only PostHog API host for flag evaluation, such as a local mock. A development build contacts no PostHog project and resolves every flag to its default unless this is set; a release build ignores it. Read inapps/mobile/src/lib/analytics/posthog.ts, inlined into the bundle. [PUBLIC]MOBILE_DEV_HOST- LAN host override for mobile dev (replaceslocalhoston physical devices); read indev/local/mobile-env.ts. [SERVER]
IS_IN_AUTOMATED_TEST- Set to1to put the app in automated-test mode (e.g. skip Turnstile challenges). [SERVER]CANDIDATE_TAG- Tag string used byscripts/test-rollout-bucket.mjsto test rollout bucket assignment. [SERVER]PERCENT- Percentage value (0-100) used byscripts/test-rollout-bucket.mjswhen testing rollout bucket logic. [SERVER]SNOWFLAKE_MAX_POLL_ATTEMPTS- Max poll attempts for Snowflake job completion inservices/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 bydev/local/cli.tsanddev/local/services.tsto prevent port conflicts. [SERVER]COMPOSE_PROJECT_NAME- Docker Compose project for the local infrastructure; written todev/.envbydev/local/infra-env.tsso 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 todev/.envbydev/local/infra-env.ts, read bydev/docker-compose.yml. Default to 5432, 6379, 8079, and 4000. [SERVER]CLOUDFLARE_HYPERDRIVE_LOCAL_CONNECTION_STRING_HYPERDRIVE- Overrides thelocalConnectionStringeachwrangler.jsonccommits, so a worktree's workers reach that worktree's database; set on every worker command bydev/local/services.ts. [SERVER]
DATABASE_URL- Postgres URL for E2E test runs acrosscloud-agent-nextandkiloclawE2E 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]