guide
Production hardening
You've deployed (the deployment doc covers the Fly.io mechanics). This is the checklist for making that deployment safe — secrets, data posture, and the operational knobs that matter once real traffic and teammates arrive. Self-hosted; nothing phones home.
Secrets
Generate high-entropy values (openssl rand -hex 32), never passphrases; set them via your platform's secret store. EVALS_ENCRYPTION_SECRET must be ≥32 characters. BASIC_AUTH_PASSWORD is deprecated and ignored — unset it.
| Variable | Needed for | If unset |
|---|---|---|
| DATABASE_URL | everything | app won't start |
| BETTER_AUTH_SECRET | user sessions | dev fallback used — set it in prod |
| BETTER_AUTH_URL | auth callbacks on a hosted domain | redirects target the wrong origin |
| EVALS_ENCRYPTION_SECRET | LLM-as-judge evals (encrypts BYO keys) | evals stay disabled — no plaintext fallback |
| SMTP_URL / SMTP_FROM | emailing alerts & digests, invitation links, and email verification before invitations can be accepted | stored in-app only; an unverified address can accept an invitation |
The checklist
- Claim the first account immediately
- Until someone signs up, anyone with the URL can register and become instance owner. Open /sign-up right after the first deploy. Ingestion stays API-key-authenticated regardless.
- Rotate secrets deliberately
- Rotating BETTER_AUTH_SECRET signs everyone out (the lever for session compromise). For EVALS_ENCRYPTION_SECRET, move the old value to _PREVIOUS, re-save each LLM connection, then drop _PREVIOUS — no stored keys lost.
- Decide your data capture
- Traces hold prompts and completions. OTel instrumentations don't capture content by default — leave it off if you don't need bodies. Usage events are metadata-only (coarse hashed IPs); raw events prune on a 30-day default window.
- Back up Postgres
- It's the entire system of record. Migrations apply at boot, so restore + redeploy is self-contained. Nothing phones home — all data stays on your infrastructure.
Operational flags
| KEY_MONITOR_SCHEDULER=0 | Disable the whole pg-boss scheduler (all queues) — for one-off scripts / CI. |
| EVAL_SCHEDULER=0 | Disable only the online-evals schedule and alert-delivery queues (Story D judge-batch workers still run). |
| ALERT_WEBHOOK_ALLOW_LOCALHOST | Leave UNSET in production — it only exists to test localhost receivers (it also governs A2A push URLs) and reopens the SSRF hole the egress guard closes. |
| LLM_BASE_URL_ALLOW_LOCALHOST | Leave UNSET in production — it only exists to test a local model on localhost for LLM-judge connections, and is separate from the webhook switch. |
| RUN_MIGRATIONS=1 | Applies pending migrations at boot (set in fly.toml); makes deploys self-contained. |
The scheduler is safe to run on every instance in a multi-instance deploy — pg-boss coordinates through Postgres, so each job runs once, not once per instance.