<!-- https://avertgate.com/docs/env · Reference -->

# Environment variables

The main variables for the gateway (data plane) that runs in your environment. The control plane is operated by AvertGate; its settings are not customer-configurable.

## Gateway

| Variable | Description |
| --- | --- |
| `POLICY_PATH` | Path of the local policy file. |
| `AUDIT_DB_PATH` | SQLite audit log. Default `./avertgate.sqlite`. |
| `UPSTREAM_COMMAND`, `UPSTREAM_ARGS` | Single MCP upstream. |
| `UPSTREAM_SERVERS` | Multiple upstreams (JSON or file path). |
| `UPSTREAM_URL` | The reverse proxy's upstream. |
| `SHADOW_MODE` / `AVERTGATE_SHADOW_MODE` | Observe-only mode. |
| `AVERTGATE_API_KEY` | The `ag_live_…` key for cloud-managed policy. |
| `AVERTGATE_BASE_URL` | Control plane address. |
| `TYPESAFE_API_KEY`, `TYPESAFE_AI_ENDPOINT`, `TYPESAFE_MODEL` | TypeSafe AI Jev. |
| `ANTHROPIC_API_KEY`, `GUARD_MODEL_API_KEY` | Other guard providers. |
| `SLACK_WEBHOOK_URL`, `APPROVAL_BASE_URL`, `APPROVAL_PORT`, `APPROVAL_TIMEOUT_MS` | Approval flow. |
| `METRICS_ENABLED`, `METRICS_PORT` | Prometheus `/metrics` (default port 9090). |
| `CLUSTER_ENABLED` | Multi-node coordination. |
