Configuration Reference

Every environment variable the control plane reads is parsed in one place — AppConfigService (src/config/app-config.service.ts). The only files allowed to read process.env directly are main.ts, load-env.ts, db/migrate.ts, telemetry/telemetry.ts, the auth/{pinned-keys.service,pinned-keys-admin.controller,auth.module}.ts set, and domain-packs/domain-packs.module.ts. Start from .env.example.

.env is loaded automatically at process start by src/load-env.ts — the first import in main.ts, before anything else runs — so it's populated before AppConfigService is ever constructed (including the manual instance bootstrap() (src/bootstrap.ts) uses to drive database migrations, ahead of Nest's own bootstrap). It uses Node's built-in util.parseEnv (the parser behind node --env-file) via src/env-file.ts; no dotenv package. A variable already set in the environment wins over .env (an empty value still wins); a missing .env is not an error and the load is silent; an .env that exists but cannot be read (permissions, a directory) fails boot rather than silently dropping config (an EISDIR names the usual cause: a Docker bind mount -v ./.env:/app/.env of a host file that does not exist). A UTF-8 BOM is tolerated, there is no ${VAR} expansion, and KEY: value lines are not supported. The former DOTENV_OVERRIDE / DOTENV_QUIET / DOTENV_CONFIG_PATH knobs no longer have any effect; for a different file, export the variables or run node --env-file=<file> dist/main.js. src/env-file.spec.ts and src/load-env.spec.ts pin all of this.

Defaults below are the code defaults. Startup checks come in two tiers: some run in every environment, the rest only when NODE_ENV is anything other than development (so test and staging count as "production" here). A misconfiguration in the second tier boots silently under NODE_ENV=development — see Startup validation for which check is which.

Secrets: Doppler

Doppler is the source of truth for secrets and deployed config. Project acdp-control-plane has four configs: dev (the local-development values; dev_personal inherits it), stg (empty — there is no Railway staging environment) and prd (the Railway production values).

  • Local: doppler setup -p acdp-control-plane -c dev once, then prefix any command with doppler run --, e.g. doppler run -- npm run start:dev or doppler run -- npm run test:integration. A variable already in the environment wins over .env (see above), so Doppler's values take precedence and .env remains a fallback for offline work.
  • Production: deploy/doppler-sync.sh pushes the keys listed in deploy/doppler-keys.txt from Doppler prd into the Railway service acdp-control-plane (project acdp-runner, environment production). It is a dry run by default (key names and unchanged/changed/new, plus a sha256 of the managed set on both sides — never a value); --apply sets the changed keys and redeploys only if something changed (--no-redeploy to defer). It never deletes a variable, refuses a dirty tree on --apply, and refuses RAILWAY_* keys and Railway references. To change a production value: set it in Doppler prd, run the dry run, then --apply. A new key also needs a line in the allowlist (committed first).
  • Railway-managed, never in the allowlist: DATABASE_URL (a ${{…}} reference to the Railway Postgres service) and Railway's RAILWAY_* system variables.
  • Doppler-only: RAILWAY_TOKEN in prd is the Railway project token the release workflow (.github/workflows/release.yml) uses for its deploy job; it is mirrored to the GitHub secret of the same name and never synced to Railway.

Several keys are env-var equivalents of the registry's TOML config (e.g. AUTH_REQUIRE_TENANT ↔ auth.require_tenant, TENANT_AGENTS ↔ [[auth.tenant_agents]], REVOCATION_FEEDS ↔ [[auth.revocation_feeds]], CONTROL_PLANE_PINNED_KEYS ↔ [[playground.pinned_keys]]). They exist so the CP enforces the same rules; the model behind them lives in the registry's CONFIGURATION.md, AUTHENTICATION.md, and MULTI-TENANCY.md.

Core server

VarTypeDefaultMeaning
NODE_ENVstringdevelopmentExactly development skips the production-only startup checks and turns Swagger on by default; any other value (production, test, …) runs them.
PORTnumber3001HTTP listen port.
HOSTstring0.0.0.0Bind address.
PUBLIC_HOSTstring''Externally-resolvable host (example.com / example.com:8443) a consumer's did:web resolver hits for /.well-known/did.json. Distinct from HOST. Used to assert the did:web witness↔host binding at boot.
CORS_ORIGINstringhttp://localhost:3000Allowed CORS origin.
SHUTDOWN_TIMEOUT_MSinteger (ms), 1000–214748364710000Max ms app.close() may take on SIGTERM/SIGINT/SIGQUIT before lingering sockets are dropped and the process exits 1 (the overrun log names how many, forcedConnections). Keep below the platform termination grace period (Docker 10 s, Kubernetes 30 s). Strict: a non-integer or a value below 1000 fails startup (it used to fall back to 10000 silently).
SHUTDOWN_RETRY_AFTER_SECONDSinteger (s), 1–3001Retry-After on the 503 SERVICE_DRAINING sent to every new non-SSE request once the close has begun, and on /readyz's drain 503 (issue #192, see API.md). Strict.
SHUTDOWN_DRAIN_DELAY_MSinteger (ms), 0–21474836470Opt-in pre-close drain delay (issue #192, Phase 3). On SIGTERM/SIGINT/SIGQUIT the process first spends this long draining: /readyz answers 503 SERVICE_DRAINING (without querying the DB), SSE streams end with event: shutdown, and every other route keeps serving, so a load balancer can deregister the instance before the listener closes. Only then does app.close() run under SHUTDOWN_TIMEOUT_MS, so the worst-case shutdown is delay + timeout; startup warns (does not fail) when that exceeds 25000 ms. A second signal skips the rest of the delay. 0 keeps the pre-Phase-3 timing exactly. Use it or a Kubernetes preStop: sleep, not both. See ARCHITECTURE.md for the grace-period and readiness-probe arithmetic. Strict.

Database

VarTypeDefaultMeaning
DATABASE_URLstringpostgres://postgres:postgres@localhost:5432/acdp_control_planePostgres connection string.
DB_POOL_MAXnumber20Max pool connections per replica. Must be ≥ 2 (checked only outside development).
DB_POOL_IDLE_TIMEOUTnumber (ms)30000Idle connection timeout.
DB_POOL_CONNECTION_TIMEOUTinteger (ms), 1–21474836475000Connection-acquisition timeout: bounds both waiting for a pool checkout and opening a new connection. Must be an integer > 0 (every environment, issue #210); 0 would disable pg-pool's checkout/connect timeouts — an unbounded wait on a black-holed database — and a negative value makes every connect fail at once. Strict: a set value that is not a plain decimal integer (5s, 1.5, empty) fails startup instead of falling back to 5000.
READINESS_DB_TIMEOUT_MSinteger (ms), 50–300001000GET /readyz database probe deadline (issue #210): SELECT 1 with this query_timeout, raced against an outer deadline of the same length that also covers the checkout and connect wait. Past it, /readyz answers 503 DEPENDENCY_UNAVAILABLE with reason: "timeout". Keep it below your probe's own timeout — with the default, a Kubernetes readinessProbe needs timeoutSeconds: 2 (the k8s default of 1 would time out first). A value ≥ DB_POOL_CONNECTION_TIMEOUT only warns: the pool's bound then fires first and a slow connect reads as reason: "error". Strict.
READINESS_CACHE_MSinteger (ms), 0–600001000How long a readiness verdict is reused (issue #210). Caps probe-driven database load at about one SELECT 1 per window per replica, whatever the probe rate (which is why the probes are not throttled). 0 disables the cache; the probe stays single-flight (never more than one probe query, so never more than one pool connection). Strict.

GET /healthz reads none of these at request time: it is liveness and never touches the database (issue #210). It mirrors the last readiness verdict, and refreshes it in the background once that verdict is older than max(READINESS_CACHE_MS, 5000) ms. Point Kubernetes livenessProbe / startupProbe at /healthz and readinessProbe at /readyz (timeoutSeconds ≥ 2); see API.md.

Authentication & issuance

See AUTH.md.

VarTypeDefaultMeaning
AUTH_API_KEYSCSV''Bearer API keys. Empty = auth bypassed (dev only).
AUTH_ADMIN_API_KEYSCSV''Subset allowed admin ops (revoke any jti, reload pinned keys, read revocation feed, enroll registry, list enrollments, routing stats, scrape /metrics).
AUTH_READ_ONLY_API_KEYSCSV''Subset limited to GET/HEAD/OPTIONS (+ POST /auth/introspect); anything else is 403 API_KEY_READ_ONLY. For credentials handed to read-only clients, such as a console's anonymous-read key. Each key must also be in AUTH_API_KEYS and must not be in AUTH_ADMIN_API_KEYS; otherwise startup fails in every environment.
AUTH_REQUIRE_TENANTboolfalseStrict-tenant default-deny. See TENANCY.md.
TENANT_HEADER_TRUSTenumnonenone | any_peer. Who may assert a tenant via X-Tenant-Id on a JWT with no tenant claim (registry tenant_header_trust parity). none → 403 TENANT_HEADER_UNTRUSTED; any_peer honours it (warns at boot on a non-loopback HOST). Anything else fails startup. Older builds ignore it (behave as any_peer).
AUTH_PERSISTENCEmemory|postgresmemoryBackend for challenges/revocations/ledger. postgres required for multi-instance. Any other value fails startup (every environment).
AUTH_SWEEP_INTERVAL_SECONDSnumber300Expired-state GC interval; ≤0 disables.
TOKEN_ISSUANCE_ENABLEDboolfalseMaster switch for the whole JWT side: mounts /auth/challenge, /auth/token, /auth/token/revoke, /auth/introspect, /auth/revocations and /.well-known/jwks.json, and wires JWT verification — including federated TRUSTED_ISSUERS tokens and the REVOCATION_FEEDS poller. Off = API keys only; every bearer JWT is rejected.
JWT_SECRETstring''HS256 signing secret. ≥32 bytes when issuance + HS256 (checked only outside development).
JWT_SIGNING_ALGHS256|EdDSAHS256Issuance algorithm (case-sensitive). Any other value fails startup (every environment).
JWT_PRIVATE_KEY_PEMstring (PEM)''Ed25519 PKCS8 private key. Required when issuance + EdDSA (checked only outside development).
JWT_KIDstring''Override kid; else derived from key fingerprint.
JWT_AUTHORITYstringcontrol-plane.localiss claim + challenge signing input.
JWT_AUDIENCEstring= JWT_AUTHORITYaud claim bound + required on local verify.
JWT_TTL_SECONDSnumber3600Issued-token TTL. ≥60 when issuance (checked only outside development).
CHALLENGE_TTL_SECONDSnumber300Challenge-nonce TTL. ≥30 when issuance (checked only outside development).
CONTROL_PLANE_PINNED_KEYSCSV''did=base64[:alg][:from..until]. Verification + emergency revocation. Loaded whether or not issuance is on; a malformed entry is skipped with a warning, never a boot failure.
TRUSTED_ISSUERSCSV''Federated peers (parsed — and its boot failures below raised — only when TOKEN_ISSUANCE_ENABLED=true). iss|alg|material|audience[|scope[|flags]]. audience required. flags (6th field, whitespace-separated, closed set; today only read_only) — to set a flag without a scope leave the scope empty: iss|HS256|<secret>|<aud>||read_only. read_only limits that issuer's tokens to GET/HEAD/OPTIONS (403 ISSUER_READ_ONLY otherwise; POST /auth/introspect exempt). An entry whose iss equals JWT_AUTHORITY fails startup (it would be shadowed by the local issuer). Unknown/duplicate flags, a flag name in the scope slot, or >6 fields fail startup. Rollback hazard: a build older than this field silently ignores the 6th field, so rolling back drops read_only. scope (optional) is checked against the token's scope/scopes/scp claims; do not set it for ACDP registry peers (they mint no scope claim).
REVOCATION_FEEDSCSV''Peer feeds to poll. issuer|url|admin_token[|poll_seconds]. The poller runs only with TOKEN_ISSUANCE_ENABLED=true.

Tenancy

See TENANCY.md.

VarTypeDefaultMeaning
TENANT_API_KEYSCSV''tenantId:key,…,bareKey. Bare keys → default.
TENANT_AGENTSCSV''tenantId:agent_did,…. Stamps JWT tenant claim.
TENANT_QUOTASstring''Per-tenant quotas. See POLICY.md. Ingest publish is charged to the tenant the webhook resolves to (an enrolled registry's tenant), after HMAC — a lone default:publish does not limit registries enrolled under other tenants; add <tenant>:publish (INGEST.md).

Policy

See POLICY.md.

VarTypeDefaultMeaning
POLICY_BACKENDstatic|opastaticDecision backend (case-insensitive). Any other value fails startup (every environment).
OPA_URLstringhttp://localhost:8181OPA sidecar base URL.
OPA_PACKAGE_PATHstringacdp/policy/v1OPA package path.
OPA_TIMEOUT_MSnumber1500Per-query timeout.
OPA_FAIL_OPENboolfalseOn OPA error, allow instead of deny.

Ingest

See INGEST.md.

VarTypeDefaultMeaning
WEBHOOK_SECRETstring''Global HMAC secret for inbound webhooks. Empty = verification skipped (dev only — fails startup outside development).
INGEST_REQUIRE_ENROLLMENTboolfalseAccept only enrolled authorities.
INGEST_STRICT_TENANTboolfalseAn unenrolled authority's non-default X-Tenant-Id is ignored (warn log) and the event lands in default.
INGEST_MAX_BODY_BYTESnumber1048576Raw body cap (1 MiB). Also the JSON body-parser limit for every route, so an oversized JSON body is 413 PAYLOAD_TOO_LARGE.
INGEST_MAX_JSON_DEPTHnumber64JSON nesting-depth cap.
DOMAIN_PACKSCSV''Active domain packs; gates custom context_types. The only compiled-in pack today is finance; an unknown or duplicate name fails startup (every environment).

Federation proxy

VarTypeDefaultMeaning
REGISTRY_FETCH_URL_OVERRIDESJSON object'' (none)Operator-trusted fetch targets for GET /contexts/*: {"<authority>": "<base url>"}, e.g. {"registry-a.example":"http://registry-a.internal:8100"}. For a ctx_id whose authority exactly matches a key, the proxy fetches <base url>/contexts/<ctx_id> with the public-only SSRF checks skipped, so http:// and private-network targets work (redirects stay same-origin, and the 1 MiB cap and 10 s deadline still apply). Every other authority, and every payload-sourced base URL, keeps the full SSRF gate. The authority must still be observed in the caller's tenant (otherwise 404 REGISTRY_NOT_FOUND), and the ctx_id binding check still runs. Parsed at construction in every environment. Startup fails on non-JSON, a non-object, a key outside the ctx_id authority grammar (lowercase DNS, no port, no scheme), or a value that is not an absolute http(s) URL or that carries credentials, a query or a fragment. Errors name the key, never the value.

Outbound webhooks

VarTypeDefaultMeaning
WEBHOOK_RETRY_INTERVAL_MSnumber300000Outbox retry-sweep interval; ≤0 disables.
WEBHOOK_SSRF_ALLOW_HTTPboolfalseAllow non-HTTPS subscriber URLs (dev only).
WEBHOOK_SSRF_ALLOW_LOOPBACKboolfalseAllow loopback/localhost subscriber URLs (dev only).

Streaming & infra

VarTypeDefaultMeaning
STREAM_HUB_STRATEGYmemory|redismemorySSE fan-out backend. redis for multi-instance. redis without REDIS_URL, or any other value, silently uses memory.
REDIS_URLstring''Redis connection for the SSE redis strategy and the quota store. The quota store uses Redis only when TENANT_QUOTAS also configures at least one tenant.
STREAM_SSE_HEARTBEAT_MSnumber15000Interval of the server-sent heartbeat event on both SSE routes. Keep it below your proxy's idle timeout.
STREAM_SSE_SHUTDOWN_RETRY_MSinteger (ms), 0–600001000retry: hint on the terminal SSE event: shutdown (issue #192): how long an EventSource waits before reconnecting, by then to a live replica. Strict.

Rate limiting (coarse throttle)

VarTypeDefaultMeaning
THROTTLE_TTL_MSnumber60000Throttle window per (actorId|ip).
THROTTLE_LIMITnumber200Requests per window. /auth/* uses a tighter override.
THROTTLE_IPV6_SUBNET_PREFIXinteger 1–12864Prefix an unauthenticated IPv6 caller's address is collapsed to before keying. Anything but a decimal integer in range — out-of-range, fractional, or non-numeric (/48, sixty-four, 0x40, 1e2, empty) — fails startup (every environment) — a set value is never silently replaced by 64. 128 = per-address.
TRUST_PROXYhop count | address listunset (off)Express trust proxy — which reverse proxies may set the client address via X-Forwarded-For. See Behind a reverse proxy below. Invalid values (including true) fail startup in every environment. Production (Railway) runs 1: exactly one edge hop, managed in Doppler prd.

Tracker. An authenticated request (API key or bearer JWT) is keyed on its principal (actorId), whatever address it comes from. An unauthenticated request — every @Public() route, including the 20/min /auth/challenge + /auth/token override — is keyed on the client IP, normalized by @nestjs/throttler's normalizeIp (issue #187): IPv4 as-is, IPv4-mapped IPv6 (::ffff:a.b.c.d) onto its IPv4, loopback ::1 as-is, any other IPv6 address onto its /THROTTLE_IPV6_SUBNET_PREFIX network, so a host rotating source addresses inside its own /64 still lands in one bucket. Values below 48 are almost always wrong (they merge unrelated sites); lower to 56/48 only to blunt an abuser spreading across a larger allocation. Known coarse cases: NAT64 (64:ff9b::/96) and Teredo clients share one /64 bucket per translator/relay.

Behind a reverse proxy (TRUST_PROXY)

The client IP is Express's req.ip. With TRUST_PROXY unset (the default) that is the TCP peer, so behind a load balancer / ingress every unauthenticated caller shares the proxy's throttle bucket, and the issuance ledger's signer_ip records the proxy. Set TRUST_PROXY to tell Express which hops are yours; req.ip then resolves to the address your outermost trusted proxy saw, and every reader (ThrottleByUserGuard, the ledger) uses it — no component parses X-Forwarded-For itself.

Accepted values (whitespace-trimmed):

ValueMeaning
unset, empty, 0, falseOff — Express's default; X-Forwarded-For is ignored.
1–10Hop count: trust that many proxies in front of the CP; req.ip is the X-Forwarded-For entry that many hops from the right. Set it to the exact number of proxies you run.
comma-separated listTrust peers matching any entry: loopback, linklocal, uniquelocal (proxy-addr's named ranges), a plain IPv4/IPv6 address, or a CIDR (10.0.0.0/8, fd00::/8). Duplicates are ignored; names are case-insensitive.

Rejected at startup (the process exits before migrations run):

  • true / yes / on. Trusting every hop makes req.ip the leftmost X-Forwarded-For entry — whatever the client wrote. Any caller could then pick a fresh throttle bucket per request (and write the ledger's signer_ip).
  • Hop counts above 10 (a count larger than your real chain does the same as true), negative or fractional numbers.
  • CIDRs wider than /8 (IPv4) or /7 (IPv6) — 0.0.0.0/1,128.0.0.0/1 is true in disguise; /7 keeps fc00::/7 usable.
  • Any IPv6 entry overlapping IPv4-mapped space ::ffff:0:0/96 (e.g. ::ffff:10.0.0.1, ::ffff:0:0/96, ::/80) — Express matches IPv4 peers against their mapped form, so these can trust every IPv4 peer. Use the plain IPv4 form.
  • IPv6 written with an embedded dotted quad (::1.2.3.4) — use hex groups.
  • Zone ids (fe80::1%eth0), netmask notation (10.0.0.0/255.0.0.0), empty entries (a,,b), anything else unrecognised (including no / off).

A hop count is the simplest correct setting when the chain length is fixed (one ALB → 1; CDN → LB → 2). Prefer an address list when the CP is also reachable directly: with a hop count, a caller that bypasses the proxy is itself treated as the trusted hop, so its own X-Forwarded-For becomes req.ip.

uniquelocal (and a private CIDR such as 172.16.0.0/12) is a bypass case too, not only hop counts: Docker Desktop presents every peer reaching a published port as its gateway address (and on Linux, Docker's userland-proxy does the same for host-loopback/hairpin connections, e.g. 172.17.0.1) — inside uniquelocal. A direct caller is then "trusted", and its own X-Forwarded-For becomes req.ip. Trust the proxy's specific address instead, or do not publish the CP's port.

Over-trust makes req.ip client text. If the hop count exceeds the real chain, or a trusted proxy forwards the client's X-Forwarded-For verbatim instead of appending to it, req.ip is an untrusted header entry — not necessarily even an IP address. The issuance ledger is guarded: signer_ip is recorded only when req.ip is a valid IP literal of at most 64 characters (the column width — isIP alone would accept an arbitrarily long IPv6 zone id), otherwise it is left empty, so /auth/token never fails on it. Throttle bucketing is not: an unauthenticated caller can still choose its own bucket per request, so get the setting right.

Upgrade note. signer_ip used to be the leftmost X-Forwarded-For entry whenever the header was present. It is now always req.ip, so a proxied deployment that has not set TRUST_PROXY records the proxy address from now on. Existing ledger rows (and their hash chain) are unchanged.

Receipt audit (RFC-ACDP-0010)

An advisory-locked sweep that cross-checks each ingested context_published event's embedded registry_receipt, seals a verdict in receipt_audits, and surfaces it as trust on GET /runs/:runId. Receipt rules: RFC-ACDP-0010 (registry side: RECEIPTS.md); how the sweep fits the pipeline: ARCHITECTURE.md.

VarTypeDefaultMeaning
RECEIPT_AUDIT_ENABLEDboolfalseEnable the receipt-audit sweep.
RECEIPT_AUDIT_INTERVAL_SECONDSnumber300Sweep interval. ≥5 when enabled (checked only outside development).
RECEIPT_AUDIT_BATCH_SIZEnumber50Events audited per sweep. ≥1 when enabled (checked only outside development). Also caps the retroactive key-revocation re-audit fan-out.
RECEIPT_AUDIT_LOOKBACK_HOURSnumber24Only events younger than this are picked up.

Transparency-log witnessing (RFC-ACDP-0012 / RFC-ACDP-0015)

The checkpoint witness polls GET /log/checkpoint on enrolled registries that advertise acdp-registry-transparency-log, verifies each checkpoint against the last-witnessed head, and alerts on dishonesty signals. Checkpoint and proof rules: RFC-ACDP-0012.

VarTypeDefaultMeaning
LOG_WITNESS_ENABLEDboolfalseEnable the checkpoint-witness sweep. Prerequisite for cosigning and quorum consumption below.
LOG_WITNESS_INTERVAL_SECONDSnumber300Sweep interval. ≥5 when enabled (checked only outside development).
LOG_WITNESS_EXCLUDE_AUTHORITIESlist''Authorities never witnessed.

Witness cosigning. The CP cosigns each checkpoint that passes verification with its own dedicated Ed25519 witness key, stores one log_cosignatures row per observation (not per head), and serves them at GET /log/witness (API.md). Cosignature rules: RFC-ACDP-0015.

VarTypeDefaultMeaning
WITNESS_COSIGNING_ENABLEDboolfalseEnable minting + serving witness cosignatures. Requires LOG_WITNESS_ENABLED=true (checked only outside development).
WITNESS_IDstring''The witness's DID (did:web:<this-CP-host> or did:key). Required when enabled.
WITNESS_SIGNING_PRIVATE_KEY_PEMstring''PEM-encoded Ed25519 private key the witness cosigns with. Required when enabled. Dedicated — never the JWT key. Generate with openssl genpkey -algorithm ed25519.
WITNESS_KEY_IDstring''assertionMethod key id (DID URL under WITNESS_ID). Defaults to <WITNESS_ID>#witness-key-1.
WITNESS_COSIGNATURE_KEEP_PER_HEADnumber10Retention: cosignatures kept per (tenant, witness, log, head) tuple — the newest N-1 plus the single oldest row, which is never purged. Runs only with DATA_RETENTION_ENABLED=true.

When WITNESS_ID is a did:web, its host must match PUBLIC_HOST so consumers can fetch /.well-known/did.json from this CP: a mismatch fails boot, an unset PUBLIC_HOST only warns. did:key witnesses are exempt.

Witness quorum consumption. The CP counts the distinct trusted witnesses whose cosignatures a registry aggregates on GET /log/checkpoint, and records witnessed_count / meets_quorum (plus the fresh_* and historical_witnessed_count sub-counts) on each witnessed head, surfaced on GET /registries/:authority/log-witness and the dashboard logWitness tile. Quorum, freshness and witness-key rules: RFC-ACDP-0015 §8–§9.

VarTypeDefaultMeaning
WITNESS_QUORUM_ENABLEDboolfalseEnable quorum consumption. Requires LOG_WITNESS_ENABLED=true (checked only outside development).
WITNESS_QUORUM_TRUSTEDlist''Witness DIDs whose cosignatures count; others are verified but ignored. Must not contain this CP's own WITNESS_ID (boot fails outside development). Empty only warns: nothing can ever count.
WITNESS_QUORUM_MIN_WITNESSESnumber1The N in N-witnessed. ≥1 when enabled (checked only outside development).
WITNESS_QUORUM_MAX_AGE_SECONDSnumber|null300Freshness window for the fresh_* counts. '' or 0 disables the split (every verified cosignature counts as fresh); a non-numeric value falls back to 300.
WITNESS_QUORUM_MAX_CLOCK_SKEW_SECONDSnumber120Hard future-dating tolerance: a cosignature whose witnessed_at is further ahead than this never counts.

Log-inclusion audit. The sibling sweep to the checkpoint witness: for stored receipt-bearing publishes from log-advertising registries it fetches /log/proof?ctx_id=, verifies inclusion, and seals one verdict per event (included | invalid_proof | not_logged | no_log | error) in log_inclusion_audits.

VarTypeDefaultMeaning
LOG_INCLUSION_AUDIT_ENABLEDboolfalseEnable the inclusion-audit sweep.
LOG_INCLUSION_AUDIT_INTERVAL_SECONDSnumber300Sweep interval. ≥5 when enabled (checked only outside development).
LOG_INCLUSION_AUDIT_BATCH_SIZEnumber50Events audited per sweep. ≥1 when enabled (checked only outside development).
LOG_INCLUSION_AUDIT_LOOKBACK_HOURSnumber24Only events younger than this are picked up.

Producer key-revocation (RFC-ACDP-0014)

When enabled, a sweep fetches and verifies key-revocation contexts into key_revocations, and the receipt-audit sweep classifies each audited event against them (trust.revoked on GET /runs/:runId, dashboard keyRevocation tile). Already-sealed verdicts are amended retroactively when a later revocation reaches back over them — no extra knob. Revocation format, trust classes and consumer semantics: RFC-ACDP-0014; CP mechanics: ARCHITECTURE.md.

VarTypeDefaultMeaning
KEY_REVOCATION_CHECK_ENABLEDboolfalseEnable revocation verification + classification. Requires RECEIPT_AUDIT_ENABLED=true — a production-only check: under NODE_ENV=development the combination is not rejected at boot.
KEY_REVOCATION_ATTESTED_SCOPEsame_registry|global|offsame_registryHow far a registry-attested (not producer-signed) revocation reaches: only events from the attesting registry, every registry, or ignored. Case-sensitive; an unknown value fails boot only outside development.
KEY_REVOCATION_IGNORE_FINGERPRINTSlist''Operator override: fingerprints listed here never disarm producer trust, even if a revocation names them. Applied at classification time.
KEY_REVOCATION_LOOKBACK_HOURSnumber720Candidate window of the revocation-discovery sweep (30 days, deliberately longer than RECEIPT_AUDIT_LOOKBACK_HOURS so an outage cannot lose an irreversible revocation). ≥1 when enabled (checked only outside development).
KEY_REVOCATION_LINEAGE_CURSOR_TTL_HOURSnumber1Re-walk cadence for the lineage walk's "fully walked" marker; a cadence knob, not a correctness gate. 0 = always re-walk. ≥0 when enabled (checked only outside development).

Data retention

VarTypeDefaultMeaning
DATA_RETENTION_ENABLEDboolfalseEnable periodic purge of aged rows.
DATA_RETENTION_TTL_DAYSnumber30Age threshold. ≥1 when enabled (checked only outside development).
DATA_RETENTION_INTERVAL_HOURSnumber24Purge-job interval.

Routing

VarTypeDefaultMeaning
BANDIT_EXPLORATION_FRACTIONnumber0.05Fraction of traffic using uniform exploration vs Thompson sampling.

Observability

VarTypeDefaultMeaning
LOG_LEVELstringinfopino level: trace|debug|info|warn|error|fatal|silent.
OTEL_ENABLEDboolfalseStart the OpenTelemetry Node SDK with auto-instrumentations.
OTEL_SERVICE_NAMEstringacdp-control-planeSpan/metric service name.
OTEL_EXPORTER_OTLP_ENDPOINTstring''OTLP endpoint. Empty = the CP configures no exporter of its own, and the SDK falls back to its built-in default: OTLP over http/protobuf to http://localhost:4318/v1/traces. Without a collector there, spans are dropped. The SDK also honours the other standard OTEL_* variables (OTEL_TRACES_EXPORTER, OTEL_EXPORTER_OTLP_PROTOCOL, …) directly; the CP does not read them.
SWAGGER_ENABLEDboolon when NODE_ENV=development, else offServe Swagger UI.
SWAGGER_PATHstringdocsSwagger UI path.

Startup validation

Checks fall into two tiers. AppConfigService.validate() runs the first block in every environment, then returns early when NODE_ENV=development, so everything in the second tier is skipped in development. Integration tests run with NODE_ENV=development, so they never exercise the second tier.

Every environment

Refuses to start on:

  • An invalid POLICY_BACKEND, JWT_SIGNING_ALG or AUTH_PERSISTENCE, or a rejected TRUST_PROXY (these are parsed when AppConfigService is built, so the process exits before migrations run).
  • An unknown or duplicate DOMAIN_PACKS name.
  • Tenant bindings (TENANT_AGENTS, or a tenant-bound TENANT_API_KEYS entry) without AUTH_REQUIRE_TENANT=true.
  • TENANT_HEADER_TRUST other than none / any_peer.
  • THROTTLE_IPV6_SUBNET_PREFIX not an integer in [1, 128].
  • SHUTDOWN_TIMEOUT_MS not an integer in [1000, 2147483647], SHUTDOWN_RETRY_AFTER_SECONDS not in [1, 300], STREAM_SSE_SHUTDOWN_RETRY_MS not in [0, 60000], or SHUTDOWN_DRAIN_DELAY_MS not in [0, 2147483647] (issue #192).
  • READINESS_DB_TIMEOUT_MS not an integer in [50, 30000], READINESS_CACHE_MS not in [0, 60000], or DB_POOL_CONNECTION_TIMEOUT not in [1, 2147483647] (issue #210).

These strict knobs never fall back to their default: a set value that is not a plain decimal integer (5s, 1.5, 0x40, empty) fails.

Starts, but warns on:

  • TENANT_HEADER_TRUST=any_peer with a HOST other than 127.0.0.1, ::1 or localhost.
  • SHUTDOWN_DRAIN_DELAY_MS + SHUTDOWN_TIMEOUT_MS above 25000 ms (check the platform's termination grace period).
  • READINESS_DB_TIMEOUT_MS >= DB_POOL_CONNECTION_TIMEOUT (a slow connect is then reported as reason: "error", not "timeout").

Production only (NODE_ENV ≠ development)

Refuses to start on:

  • Empty AUTH_API_KEYS.
  • Empty WEBHOOK_SECRET (inbound webhook HMAC verification would otherwise be disabled).
  • DB_POOL_MAX < 2.
  • DATA_RETENTION_ENABLED=true with DATA_RETENTION_TTL_DAYS < 1.
  • RECEIPT_AUDIT_ENABLED=true with RECEIPT_AUDIT_INTERVAL_SECONDS < 5 or RECEIPT_AUDIT_BATCH_SIZE < 1.
  • LOG_WITNESS_ENABLED=true with LOG_WITNESS_INTERVAL_SECONDS < 5.
  • LOG_INCLUSION_AUDIT_ENABLED=true with LOG_INCLUSION_AUDIT_INTERVAL_SECONDS < 5 or LOG_INCLUSION_AUDIT_BATCH_SIZE < 1.
  • WITNESS_COSIGNING_ENABLED=true without WITNESS_ID, without WITNESS_SIGNING_PRIVATE_KEY_PEM, or without LOG_WITNESS_ENABLED=true.
  • WITNESS_QUORUM_ENABLED=true without LOG_WITNESS_ENABLED=true, with WITNESS_QUORUM_MIN_WITNESSES < 1, or with this CP's own WITNESS_ID listed in WITNESS_QUORUM_TRUSTED (a consume-only deployment with no WITNESS_ID is unaffected by the last check).
  • KEY_REVOCATION_CHECK_ENABLED=true without RECEIPT_AUDIT_ENABLED=true, with KEY_REVOCATION_ATTESTED_SCOPE not in off, with KEY_REVOCATION_LOOKBACK_HOURS < 1, or with KEY_REVOCATION_LINEAGE_CURSOR_TTL_HOURS < 0 (0 is legal).
  • TOKEN_ISSUANCE_ENABLED=true with: HS256 and a JWT_SECRET under 32 bytes; EdDSA and an empty JWT_PRIVATE_KEY_PEM; JWT_TTL_SECONDS < 60; or CHALLENGE_TTL_SECONDS < 30.

Starts, but warns on:

  • STREAM_HUB_STRATEGY=memory (SSE does not sync across replicas).
  • OTEL_ENABLED=true with an empty OTEL_EXPORTER_OTLP_ENDPOINT. The warning says traces are discarded; in fact the SDK exports to its default http://localhost:4318 (see Observability), so they are lost only if no collector listens there.
  • WITNESS_COSIGNING_ENABLED=true with DATA_RETENTION_ENABLED=false (log_cosignatures gains a row on every observation and grows unbounded).
  • WITNESS_QUORUM_ENABLED=true with an empty WITNESS_QUORUM_TRUSTED (no cosignature can ever count).
  • REVOCATION_FEEDS set with TOKEN_ISSUANCE_ENABLED=false (the poller does not run).
  • TOKEN_ISSUANCE_ENABLED=true with AUTH_PERSISTENCE=memory (challenge and revocation state is not shared across replicas).

Other boot-time failures

Not part of validate(), but they also stop the process in every environment:

  • The acdp SDK binding verifies Ed25519 non-strictly (the sig-004 self-test that runs first in bootstrap(); see TROUBLESHOOTING.md).
  • With TOKEN_ISSUANCE_ENABLED=true: a malformed TRUSTED_ISSUERS entry, or one whose iss equals JWT_AUTHORITY.
  • With WITNESS_COSIGNING_ENABLED=true: WitnessSigningService rejects an empty or malformed WITNESS_ID, a missing, unparseable or non-Ed25519 WITNESS_SIGNING_PRIVATE_KEY_PEM, a WITNESS_KEY_ID not under WITNESS_ID, or a did:web witness whose host does not match a set PUBLIC_HOST. So cosigning without a witness DID or key fails in development too; only the LOG_WITNESS_ENABLED prerequisite is production-only.