Repository navigation
System audit: security, data-integrity and correctness fixes - #76
Conversation
Iterative audit (32 passes) of the whole system; every confirmed defect is fixed with a regression test. Findings, evidence, open owner decisions and continuation steps are in Audit.md. Highlights: - Secrets: connection keys can no longer name platform secrets or be sent to a host other than the one they were resolved for; the Open WebUI admin token only goes to Studio's own Open WebUI; embedded Open WebUI no longer inherits Studio secrets; auth tokens are revoked on password change. - Authorization: workspace-scoped role checks on experiment visibility, agents/KB/tools API, connections, OTLP credentials, run cancel and monitor run-now; stale sessions lose access to removed workspaces; visualizer API requires login; public run pages hide endpoint URLs. - Run integrity: conditional cancel/fail/finalize, no downgrade of completed results, per-run auditor dispatch for concurrent runs, frozen agent endpoint snapshots, per-rep/per-attempt trace correlation, judge params no longer inherit target defaults, repeated-run exports. - Data integrity: scenario revert/publish pins revisions, stale-form guards for scenarios and judges, cross-set delete, import validation, field-length caps for Postgres, CLI mock mode no longer rewrites or wipes user connections. - UX/a11y, input validation (500s on malformed input), docs/env examples. Tests: 1448 -> 1589 passing; ruff clean; no migrations.
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
ba026a1 to
b5f1d1c
Compare
…peated runs Found while running real audits against a live model: the canonical export names scenarios by key, and repeated runs had no summary in JSON/CSV.
Found in live agent audits: the export counted only the modal rep's tokens, under-reporting what repeated runs actually used.
Live verification against a real modelThe branch was tested end to end against a live OpenAI-compatible endpoint. Model Chat-target audits
Agents (base model
|
| Run | Outcome |
|---|---|
| Untraced agent | Completed. The persona from the agent's system prompt was applied, an internal code was never leaked, and the frozen snapshot points at the live endpoint. |
| Traced agent (studio mode, via Open WebUI) | Completed. Each scenario recorded its own trace, with OTLP spans exported by Open WebUI. Persona applied, no leak. |
| 3-repetition agent run | Completed; all surfaces agree. |
The run, result, agent, connection and dashboard pages all returned 200, as did the JSON, CSV, HTML and script exports.
Defects found by the live runs (fixed in this PR, each with a test)
- HTML export labels: scenarios were labelled with engine keys instead of titles (
164360c). - JSON/CSV summary: repeated-run exports had an empty summary; they now use the modal rep's summary (
164360c). - Token usage: the canonical export counted only the modal rep's tokens for repeated scenarios; it now sums every rep (
02f6207).
Checks: uv run pytest -m "not embedded_hatchet" gives 1596 passed, 3 skipped. uv run ruff check . is clean.
Setup note: an OTLP credential is created when the first agent is synced, but only if SIMPLEAUDIT_CHAT_OTLP is on in that process. The dev server turns it on; a bare manage.py shell needs it set.
What
An iterative, end-to-end audit of the whole system: 35 passes, roughly 200 confirmed defects fixed, each with a regression test.
Why
The audit covered security, authorization, data integrity, run correctness, input validation and UX. Earlier passes fixed Critical and High issues; later passes were mostly Medium boundary and stale-form issues.
Highlights
spin --mockno longer rewrites or wipes user connections;Review notes
infra/engine.py,infra/worker.py,infra/trace_target.py), and the worker doesn't hot-reload. Restart it when no audit is running.Checks
uv run pytest -m "not embedded_hatchet": 1592 passed, 3 skipped. One timing test (test_time_budget_truncates) is flaky under-n autoand passes alone.uv run ruff check .: clean.makemigrations --check: no changes.