Operations

Configuration

Configure durable backends, security, sidecars, capacity, and feature switches.

Deeplinq reads process environment variables. It does not auto-load .env files. Use your deployment platform's secret manager and environment injection.

Configuration is fail-closed: malformed values, incomplete credential pairs, unknown DSN parameters, unsafe production switches, and invalid numeric ranges refuse startup.

Production mode

Set:

ENVIRONMENT=production

Production rejects in-memory fallback and development fixtures. ENVIRONMENT, ENV, and GO_ENV are aliases; the first set value wins.

Durable backends

VariablePurpose
DATABASE_MIGRATION_URLSchema-owner DSN used only for startup migrations
DATABASE_APP_URLengine_app DSN for tenant requests under forced RLS
DATABASE_SYSTEM_URLengine_system DSN for workers and control plane
S3_URLSource and derived object storage
VECTOR_URLWeaviate retrieval storage
REDIS_URLDurable admin-session validity

The three PostgreSQL URLs are all-or-nothing and must name distinct roles. DATABASE_URL is a shared development/test fallback and is not a production substitute.

DSN examples:

postgres://engine_app:pass@db:5432/deeplinq?sslmode=require
s3://ACCESS:SECRET@storage.example.com/deeplinq?region=us-east-1
weaviates://:API_KEY@weaviate.example.com:443?hybrid_alpha=0.75
rediss://:PASSWORD@redis.example.com:6379/0

Percent-encode reserved characters in DSN credentials. URL fragments and unknown query parameters are rejected.

Root security

VariablePurposeDefault
SECRETS_KEYVersioned AES-256-GCM keyring for sealed credentials and admin-cookie key derivationrequired in production
AUDIT_ANCHOR_KEYHMAC key for signed audit-chain anchorsrequired in production
ADMIN_USERNAME, ADMIN_PASSWORDBreak-glass browser and Basic-auth admindisabled unless both set
ADMIN_UIEmbedded console switch; 0 disableson when admin credentials exist
ADMIN_SESSION_TTLBrowser session lifetime12h
ADMIN_SESSION_REFRESHMaximum age of a non-break-glass session's authorization snapshot before re-authentication15m
OIDC_ISSUER, OIDC_CLIENT_ID, OIDC_CLIENT_SECRETConsole SSO relying party; set all three or nonedisabled
OIDC_GROUPS_CLAIMID-token claim read for console role mappinggroups
OIDC_ROLE_MAPPINGJSON allowlist from claim value to engine role; only platform-admin is acceptedrequired with console SSO
TRUSTED_PROXY_CIDRSProxies trusted to supply client IP for login throttlingunset
AUTH_FAILURES_PER_CLIENT, AUTH_FAILURES_GLOBALAuthentication failures allowed per one-minute client and process-wide window10, 200
BILLING_TOKENReserved billing-service credentialdisabled
MEMORY_TOKENMemory-sidecar credential toward the enginedisabled
TENANT_PROVISIONER_CLIENT_ID, TENANT_PROVISIONER_CLIENT_SECRETThe engine's own standing identity-provider service account. Used to run per-org identity setup (/v1/admin/orgs/{id}/identity-setup) and to reset the console operator's password, both with no operator-supplied credentialdisabled — the setup route refuses with a precondition until both are set, and the operator password reset fails with a 401 from the provider
TENANT_OIDC_ISSUER, TENANT_OIDC_AUDIENCE (was TENANT_OIDC_PROJECT_ID, still read)Override only. By default the tenant issuer and project are read from the console's own single sign-on configuration, set through the admin console — set these only if tenants authenticate against a different identity provider than the console does
PLATFORM_ROLES_CLAIM / PLATFORM_EXTRA_SCOPESThe platform identity provider's vocabulary: an RFC 6901 JSON Pointer to the claim carrying OPERATOR authority (default /groups), and the provider-specific scopes advertised in the RFC 9728 document (default organization:*). Both default to Keycloak's shapes; set them when the platform provider is something else. A tenant's roles are never read from a claim under any setting.
IDP_ALLOW_PRIVATELets the identity-provider metadata and JWKS fetcher reach private and loopback addresses. Off by default. Set it when the identity provider runs on the same private network as the engine, which is the common self-hosted topology — unlike the other *_ALLOW_PRIVATE guards this one is legitimate in production. Link-local and cloud-metadata addresses stay refused in every mode.
TENANT_OIDC_JWKS_CACHEFile mirror used to verify known signing keys through an identity-provider outage and after a cold startmemory-only cache
TENANT_ENDUSER_ACCEPTANCE_AGEMaximum age accepted for an end-user token, independent of its expiry1h
PRINCIPAL_LINKING_ENABLEDExact 1 enables first-sight resolution to engine principalsdisabled
PRINCIPAL_MAX_PER_ORGJust-in-time principal enrollment ceiling; 0 is unbounded10000

SECRETS_KEY accepts one base64 32-byte key or a rotation keyring such as:

2:<new-base64-key>,1:<old-base64-key>

The highest version seals new values; all listed versions may decrypt.

Optional sidecars

VariableCapability when set
DOCLING_URLReal document extraction and chunking
CRAWLER_URLJavaScript-capable website crawling
CRAWLER_ALLOWED_HOSTSProduction hostname allowlist for crawling
DUCKDB_URLCSV/XLSX ingestion and Text-to-SQL
MEMORY_URLOptional Graphiti compatibility sidecar; absence uses native memory
MEMORY_BACKENDExplicit native, graphiti, or off authority selection
MEMORY_SIDECAR_TOKENDistinct engine-to-memory credential
GUARDRAIL_URL, GUARDRAIL_TOKENEnvironment-provisioned safety classifier

Do not reuse MEMORY_TOKEN as MEMORY_SIDECAR_TOKEN; they protect opposite trust directions.

Product and capacity controls

VariableDefaultPurpose
MAX_INFLIGHT_PER_ORG16Concurrent model calls before immediate 429
AUTH_FAILURES_PER_CLIENT10Authentication-failure budget per client and minute
AUTH_FAILURES_GLOBAL200Process-wide authentication-failure budget per minute
INGEST_WORKERS2Durable ingestion worker concurrency
JOB_MAX_EXECUTION_TIME30mOne worker-attempt ceiling
JOB_RESCUE_STUCK_AFTER31mAbandoned-work recovery horizon; must be at least the execution ceiling
KNOWLEDGE_AGENT_ENABLED0Exact 1 enables knowledge-agent runtime
GUARDRAIL_MODELllama-prompt-guard-2-86mModel sent to the environment guardrail endpoint
SCHEDULE_ORG_CAP1000Active schedule ceiling
SCHEDULE_EVENTS_RETENTION_DAYS90Terminal schedule-event retention
SCHEDULE_SWEEP_INTERVAL1mDue-work, timeout, recovery, and pruning sweep cadence
PROJECTS_ORG_CAP1000Project ceiling
DATASETS_ORG_CAP1000Standalone dataset ceiling
TEAMS_ORG_CAP200Team ceiling
TEAM_MEMBERS_CAP1000Members per team
AGENTS_ORG_CAP500Agent ceiling
CONNECTIONS_INVOKE_CONCURRENCY4Concurrent connection tools per org
CHUNK_TOKENIZERembedding-model mappingTokenizer used by Docling for chunk budgets; changing it requires re-ingestion
RERANK_CANDIDATES30Hybrid candidates scored before trimming to the retrieval result set
INGEST_EMBED_BATCH16Chunks per embedding request
INGEST_STATUS_TIMEOUT5sDeadline for detached status and run-accounting writes
INGEST_MAX_RETRIES5Shared retry ceiling for failed and stranded document work
INGEST_RUN_RETENTION_DAYS90Finished ingestion-run retention
BILLING_HOLD_SWEEP_INTERVAL5mExpired authorization-hold release cadence
BILLING_HOLD_RETENTION_DAYS90Settled billing-hold retention; active holds are never age-pruned
AGENT_RUN_MAX_TURNS16Default durable-run turn bound
AGENT_RUN_WALL_CLOCK_MINUTES10Default run deadline
AGENT_RUN_APPROVAL_TIMEOUT_HOURS24Approval parking limit
AGENT_RUN_DEFAULT_BUDGET_MICRO_USD0Default run budget; 0 means no dedicated cap
AGENT_RUN_TOOL_RESULT_MAX_BYTES262144Maximum result passed back to a model

Capacity values have validated inclusive ranges. Tune from observed production load, not by disabling the ceilings.

Conversations and memory

VariableDefault
CONVERSATION_COMPACT_TRIGGER_TOKENS24000
CONVERSATION_KEEP_VERBATIM_TURNS20
CONVERSATION_COMPACT_MODELauto
MEMORY_BLOCK_TOKEN_BUDGET1000
MEMORY_TIMEOUT120s
MEMORY_SEARCH_TIMEOUT5s

Networking and telemetry

VariablePurpose
ADDRHTTP listen address, default :8080
HTTP_BODY_READ_TIMEOUTRequest-body deadline without cutting off SSE
PUBLIC_URLHTTPS base used to build OAuth callbacks
PROVIDER_REQUEST_TIMEOUT_SECONDSProvider wall-clock timeout, including queue wait; default 900, range 301800
LOG_LEVELdebug, info, warn, or error
OTEL_EXPORTER_OTLP_ENDPOINTEnables OpenTelemetry export
OTEL_EXPORTER_OTLP_PROTOCOLOTLP transport, default http
OTEL_SERVICE_NAMETrace service, default deeplinq-engine

Development-only switches

SEED, FAKE_LLM, FAKE_KNOWLEDGE_AGENT_SCENARIO, FAKE_LLM_RECORDER_URL, CRAWLER_ALLOW_PRIVATE, WEBHOOK_ALLOW_HTTP, WEBHOOK_ALLOW_PRIVATE, CONNECT_ALLOW_HTTP, MCP_ALLOW_PRIVATE, IDP_ALLOW_HTTP_ISSUERS, CONNECT_PROVIDER_ENDPOINT_OVERRIDE, and CONNECT_PROVIDER_ENDPOINT_OVERRIDE_OUTLOOK are rejected in production. IDP_ALLOW_HTTP_ISSUERS admits plain http:// issuers at external application registration, for a development console running beside the engine with no TLS — it is deliberately separate from IDP_ALLOW_PRIVATE, which production legitimately sets.

Never commit environment files, credentials, or generated secret values.

On this page