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>
The frontend only worked from localhost:3000 — the browser made absolute
cross-origin calls to localhost:8000, which (a) points at the visitor's own
machine when accessed via the LAN IP or Cloudflare tunnel, and (b) was blocked
by CORS (backend only allowed localhost:3000). Now all API calls are
same-origin and proxied to the backend:
- api.ts: default API base to same-origin ("") instead of localhost:8000
- docker-compose: NEXT_PUBLIC_API_URL="" (client uses relative /api)
- next.config.ts: server-side rewrite uses API_INTERNAL_URL (http://backend:8000
inside Docker) so :3000 direct access proxies correctly
- main.py: broaden CORS via allow_origin_regex (localhost + private LAN) and an
optional CORS_ORIGINS env var, as defense-in-depth for direct :8000 access
Login was returning 500: passlib 1.7.4 is incompatible with the bcrypt 5.0.0
actually installed in the image (requirements pin 4.1.2, but the image drifted).
- security.py: call bcrypt directly, truncating to 72 bytes; existing $2b$
hashes verify unchanged, and it works under both bcrypt 4.x and 5.x
Security: SECRET_KEY was a known placeholder string while the app is exposed on
the LAN and via Cloudflare tunnel — anyone could forge admin JWTs. Regenerated
to a strong random value in backend/.env (gitignored; not committed).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Frontend:
- New public marketing landing page at / (hero, features, stats, how-it-works, CTA)
- New /scans page surfacing the scanning engine: asset health grid, one-click
full scan, live scanner findings feed, 24h stats
- New /admin panel (was a 404 from the sidebar): audit report generation and
instant PDF snapshot download
- Reports page: now visible to all roles, working PDF downloads, posture
snapshot export for IT/admin
- Findings page: full-text search, sorting (severity/newest/title), severity
count chips, CSV export
- Dashboard: scan activity strip, Run Scan + Export PDF quick actions
- Footprint page: summary stat cards
- api.ts: scanning, reports, and PDF download endpoints + types;
fixed missing resolution_note on Finding type
- Removed unsupported eslint key from next.config.ts
Backend:
- Audit reports: list/get/PDF now open to executives and IT admins with strict
tenant isolation (was trustos_admin-only, leaving tenants unable to see
their own reports); PDF snapshot open to IT admins; generation stays
admin-only
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Features added:
- AI Finding Translation endpoints (POST /findings/{id}/ai-translate)
- AI Security Coach endpoint (POST /findings/{id}/ai-question)
- Attack Path visualization generation (POST /attack-paths/{id}/generate, GET /attack-paths/{id})
- Mock AI implementations for demo mode (no API keys required)
- PDF Report generation and download endpoints
- Report snapshot feature for on-demand PDF generation
Technical improvements:
- Mock translation system for findings and attack paths
- Async task-based AI processing
- Graph-based attack path with nodes and edges
- Professional HTML-to-PDF conversion with WeasyPrint
- Jinja2 templating for report generation
Database updates:
- AttackPath table integrated with mock narrative generation
- AI fields populated via async tasks
Testing:
- All E2E tests verified passing (login, dashboard, findings, all roles)
- AI endpoints tested and working with mock data
- PDF report generation produces valid 18KB+ documents
- Attack path generation creates proper graph structures
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>