Deploy and operate
Documentation

Version Latest

Configuration reference

The environment variables of the Neural Inverse Govern server, grouped by area, with defaults and what happens when a value is missing or invalid.

All configuration is environment variables. In Docker Compose they come from .env (start from .env.example); on Kubernetes from the chart's values and the Secrets in secrets.*. An invalid value usually stops the server with a message naming the variable.

Production by default. With NI_AUTH_DEPLOY_ENV unset, the server refuses to start when a required key is missing, shorter than required, all zero bytes, or a placeholder (anything containing change-me, changeme, change-in-prod, replace-with, REPLACE_, dev-key or dev-secret). development, dev, local or test accepts them with a warning at every start. Never set it on a shared deployment.

Specialised settings have their own pages: Context settings, audit tiering, client events, selfguard, telemetry pipeline, BYOC compute.

Server and URLs

VariableDefaultMeaning
NI_AUTH_HTTP_ADDR:8080Listen address
NI_AUTH_PUBLIC_URLhttp://localhost:8080Public URL: OAuth redirects, the OIDC issuer, email links. HTTPS in production
NI_AUTH_API_PUBLIC_URLNI_AUTH_PUBLIC_URLPublic URL of the API when it is on its own host; used for every client-facing URL that is not a sign-in path (model and MCP gateways, downloads, the API reference)
NI_AUTH_JWT_ISSUERhttp://localhost:8080Token iss; must equal NI_AUTH_PUBLIC_URL
NI_AUTH_JWT_AUDIENCEni-auth-apiToken aud
NI_AUTH_REGISTRATION_MODEinviteinvite (an invitation is required) or open
NI_AUTH_SUPER_ADMIN_EMAILSemptyEmails that receive super admin on registration; empty: nobody, there is no first-user bootstrap
NI_AUTH_CORS_ALLOWED_ORIGINSemptyBrowser origins allowed cross-origin; empty disables CORS
NI_AUTH_PASSKEY_RP_ID, NI_AUTH_PASSKEY_ORIGINSPasskey relying party and allowed origins
NI_AUTH_TERMINAL_ORIGINSemptyOrigins the workspace web terminal accepts; unset, it is unavailable
NI_AUTH_SAAS_ENABLEDfalseThe hosted service's plans and billing; off for self-hosted
NI_ASSISTANT_ENABLEDtruefalse turns the console assistant off for the whole deployment
NI_REGION_IDlocalThe cell this installation is; self-hosted keeps local
NI_AUTH_DEPLOY_ENVunset (production)See above

Database

VariableMeaning
DATABASE_URLkeystone_app, the runtime role, under row-level security. A superuser or BYPASSRLS role is refused
DATABASE_PLATFORM_URLkeystone_platform, for the named cross-organisation tasks. Required, must differ from DATABASE_URL
DATABASE_OWNER_URLkeystone_owner, for migrations and restores only. Never give it to the running server
KEYSTONE_OWNER_PASSWORD, KEYSTONE_APP_PASSWORD, KEYSTONE_PLATFORM_PASSWORDThe three role passwords the bootstrap sets: at least 16 characters, all different (openssl rand -hex 24)
POSTGRES_DB, POSTGRES_USER, POSTGRES_PASSWORD, POSTGRES_PORTDocker Compose's PostgreSQL service; change POSTGRES_PASSWORD
NI_AUTH_DB_MAX_OPENOpen connections per server process (default 25; the Helm chart sets database.poolPerPod, default 50). Keep replicas times this below PostgreSQL's max_connections
NI_AUTH_DB_MAX_IDLEIdle connections (default: the open limit)
NI_AUTH_DB_MAX_LIFETIME, NI_AUTH_DB_MAX_IDLE_TIMEConnection lifetime (default 5m) and idle time (default 1m), Go durations

Use PgBouncer in session mode only; transaction mode is not supported, because the tenant of each connection is a session setting.

Keys and secrets

VariableRequiredGeneratePurpose
KMS_MASTER_KEYyesopenssl rand -hex 32Seals the KMS keys, the audit signing keys and the manifest signing keys. Keep stable
NI_AUTH_AUDIT_HMAC_KEYyesopenssl rand -base64 48Audit hash chains. Keep stable
NI_AUTH_AUDIT_SIGNING_KEYyesopenssl rand -base64 48Audit signing
NI_OBSERVABILITY_SIGNING_KEYyesopenssl rand -base64 48Context and governance evidence chain. Keep stable
NI_AUTH_API_KEY_PEPPER, NI_AUTH_OAUTH2_PEPPER, NI_AUTH_EMAIL_TOKEN_PEPPERyesopenssl rand -base64 48Credential digests
NI_AUTH_AGENT_PEPPERnoAgent credential digests; empty uses NI_AUTH_API_KEY_PEPPER
NI_AUTH_TOTP_ENCRYPTION_KEY, NI_AUTH_LDAP_ENCRYPTION_KEY, NI_AUTH_SOCIAL_ENCRYPTION_KEY, NI_AUTH_WEBHOOK_ENCRYPTION_KEYyesopenssl rand -base64 32AES-256-GCM keys for secrets at rest
NI_AUTH_VAULT_ENCRYPTION_KEY, NI_AUTH_SECRETS_ENCRYPTION_KEYyesopenssl rand -base64 48AI provider keys and governed secrets; rotate by moving the old value to *_RETIRED_KEYS
NI_AUTH_PASSPORT_KEYyesopenssl rand -base64 48Model Passport signing
NI_AUTH_APPROVAL_SECRETyesopenssl rand -base64 48Approval tokens
NI_AUTH_DLP_TOKEN_ENCRYPTION_KEYnoopenssl rand -base64 32DLP token vault; unset, tokenisation answers 503
NI_AUTH_MANIFEST_KEY_ROTATION_DAYSnoDays between manifest signing key rotations (default 90)

Token signing

VariableDefaultMeaning
NI_AUTH_OIDC_PRIVATE_KEY_PEM, NI_AUTH_OIDC_PRIVATE_KEY_FILECompose: /run/secrets/oidc_private_keyThe OIDC signing key; the PEM takes precedence
NI_AUTH_OIDC_KEY_IDThe kid of that key
NI_AUTH_SIGNING_ALGORITHMRS256RS256 or ES256
NI_AUTH_SIGNING_KEY_PEM, NI_AUTH_SIGNING_KEY_FILE, NI_AUTH_SIGNING_KEY_IDAn access token signing key instead of database-managed keys
NI_AUTH_ACCESS_TOKEN_TTL, NI_AUTH_REFRESH_TOKEN_TTL.env.example: 15m, 720hToken lifetimes
NI_AUTH_SESSION_IDLE_TIMEOUT168hIdle timeout of sessions
NI_AUTH_CONSOLE_CLIENT_ID, NI_AUTH_CONSOLE_SESSION_IDLE_TIMEOUT, NI_AUTH_CONSOLE_SESSION_MAX_LIFETIME, 1h, 12hThe console's OAuth client and its session limits

Signing keys of optional features

Each is an Ed25519 PKCS#8 PEM (openssl genpkey -algorithm ed25519) with a key id kept stable until you rotate.

VariablesWithout them
NI_AUTH_MODELS_SIGNING_KEY_PEM, NI_AUTH_MODELS_SIGNING_KEY_ID/api/v1/models/resolved answers 503
NI_AUTH_AGENTPOLICY_SIGNING_KEY_PEM, NI_AUTH_AGENTPOLICY_SIGNING_KEY_IDThe resolved agent policy answers 503
KEYSTONE_MCP_SIGNING_KEY_PEM (or _FILE), KEYSTONE_MCP_SIGNING_KEY_ID/api/v1/mcp/resolved answers 503
NI_AUTH_HARNESS_SIGNING_KEY_PEM, NI_AUTH_HARNESS_SIGNING_KEY_IDHarness packs can be read and assigned but not published

Email

NI_AUTH_SMTP_HOST, NI_AUTH_SMTP_PORT, NI_AUTH_SMTP_STARTTLS, NI_AUTH_SMTP_USERNAME, NI_AUTH_SMTP_PASSWORD, NI_AUTH_SMTP_FROM, NI_AUTH_SMTP_INSECURE_SKIP_VERIFY, NI_AUTH_SIGN_IN_URL. See Email.

Proxies and client addresses

NI_AUTH_TRUSTED_PROXIES, NI_AUTH_TRUSTED_CDN_PROXIES, NI_AUTH_CLIENT_IP_HEADER, NI_AUTH_CLIENT_COUNTRY_HEADER, NI_AUTH_CONSOLE_CONTEXT_KEYS. See Client IP addresses.

Outbound connections

VariableDefaultOpens
NI_AUTH_OUTBOUND_ALLOW_PRIVATE_CIDRSemptyInternal networks that webhooks, approval channels, SIEM integrations, LDAP and Active Directory, inference servers and vendor connectors may reach. Overrides every built-in rule, metadata addresses included: keep it narrow. An invalid value is logged and ignored
NI_AUTH_MODELS_PRIVATE_NETWORKSemptyModel provider connections on internal networks
KEYSTONE_MCP_ALLOW_PRIVATE_NETWORKSemptyMCP servers on internal networks
NI_AUTH_WEBHOOK_ALLOW_PRIVATEfalse (server)Organisation webhooks to private and loopback addresses. The Docker Compose file defaults it to true when unset; .env.example sets false

Storage

VariableDefaultMeaning
NI_OBJECT_STORE_DIRCompose: /var/lib/keystone/objectsShared directory for exports and artifacts; with several replicas, a volume all of them mount
NI_OBJECT_STORE_S3_BUCKET, _REGION, _KMS_KEY_ID, _PREFIX, _ENDPOINTAn S3 or S3-compatible bucket instead
NI_AUTH_AUDIT_EXPORT_MAX_ROWS1,000,000Largest audit export (1 to 50,000,000)
NI_AUTH_AUDIT_EXPORT_RETENTION_DAYS7Days an export file is kept (1 to 365)
NI_AUTH_AUDIT_EXPORT_DIRWhere earlier releases kept export files; moved to the object store at start

Audit ledger

VariableDefaultMeaning
NI_AUDIT_CHAIN_LANES8Lanes per organisation chain, unless the organisation sets its own
NI_AUDIT_GROUP_COMMIT_WINDOW2msGroup commit window, 1 to 5 ms
NI_AUDIT_GROUP_COMMIT_MAX_IN_FLIGHT8Group commit shards per replica
NI_AUDIT_GROUP_COMMIT_SPLIT_BY_CHAINtrue commits each chain of a batch in its own transaction
NI_AUTH_AUDIT_TIERING_*, NI_AUTH_AUDIT_HOT_WINDOW_DAYS, NI_AUTH_AUDIT_ARCHIVE_YEARSSee Retention and tiering

Backups

NI_AUTH_BACKUP_ENCRYPTION_KEY, NI_AUTH_BACKUP_S3_BUCKET, NI_AUTH_BACKUP_S3_PREFIX, NI_AUTH_BACKUP_S3_REGION, NI_AUTH_BACKUP_S3_ENDPOINT, NI_AUTH_BACKUP_S3_ACCESS_KEY, NI_AUTH_BACKUP_S3_SECRET_KEY. See Backup and restore.

Monitoring

VariableMeaning
NI_AUTH_METRICS_TOKENBearer token for Prometheus scrapes of /metrics, /metrics/cloud, /metrics/selfguard and the rollout gate; at least 32 bytes. Empty: only super admins can read them
NI_AUTH_SELFGUARD_*See Monitoring and self-healing

Air gap

VariableMeaning
NI_AIRGAP_LICENSE_PUBLIC_KEY, NI_AIRGAP_LICENSE_PUBLIC_KEY_FILEThe Ed25519 public key offline licences are verified with; set at most one. See Air-gapped installation

Workers

VariableMeaning
WORKER_SHARED_SECRETAuthenticates sandbox workers to the internal worker API (port 9090)
WORKER_API_BINDDocker Compose: the address port 9090 is published on (default 127.0.0.1). Never a public or all-interfaces address

Last reviewed 17 October 2026View as Markdown

Configuration reference · Docs · Neural Inverse