Configuration & environment variables
Every configuration surface in one place: the dependency baseline, the full environment-variable reference, and the provider configuration model.
Configuration reference
VerifAIer is configured entirely by environment variables (12-factor). There is no config file to edit; copy .env.example to .env and set values, or inject env vars via your platform. The runtime baseline:
| Item | Value |
|---|---|
| Python | ≥ 3.12 (container base python:3.12-slim) |
| Core dependencies | fastapi≥0.115, uvicorn[standard]≥0.32, anthropic≥0.40, pydantic≥2.9, pydantic-settings≥2.6, jsonschema≥4.23 |
| Optional extras | dev (pytest/httpx/ruff), enterprise (cryptography), anchoring (web3) |
| Package version | 2.0.0-alpha (API/service version reported by /health is 1.4.2) |
| Datastore | SQLite by default (DB_PATH); optional PostgreSQL via DATABASE_URL |
.env. _build.py excludes .env and every .env.* except .env.example from the shipped artifact. Only .env.example (placeholders) is tracked.Environment variable reference
Every variable, its default, and what it does. Unset optional variables fall back to safe defaults; the app never crashes on a missing key.
| Variable | Default | Purpose |
|---|---|---|
| AI providers: see provider configuration | ||
VERIFAIER_DEFAULT_PROVIDER | mock | default provider (mock/gemini/openai/anthropic) |
VERIFAIER_PROVIDER_MODE | mock | mock (no network) or live |
VERIFAIER_ENV | development | provider-config env; production reports missing config |
VERIFAIER_ENABLE_GEMINI/OPENAI/ANTHROPIC | false | per-provider enable flags |
VERIFAIER_PROVIDER_FALLBACKS | empty | ordered fallback chain (comma-separated) |
GEMINI_API_KEY / GOOGLE_API_KEY | n/a | Gemini key (GOOGLE_ as fallback) |
OPENAI_API_KEY / ANTHROPIC_API_KEY | n/a | provider keys (server-side only) |
GEMINI_MODEL | gemini-2.5-flash-lite | Gemini model override |
OPENAI_MODEL | gpt-4o-mini | OpenAI model override |
ANTHROPIC_MODEL | claude-opus-4-8 | Anthropic model override |
| Application | ||
APP_ENV | production | runtime environment label |
LOG_LEVEL | INFO | log level (DEBUG…CRITICAL) |
CORS_ORIGINS | ["*"] | allowed origins (JSON array), restrict in prod |
| Database | ||
DB_PATH | <root>/vailidator.db | SQLite file path (Docker: /app/data/vailidator.db) |
DATABASE_URL | unset → SQLite | optional PostgreSQL (postgresql://…) |
| Auth & sessions | ||
SESSION_SECRET | ephemeral if unset | HMAC key, required in production |
AUTH_COOKIE_NAME | vai_session | session cookie name |
AUTH_TOKEN_TTL | 28800 | session lifetime, seconds |
AUTH_COOKIE_SECURE | false | set true on HTTPS/prod |
AUTH_COOKIE_SAMESITE | lax | lax / strict / none |
| Control Center & rate limit | ||
CC_API_KEY | empty | pre-fill dashboard key field (never a real key in .env.example) |
CC_PBKDF2_ITERATIONS | 100000 | PBKDF2 iterations (OWASP min); lower only in test |
RATE_LIMIT_LOGIN_RPW | 20 | login attempts per window (per IP) |
RATE_LIMIT_LOGIN_WINDOW | 900 | login window, seconds |
| Billing (optional) | ||
STRIPE_SECRET_KEY / STRIPE_PUBLISHABLE_KEY / STRIPE_WEBHOOK_SECRET | n/a | Stripe integration (webhook 503 if secret unset) |
| Dashboards & misc | ||
API_URL | http://localhost:8000 | backend URL as seen by Streamlit (compose: http://api:8000) |
FR_SIGNING_KEY | built-in dev seed | Flight Recorder HMAC seed, set random in prod |
VERIFAIER_MEMORY_VAULT | .verifaier/memory | Memory Receipt vault root |
VAI_SERVER_VERBOSE | 0 | verbose sentinel server output |
VAI_FUJI_RPC / VAI_FUJI_PRIVATE_KEY | n/a | optional blockchain anchoring (not required) |
Provider configuration
The AI provider layer is off by default and deterministic. A live provider runs only when three conditions all hold, otherwise the router skips it and falls back to the offline mock:
env
# enable a live provider (all three required) VERIFAIER_ENABLE_OPENAI=true # 1) enabled OPENAI_API_KEY=sk-... # 2) key present (read server-side only) VERIFAIER_PROVIDER_MODE=live # 3) live mode VERIFAIER_DEFAULT_PROVIDER=openai VERIFAIER_PROVIDER_FALLBACKS=gemini # optional ordered fallback; mock is always last
- Default is
mock: deterministic, offline, zero egress, safe for local and CI. - Presence only: keys are read from the environment at call time; the config object stores boolean presence, never the value.
- Production reporting: with
VERIFAIER_ENV=production, missing required provider config is reported explicitly (without exposing values) rather than failing silently.
Full routing semantics are in the provider routing engineering doc; the key-safety model is in secret handling.