The Anthropic path could never activate: it gated on
`not ANTHROPIC_API_KEY.startswith("sk-ant-")`, but real Anthropic keys start
with `sk-ant-`, so any real key was treated as a placeholder and every request
fell back to mock. It also targeted the retired `claude-3-haiku-20240307`.
- ai_translator.py: add `_real_key()` placeholder detection (rejects `sk-ant-...`,
`changeme`, `your-`, etc. — accepts real secrets), centralize provider gating
in `_ai_enabled()`, and point all three AI features (finding translation,
security coach, attack-path narrative) at `claude-sonnet-5` with thinking
disabled for fast structured output. OpenAI kept as a secondary provider.
- config.py / .env.example: default AI_PROVIDER to anthropic.
Mock mode still works with no key configured; dropping in a real
ANTHROPIC_API_KEY now actually enables live Claude.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
30 lines
824 B
Plaintext
30 lines
824 B
Plaintext
# Database
|
|
DATABASE_URL=postgresql+asyncpg://trustos:trustos_dev@postgres:5432/trustos
|
|
SYNC_DATABASE_URL=postgresql://trustos:trustos_dev@postgres:5432/trustos
|
|
|
|
# Auth
|
|
# IMPORTANT: Generate a secure random key in production using: openssl rand -hex 32
|
|
# Never use the default value in production environments
|
|
SECRET_KEY=changeme-use-openssl-rand-hex-32-in-production
|
|
ACCESS_TOKEN_EXPIRE_MINUTES=480
|
|
|
|
# AI — defaults to Anthropic/Claude (model: claude-sonnet-5).
|
|
# Leave the placeholders as-is to run in mock mode (all AI features return
|
|
# canned demo responses). Drop in a real key to enable live AI.
|
|
AI_PROVIDER=anthropic
|
|
ANTHROPIC_API_KEY=sk-ant-...
|
|
OPENAI_API_KEY=sk-...
|
|
|
|
# External APIs
|
|
HIBP_API_KEY=
|
|
NVD_API_KEY=
|
|
|
|
# Storage
|
|
STORAGE_PATH=/app/storage
|
|
|
|
# Email (optional)
|
|
SMTP_HOST=
|
|
SMTP_PORT=587
|
|
SMTP_USER=
|
|
SMTP_PASS=
|