> ## Documentation Index
> Fetch the complete documentation index at: https://docs.noxus.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Environment

> How Noxus environment configuration is structured across deployment models

Noxus configuration is split between:

* **runtime env vars** (URLs, deployment mode, non-sensitive settings)
* **secrets** (credentials and keys)
* **admin-managed platform settings** (global configuration in the Noxus admin portal)

## Configuration Sources

```mermaid theme={null}
flowchart LR
  GIT[Helm values / Compose / IaC] --> ENV[Runtime Env Vars]
  SM[Secret Manager / K8s Secret / Env files] --> SEC[Secrets]
  ADM[Noxus Admin Portal] --> CFG[server_settings and auth config]
  ENV --> APP[Noxus services]
  SEC --> APP
  CFG --> APP
```

## Environment Variable Layers

| Layer | Example |
| - | - |
| Base platform env | deployment env, URLs, storage mode, feature toggles |
| Service-specific env | frontend-only host binding, worker subscribe mode |
| Secrets | DB/Redis credentials, auth keys, provider secrets |

## Environment Variable Reference

### Platform

| Variable | Default | Description |
| - | - | - |
| `DEPLOYMENT_ENV` | `"prod"` | Environment name for logging purposes |
| `DEPLOYMENT_NAME` | `"NOXUS"` | Display name for the deployment instance |
| `ON_PREM` | `"false"` | Set to `"true"` for non-cloud based deployments |
| `ADMIN_EMAIL` | — | Admin email used during initial bootstrap - only used on first boot |

### Disk high-watermark

On a host where the platform shares one disk (docker-compose, VM), the backend
and workers watch free space and refuse new work once it is critical (HTTP 507,
worker tasks re-queued until space is freed). The Platform Status page and the
in-app storage dialog show the level and the thresholds in force.

| Variable | Default | Description |
| - | - | - |
| `STORAGE_MONITOR` | `"auto"` | `auto` monitors only inside a container; `true` / `false` force it on or off |
| `STORAGE_MONITOR_PATH` | `"/"` | Mount whose free space is measured (MinIO's own volume is probed as well) |
| `STORAGE_WARNING_PERCENT` | `"90"` | Warning once this much of the disk is used |
| `STORAGE_CRITICAL_PERCENT` | `"95"` | Critical (new work blocked) once this much of the disk is used |
| `STORAGE_WARNING_FREE_GB` | `"10"` | Warning once less than this many GB are free. `0` disables the floor |
| `STORAGE_CRITICAL_FREE_GB` | `"5"` | Critical once less than this many GB are free. `0` disables the floor |

The percentage and the absolute floor are combined so that a level trips at
**whichever point comes later as the disk fills**, i.e. the smaller free-space
figure of the two. GB are decimal (10^9 bytes), the unit the UI shows.

| Disk | Percentage rule (10% free) | Floor | Warning trips at |
| - | - | - | - |
| 1 TB | 100 GB free | 10 GB | 10 GB free |
| 100 GB | 10 GB free | 10 GB | 10 GB free |
| 32 GB | 3.2 GB free | 10 GB | 3.2 GB free |

The critical level follows the same rule with `STORAGE_CRITICAL_PERCENT` and
`STORAGE_CRITICAL_FREE_GB`.

### Private network access

Set `ALLOWED_PRIVATE_CIDRS` on the backend and every worker to a comma-separated
CIDR allowlist, for example:

```bash theme={null}
ALLOWED_PRIVATE_CIDRS=172.18.0.0/16,10.20.0.0/16,fd12:3456::/48
```

For Helm, set `env.ALLOWED_PRIVATE_CIDRS` in `values.yaml`. For VM deployments,
add the variable to `/env.vm` or `/env.extra`, not to `/local/env.vm`, which is
regenerated from `/env.vm` on every start. For Docker Compose, pass it
through the backend and worker services' `environment` sections. Restart backend
and worker processes after changing it;
new sandboxes then use the updated policy. Existing persistent sandboxes retain
their original policy, including across stop and resume.

For remote sandboxes this requires the Syd provider (`sandbox.jail: syd` in Helm).
The `minimal` provider does not apply the per-sandbox CIDR allowlist;
the Helm `minimal` NetworkPolicy continues to block private networks.

The default is empty: private destinations remain blocked. This is one deployment-wide
policy, with no database setting, UI control, or workspace override. It applies to
API Request, scraper, crawler and file downloads, Run Code through Deno or Syd,
browser playbooks, vault integrations, and MCP URL checks. The existing MCP
"Allow private-IP MCP servers" toggle remains available for compatibility.
With that toggle off, MCP URL checks still allow destinations in
`ALLOWED_PRIVATE_CIDRS`; no separate MCP environment variable is needed.
Turning it on preserves the existing broader MCP bypass, including addresses
outside this allowlist. Leave it off to apply the CIDR policy to MCP.

Only the portions of the listed CIDRs within RFC1918 (`10/8`, `172.16/12`,
`192.168/16`) and IPv6 ULA (`fc00::/7`) are allowed. IPv4-mapped IPv6 destinations
are checked against their IPv4 address. Loopback, link-local and metadata,
unspecified, multicast, and reserved destinations cannot be allowed by this variable,
even if listed or covered by a broad entry. The [AWS IPv6 metadata endpoint](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instancedata-data-retrieval.html)
`fd00:ec2::254` is also excluded from ULA allowlists. Malformed entries fail startup with an
`ALLOWED_PRIVATE_CIDRS` validation error. Host bits are normalized to the network.
Startup logs show the effective networks after protected ranges are removed.

The worker and backend pass the policy in authenticated sandbox creation requests;
Syd applies it to outbound connections inside that sandbox. You do not need to
configure `SYD_ALLOWED_CIDRS` for this feature. Existing operator-defined Syd
rules, resolver access, and managed browser ports retain their existing behavior.
A sandbox with a non-empty allowlist, from this variable or `SYD_ALLOWED_CIDRS`,
may also bind a socket to `0.0.0.0` on an ephemeral port before connecting, as
Microsoft's ODBC Driver 18 for SQL Server does. Without an allowlist, Syd rewrites
that bind to loopback and such a client reports a login timeout.
The sandbox manager API key is an operator credential: its holder can request
any eligible private CIDRs, with no additional deployment-level CIDR ceiling
enforced by the manager.

This setting permits a destination through SSRF checks. It does not provide a
network route or resolve internal DNS names; both must work from the deployment.
These were separate causes of connectivity failures at Frulact.

### Environment-backed workspace secrets

On on-prem deployments a workspace secret can take its value from an environment
variable of the backend and worker processes instead of storing it on the platform
(source **Environment** in the variable form). Two guard rails apply:

* Names the platform itself is configured with are refused, on save and at run
  time: every variable listed on this page, the secrets and internal configuration
  files, and the credentials the cloud SDKs and model providers read (`AWS_*`,
  `AZURE_*`, `GOOGLE_APPLICATION_*`, `OPENAI_*`, `ANTHROPIC_*` and similar). Expose
  a value for workspaces under a name of your own, for example `CUSTOMER_API_KEY`.
* A platform administrator can turn the source off for the whole deployment with
  **Allow environment-backed secrets** in Settings › System › Security. It is on
  by default. When it is off, new secrets cannot use the source, the variable form
  says why the option is unavailable, and secrets that already use it fail to
  resolve with a clear error until they are switched to another source or the
  setting is turned back on. The setting is stored in the database, so it needs no
  restart.

### URLs

| Variable | Default | Description |
| - | - | - |
| `BACKEND_URL` | — | Public URL for the backend API (e.g. `https://api.example.com`). Can be set to an internal LB for the frontend instance |
| `FRONTEND_URL` | — | Public URL for the frontend (e.g. `https://example.com`) |
| `RELAY_URL` | — | Public URL for the relay service (e.g. `https://relay.example.com`) |

### Database Configuration

| Variable | Default | Description |
| - | - | - |
| `DATABASE` | `"spot"` | PostgreSQL database name |
| `POSTGRES_POOL_SIZE` | `"64"` | Connection pool size for the primary database |
| `VECTOR_POSTGRES_POOL_SIZE` | `"128"` | Connection pool size for the vector database |
| `RUN_MIGRATIONS` | `"1"` | Run Alembic migrations on startup |

### Redis

| Variable | Default | Description |
| - | - | - |
| `REDIS_PORT` | `"6379"` | Redis server port |
| `REDIS_SSL` | `""` | Enable SSL for Redis connections |
| `REDIS_SINGLE_DB_ONLY` | `""` | Restrict to a single Redis database, for compatibility with some managed Redis services |
| `CACHE_LOCATION` | `"redis"` | Cache backend location |

### Object Storage

| Variable | Default | Description |
| - | - | - |
| `BUCKET_CLIENT` | `"s3"` | Storage provider: `gcloud`, `s3`, or `minio` |
| `STORAGE_BUCKET` | — | Primary storage bucket name |
| `PUBLIC_STORAGE_BUCKET` | — | Public assets bucket name |
| `S3_ENDPOINT_URL` | `""` | Custom S3 endpoint (leave empty for AWS S3) |
| `AWS_REGION` | `"eu-west-1"` | AWS region for S3 operations |

### Observability

| Variable | Default | Description |
| - | - | - |
| `OTEL_COLLECTOR_ENDPOINT` | `""` | OpenTelemetry collector endpoint |
| `PROMETHEUS_MULTIPROC_DIR` | `"/tmp"` | Directory for Prometheus multiprocess metrics |
| `PROM_REMOTE_WRITE_URL` | `""` | Prometheus remote write endpoint |
| `ENABLE_LLM_OBSERVABILITY` | `"true"` | Enable LLM call tracing in OTEL |

### Worker Configuration (per deployment)

| Variable | Default | Description |
| - | - | - |
| `WORKER_SUBSCRIBE` | `"all_but_kb"` | Queue type: `all`, `all_but_kb`, `flow`, `chat`, `kb` |
| `WORKER_UNSUBSCRIBE_WORKSPACES` | `""` | Comma-separated workspace IDs to exclude (empty = exclude none) |
| `WORKER_SUBSCRIBE_WORKSPACES` | `""` | Comma-separated workspace IDs to process (empty = all) |

### Agent Sandbox & Plugins

| Variable | Default | Description |
| - | - | - |
| `SANDBOX_MANAGER_URL` | `""` | URL of the agent sandbox manager. Plugins execute inside sandboxes, so this also enables the plugin system — **empty disables it, silently**. |
| `USE_REMOTE_SANDBOX` | `true` | Route Run Code through the sandbox service rather than executing locally. |
| `REMOTE_SANDBOX_BACKEND` | `""` | Remote execution backend. `syd` in normal use. |
| `SANDBOX_BACKEND` | `syd` | Jail implementation: `syd` (syscall + network jail, needs `SYS_PTRACE`) or `minimal` (chroot only). |
| `LOCAL_SANDBOX_BACKEND` | `deno` | Worker-local fallback: `none`, `deno`, or `subprocess`. |
| `PLUGIN_CALL_TIMEOUT` | `240.0` | Seconds before a plugin call is abandoned. |

> [!WARNING]
>
> `LOCAL_SANDBOX_BACKEND=subprocess` runs user code in the Worker's own process
> tree — with its filesystem, network, and environment, including database
> credentials. Do not use it in a multi-tenant deployment.

See [Agent Sandbox](https://docs.noxus.ai/deployment/sandbox.md) for the deployment model and platform compatibility.

***

## Deployment-Independent Principles

* Keep non-sensitive settings in environment config
* Keep credentials in secrets only
* Keep environment names simple (`local`, `staging`, `prod`)
* Do not expose internal-only controls (such as billing internals) in user-facing docs

> [!NOTE]
>
> Noxus supports extensive runtime configuration from the admin portal when the
> user has global admin permissions. This includes global server settings and
> auth behavior.

## Practical Mapping In Your Stack

* VM compose: `env_file` and explicit env mounts
* Helm: `env`, `extraEnv`, `secrets`, plus service-specific secret variants
* Terraform stage3: secret/env materialization and namespace-scoped injection

> [card] [Secrets](https://docs.noxus.ai/deployment/configuration/secrets.md)
>
> Secret handling, provider credentials, and worker secret injection

> [card] [Workers](https://docs.noxus.ai/deployment/configuration/workers.md)
>
> Worker pools, task routing, workspace isolation, and autoscaling

> [card] [Agent Sandbox](https://docs.noxus.ai/deployment/sandbox.md)
>
> Isolated code execution, required for plugins

> [card] [Storage](https://docs.noxus.ai/deployment/configuration/storage.md)
>
> Object storage, vector databases, and caching layers

> [card] [Architecture](https://docs.noxus.ai/deployment/architecture.md)
>
> PostgreSQL and pgvector requirements, and the runtime topology


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.