Configuration Reference

Every environment variable the control plane reads is parsed in one placeAppConfigService (src/config/app-config.service.ts). The only files allowed to read process.env directly are main.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.

Defaults below are the code defaults. Several variables are fail-fast in production (NODE_ENV !== 'development') — see Startup validation.

Several keys are env-var equivalents of the registry's TOML config (e.g. AUTH_REQUIRE_TENANTauth.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_ENVstringdevelopmentdevelopment relaxes fail-fast checks.
PORTnumber3001HTTP listen port.
HOSTstring0.0.0.0Bind address.
CORS_ORIGINstringhttp://localhost:3000Allowed CORS origin.

Database

VarTypeDefaultMeaning
DATABASE_URLstringpostgres://postgres:postgres@localhost:5432/acdp_control_planePostgres connection string.
DB_POOL_MAXnumber20Max pool connections per replica. Must be ≥ 2.
DB_POOL_IDLE_TIMEOUTnumber (ms)30000Idle connection timeout.
DB_POOL_CONNECTION_TIMEOUTnumber (ms)5000Connection-acquisition timeout.

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, routing stats).
AUTH_REQUIRE_TENANTboolfalseStrict-tenant default-deny. See TENANCY.md.
AUTH_PERSISTENCEmemory|postgresmemoryBackend for challenges/revocations/ledger. postgres required for multi-instance.
AUTH_SWEEP_INTERVAL_SECONDSnumber300Expired-state GC interval; ≤0 disables.
TOKEN_ISSUANCE_ENABLEDboolfalseEnable /auth/challenge + /auth/token + JWT verify path.
JWT_SECRETstring''HS256 signing secret. ≥32 bytes when issuance + HS256.
JWT_SIGNING_ALGHS256|EdDSAHS256Issuance algorithm.
JWT_PRIVATE_KEY_PEMstring (PEM)''Ed25519 PKCS8 private key. Required when issuance + EdDSA.
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.
CHALLENGE_TTL_SECONDSnumber300Challenge-nonce TTL. ≥30 when issuance.
CONTROL_PLANE_PINNED_KEYSCSV''did=base64[:alg][:from..until]. Verification + emergency revocation.
TRUSTED_ISSUERSCSV''Federated peers. iss|alg|material|audience[|scope]. audience required.
REVOCATION_FEEDSCSV''Peer feeds to poll. issuer|url|admin_token[|poll_seconds].

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.

Policy

See POLICY.md.

VarTypeDefaultMeaning
POLICY_BACKENDstatic|opastaticDecision backend.
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).
INGEST_REQUIRE_ENROLLMENTboolfalseAccept only enrolled authorities.
INGEST_STRICT_TENANTboolfalseUnenrolled authority may not assert non-default tenant.
INGEST_MAX_BODY_BYTESnumber1048576Raw body cap (1 MiB).
INGEST_MAX_JSON_DEPTHnumber64JSON nesting-depth cap.
DOMAIN_PACKSCSV''Active domain packs (e.g. finance); gates custom context_types.

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_URLstring''Redis connection (SSE redis strategy + Redis quota store).
STREAM_SSE_HEARTBEAT_MSnumber15000SSE heartbeat interval.

Rate limiting (coarse throttle)

VarTypeDefaultMeaning
THROTTLE_TTL_MSnumber60000Throttle window per (actorId|ip).
THROTTLE_LIMITnumber200Requests per window. /auth/* uses a tighter override.

Data retention

VarTypeDefaultMeaning
DATA_RETENTION_ENABLEDboolfalseEnable periodic purge of aged rows.
DATA_RETENTION_TTL_DAYSnumber30Age threshold. ≥1 when enabled.
DATA_RETENTION_INTERVAL_HOURSnumber24Purge-job interval.

Routing

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

Observability

VarTypeDefaultMeaning
LOG_LEVELstringinfodebug|info|warn|error.
OTEL_ENABLEDboolfalseEnable OpenTelemetry SDK.
OTEL_SERVICE_NAMEstringacdp-control-planeSpan/metric service name.
OTEL_EXPORTER_OTLP_ENDPOINTstring''OTLP endpoint; empty discards traces.
SWAGGER_ENABLEDbooldev: on / prod: offServe Swagger UI.
SWAGGER_PATHstringdocsSwagger UI path.

Misc

VarTypeDefaultMeaning
PLAYGROUND_URLstring''Playground backend for run-completion notifications; empty disables.

Startup validation

AppConfigService.validate() runs at boot. Throws (refuses to start) on:

  • Tenant bindings configured (TENANT_AGENTS or tenant-bound TENANT_API_KEYS) without AUTH_REQUIRE_TENANT=true.
  • Production with empty AUTH_API_KEYS.
  • DB_POOL_MAX < 2.
  • DATA_RETENTION_ENABLED=true with DATA_RETENTION_TTL_DAYS < 1.
  • POLICY_BACKEND not in opa; JWT_SIGNING_ALG not in EdDSA.
  • Issuance + HS256 with JWT_SECRET < 32 bytes.
  • Issuance + EdDSA with empty JWT_PRIVATE_KEY_PEM.
  • Issuance with JWT_TTL_SECONDS < 60 or CHALLENGE_TTL_SECONDS < 30.

Warns (starts, but flags a risk) on, in production:

  • Empty WEBHOOK_SECRET (inbound HMAC disabled).
  • STREAM_HUB_STRATEGY=memory (SSE won't sync across replicas).
  • OTEL_ENABLED=true with empty OTEL_EXPORTER_OTLP_ENDPOINT (traces discarded).
  • REVOCATION_FEEDS set with TOKEN_ISSUANCE_ENABLED=false (poller won't run).
  • TOKEN_ISSUANCE_ENABLED=true with AUTH_PERSISTENCE=memory (state not shared).