Skip to content

Environment Variables

Required variables

These variables must be set for the Probe to start:

VariableDescriptionExample
GOVERN_API_KEYYour GOVERN platform API keygvn_live_abcdef...
GOVERN_ORG_IDYour organization IDorg_01HXYZ...
UPSTREAM_URLBase URL of the AI model APIhttps://api.anthropic.com

Connection and proxy

VariableDefaultDescription
PROXY_PORT4020Port the Probe listens on
UPSTREAM_TIMEOUT_MS30000Upstream request timeout in ms
UPSTREAM_MAX_BODY_BYTES10485760Maximum request body (10MB)

GOVERN platform

VariableDefaultDescription
GOVERN_API_URLhttps://api.govern.archetypal.aiTelemetry API endpoint
GOVERN_ENVproductionEnvironment label in telemetry
GOVERN_PROBE_ID(auto-generated UUID)Human-readable probe label

Scoring

VariableDefaultDescription
SCORING_MODEloglog, flag, or block
SCORING_SECURITY_ENABLEDtrueEnable security scoring
SCORING_SECURITY_THRESHOLD0.70Flag/block threshold (0.0–1.0)
SCORING_BIAS_ENABLEDtrueEnable bias scoring
SCORING_BIAS_THRESHOLD0.60Flag/block threshold
SCORING_ACCURACY_ENABLEDtrueEnable accuracy scoring
SCORING_ACCURACY_THRESHOLD0.65Flag/block threshold
SCORING_DRIFT_ENABLEDtrueEnable drift detection
SCORING_DRIFT_THRESHOLD0.25Flag/block threshold
SCORING_COST_ENABLEDtrueEnable cost tracking
SCORING_COST_BUDGET_TOKENS(none)Token budget per hour
SCORING_COST_BUDGET_USD(none)Spend budget per hour in USD

Telemetry

VariableDefaultDescription
TELEMETRY_FLUSH_INTERVAL_MS5000Ring buffer flush interval
TELEMETRY_BATCH_SIZE50Events per telemetry batch
TELEMETRY_RING_BUFFER_SIZE1000Max buffered events
TELEMETRY_MAX_RETRIES3Flush retry count before drop
TELEMETRY_INCLUDE_CONTENTfalseInclude prompt/response text

Logging

VariableDefaultDescription
LOG_LEVELinfodebug, info, warn, error
LOG_FORMATjsonjson or text

Health endpoints

VariableDefaultDescription
HEALTH_LIVENESS_PATH/healthzLiveness probe path
HEALTH_READINESS_PATH/readyzReadiness probe path
HEALTH_METRICS_PATH/metricsPrometheus metrics path

Example .env file

Terminal window
# Required
GOVERN_API_KEY=gvn_live_xxxxxxxxxxxxxxxxxxxx
GOVERN_ORG_ID=org_01HXYZABCDEFGHIJ
UPSTREAM_URL=https://api.anthropic.com
# Scoring
SCORING_MODE=flag
SCORING_SECURITY_THRESHOLD=0.70
SCORING_BIAS_THRESHOLD=0.60
SCORING_ACCURACY_THRESHOLD=0.65
# Telemetry
TELEMETRY_FLUSH_INTERVAL_MS=5000
TELEMETRY_BATCH_SIZE=50
# Logging
LOG_LEVEL=info
GOVERN_ENV=production

Docker Secrets (Swarm)

For Docker Swarm deployments, use secrets instead of environment variables for sensitive values:

Terminal window
echo "gvn_live_xxxx" | docker secret create govern_api_key -
echo "org_xxxx" | docker secret create govern_org_id -
services:
govern-probe:
image: archetypal/govern-probe:latest
secrets:
- govern_api_key
- govern_org_id
environment:
- GOVERN_API_KEY_FILE=/run/secrets/govern_api_key
- GOVERN_ORG_ID_FILE=/run/secrets/govern_org_id
secrets:
govern_api_key:
external: true
govern_org_id:
external: true