Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.guardway.ai/llms.txt

Use this file to discover all available pages before exploring further.

What this is for

The gateway is configured entirely through environment variables. The Register Gateway dialog on Deploy generates the minimum set you need (registration token, gateway name, optional LAN IP). This page is the full reference for every other variable the container accepts — production hardening, control-plane overrides, Supabase JWT validation, database/Redis, and observability. All variables are read once on startup. To change a value, edit .env (or your config-management equivalent) and restart the container.

Required: cloud registration

Every gateway you register from the dashboard runs in cloud mode and exchanges a one-time token for long-lived credentials.
VariableDefaultPurpose
GUARDWAY_CLOUD_ENABLEDfalseMaster switch. The bundle from the Register Gateway dialog sets this to true. When false the gateway runs fully self-contained and never contacts the control plane.
GUARDWAY_REGISTRATION_TOKENOne-time pairing token from the dashboard. Used once, on first boot, to exchange for long-lived credentials. Single-use; lives ~1 hour.
GUARDWAY_GATEWAY_NAMEdefaultDisplay label for this gateway in the dashboard. Edit later from the gateway detail page.
After the first successful registration the token is ignored — credentials are loaded from disk on every subsequent boot. See Deploy → Step 4.

Production hardening

Recommended in production. The defaults are placeholder values that work for local development only — the gateway refuses to boot in any non-development environment if ENCRYPTION_KEY is left at its default or shorter than 32 characters.
VariableDefaultPurpose
JWT_SECRETdev placeholderSigns gateway-issued JWTs. Replace with a long random string in production.
ENCRYPTION_KEYdev placeholderEncrypts provider secrets and other at-rest values. Must be ≥ 32 characters in non-development environments, otherwise startup fails.
MASTER_KEYdev placeholderMaster API key prefix used for emergency access. Rotate from the dashboard when possible.
JWT_MAX_TTL2160h (90 days)Hard cap on any dashboard JWT lifetime.
JWT_MANUAL_SESSION_TTL2160h (90 days)Lifetime when the user picks manual session retention, before being clamped by JWT_MAX_TTL.
JWT_CREDENTIAL_MAX_TTLunsetOptional tighter cap on password-login JWTs. Master-key sessions are not limited by this value.

Cloud overrides

The defaults already point at Guardway Cloud. Change these only for staging, an internal control plane, custom credential storage, or interval tuning.
VariableDefaultPurpose
GUARDWAY_CLOUD_URLthe Guardway control plane URLOverrides the control-plane endpoint the gateway reaches on registration, heartbeat, and config sync.
GUARDWAY_LOGS_URLthe Guardway logs ingestion URLOverrides the logs ingestion endpoint.
GUARDWAY_CREDENTIALS_PATH/etc/guardway/credentials.jsonWhere the gateway persists long-lived credentials after the first registration. Mount a writable volume at this path or override to a directory the container user can write.
GUARDWAY_HEARTBEAT_INTERVAL60sHow often the gateway pings the control plane. The dashboard flips a gateway from Online to Offline after roughly 3× this interval without a heartbeat.
GUARDWAY_EVENT_PUSH_INTERVAL10sHow often buffered platform events (counts, latencies — never raw prompts or completions) are pushed to the control plane.
GUARDWAY_LOCAL_IPemptyLAN/host IP advertised in heartbeats so the dashboard can offer a same-network direct-connect URL. Optional but recommended.
Request bodies, prompts, and completions never leave the gateway host. Only aggregate event metadata (counts, latencies, costs) and administrative audit events are pushed to the control plane.

Supabase JWT validation

Set these when the gateway should accept dashboard Supabase JWTs directly (Phase 3.1 — used by direct-connect flows). Both must be set together.
VariableDefaultPurpose
GUARDWAY_SUPABASE_JWKS_URLemptyURL of the Supabase project’s JWKS endpoint (/auth/v1/.well-known/jwks.json).
GUARDWAY_SUPABASE_ISSUERemptyExpected iss claim — the Supabase project’s /auth/v1 URL.
When GUARDWAY_SUPABASE_JWKS_URL is empty the gateway only validates locally-issued JWTs.

Server

VariableDefaultPurpose
PORT8080HTTP API listen port.
HOST0.0.0.0Bind address.
ENVIRONMENTdevelopmentMode: development, production, test. Triggers the ENCRYPTION_KEY validation above when not development.
HTTP_READ_TIMEOUT15sRequest read timeout.
HTTP_WRITE_TIMEOUT5mResponse write timeout (long enough for streaming completions).
HTTP_IDLE_TIMEOUT60sKeep-alive idle timeout.
TRUSTED_PROXIESemptyComma-separated CIDRs of proxy IPs whose X-Forwarded-For headers the gateway should trust. Empty uses safe defaults.

CORS

VariableDefault
CORS_ALLOWED_ORIGINShttp://localhost:3000
CORS_ALLOWED_METHODSGET,POST,PUT,DELETE,OPTIONS
CORS_ALLOWED_HEADERSContent-Type,Authorization
All three accept comma-separated lists.

Database

The gateway ships with sensible defaults for the bundled Compose Postgres. Override only when pointing at an external database.
VariableDefault
DB_DRIVERpostgres
DB_HOSTlocalhost
DB_PORT5432
DB_USERgateway
DB_PASSWORDgateway
DB_NAMEgateway
DB_SSLMODEdisable
DB_PATH./gateway.db (only when DB_DRIVER=sqlite)

Redis

VariableDefaultPurpose
REDIS_ENABLEDfalseTurns on Redis-backed cache and rate-limit state.
REDIS_URLredis://localhost:6379Redis connection URL.

Rate limiting (gateway-local)

These set the local request and token caps the gateway enforces. Org-wide caps are configured from Settings → Traffic and override these at runtime.
VariableDefault
RATE_LIMIT_ENABLEDtrue
RATE_LIMIT_REQUESTS_PER_MINUTE100
RATE_LIMIT_TOKENS_PER_MINUTE100000

Cache

These are gateway-local cache defaults. Org-wide cache settings configured from Settings → Traffic override these at runtime.
VariableDefaultPurpose
CACHE_ENABLEDtrueMaster switch.
CACHE_TYPEmemorymemory or redis (requires REDIS_ENABLED=true).
CACHE_TTL3600sDefault entry TTL.

Semantic cache (preview)

VariableDefault
SEMANTIC_CACHE_ENABLEDfalse
SEMANTIC_CACHE_SIMILARITY_THRESHOLD0.9
SEMANTIC_CACHE_EMBEDDING_MODELtext-embedding-ada-002
SEMANTIC_CACHE_TTL3600s

Observability

VariableDefaultPurpose
PROMETHEUS_ENABLEDtrueExposes /metrics for Prometheus scraping on the same port.
OTEL_ENABLEDfalseEnables OpenTelemetry traces.
OTEL_ENDPOINThttp://localhost:4318OTLP/HTTP collector endpoint.
JAEGER_ENDPOINTemptyJaeger collector endpoint. Set only when sending directly to Jaeger.
TRACE_SAMPLE_RATE0.1Float between 0 and 1. Fraction of requests traced.

Admin UI

The gateway ships with a minimal local admin UI. Most users govern the gateway from the dashboard and leave this off.
VariableDefault
ADMIN_UI_ENABLEDtrue
ADMIN_UI_PATH./web

API key prefix

VariableDefaultPurpose
API_KEY_PREFIXsk-Prefix prepended to gateway-issued API keys. Change only when integrating with downstream tooling that pattern-matches a different prefix.
  • Deploy — minimum env vars from the Register Gateway dialog.
  • Activate — what success looks like once the gateway boots.
  • Settings → Traffic — org-wide rate-limit and cache settings that override the gateway-local defaults above.