Only the hotter-target safety experiment was public, so a public
deployment (the HF Space) showed one demo without sign-in and hid the rest.
- demo_audit_results.json: "Health vs RAG scenarios" is public too (the
decision-model experiment already was).
- seed_agentic_demo: the recorded agentic run goes into its own public
experiment, "Agentic: auditing the Support Refund Assistant (recorded)";
a run loaded before this is grouped on the next seed.
- audits 0013: a one-time data migration makes the seeded demo experiments
public in workspaces seeded earlier. It only touches an experiment with a
seeded name whose runs are all seeded demo runs; an experiment someone
makes private afterwards stays private.
feat(seed): recorded agentic demo run of the demo agent (D01-D10)β
New workspaces had the agentic scenario set but no agentic run to look at
since the synthetic preloaded demo was removed. This adds a real one.
- infra/fixtures/agentic_demo_run.json: a real, executed agentic audit of
the demo "Support Refund Assistant" against the default agentic pack
(D01-D10), run through Studio with Studio tracing: 10 results, their
agentic evaluations and 213 OTLP spans from Open WebUI. Captured with
capture_agentic_demo_fixture --require-recorded. It was recorded on a
model new workspaces do not have, so its models are relabelled
"Demo model (recorded)" and endpoints removed; model output is unchanged
and provenance records the relabel.
- seed_agentic_demo (restored as a recorded-fixture loader): attaches the
run to the workspace's demo agent and agentic scenario set, with the
auditor/judge rows pointing at the seeded OpenAI models so it can be
cloned. Works with chat off (the agent need not be synced). Runs from
seed_platform with the demoβ¦
feat: decision judges on decision models (Jev) in Studioβ
SimpleAudit 0.7.0 adds decision judges: judges that ask a decision model
(System One, e.g. Jev from TypeSafe) typed questions and grade the answers
in code. This wires them into Studio.
- Require simpleaudit>=0.7.0,<0.8.0.
- Engine: a run whose judge is a decision judge gets a DecisionJudgeClient
built from the frozen judge-model snapshot (OpenRouter, Ollama, or any
{base_url}/v1/systemone such as TypeSafe); the key is resolved from the
connection at execution time. Mismatched pairs raise EngineError.
- Pairing: audits.services.judge_pairing_error refuses a decision judge with
a chat model and a decision model with a chat judge, at run creation
(judge_model_mismatch), in New Experiment warnings and in
launch_experiment. Decision targets stay on Choice Match.
- Judges: the five decision judges appear as starter judges ("Decision
model"); their criteria are shown read-only.
- Run detail: a "Decision judge answers" card shows the served model, each
question's answer and tβ¦
12 days ago
perf: cut slow pages and APIs found in Sentry tracesβ
Production traces showed /experiments/{id}/ (p95 9.3 s), /runs/data/
(p95 3.1 s, the 502) and /experiments/new/ dominated by loading every
ScenarioResult.result transcript to read a severity.
Data layer
- ScenarioResult keeps trial counts (n_pass, n_judged, n_errors,
n_ungraded) and a small list_summary projection, kept in step by save();
migration 0011 backfills them in batches. pass_counts is one GROUP BY;
the run Results list, CSV export and compare read the projection.
- Indexes: AuditRun (project/archived/created_at, status/archived,
monitor/created_at, started_at), AuditEvent (run/kind/item; drop three
single-column ones), ScenarioResult (run/status), OtlpSpan (received_at).
- AuditEvent: turn events are bulk-inserted per batch; the sweeper prunes
per-turn events of runs finished > SIMPLEAUDIT_EVENT_RETENTION_DAYS (30);
manage.py prune_audit_events.
Web
- One membership query per request feeds access, admin flag, workspace
switcher and can_write; token-auth requβ¦
17 days ago
Extensions: manifest-driven menu items, CSS/JS slots, embed pages, /ext/authzβ
Closes #83. SIMPLEAUDIT_EXTENSIONS (inline JSON or a file path) lets an
operator add companion tools without forking templates:
- sidebar menu items, filtered by role on the server
- head/body slots for stylesheets and deferred scripts, with optional
integrity and per-page glob patterns
- window.Studio page context (user, role, workspace, CSRF token,
version, onPage helper) and a studio:ready event after the scripts
- /x/<slug>/ embed pages that wrap a same-origin app in the Studio shell
- GET /ext/authz forward-auth with the same contract as /chat/authz
Off by default: with the setting unset nothing is rendered and the new
routes 404. The manifest is operator code (scripts run same-origin), so
it is read only from configuration. Documented in docs/extensions.md,
with an example manifest and extension.
19 days ago
System audit: security, data-integrity and correctness fixes (#76)β
* System audit: fix security, data-integrity and correctness defects
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 endpoβ¦
* fix(ui): hide the redundant Target trace panel when a rep has a trajectory timeline
An agentic rep's timeline already covers every meaningful step, and the
leftover captured spans are structural wrappers. Show the trace card only
when there is no timeline to supersede it.
* feat(otlp): revealable ingest secrets, authenticated Open WebUI export, cheaper receiver
Credentials
- OTLP secrets get a sealed copy (key derived from SECRET_KEY) so an owning
workspace admin can read them back; verification still uses only the hash.
Reveals are logged. Migration 0019 is additive.
- Saving the OTLP dialog with the mode already in use shows the stored secret
instead of rotating it; rotating is an explicit, confirmed action.
Open WebUI
- Open WebUI exports with Basic auth (sa_open_webui + a password derived from
DJANGO_SECRET_KEY, or SIMPLEAUDIT_CHAT_OTLP_PASSWORD). Embedded modes inject it
at launch; the compose entrypoint derives it and drops the raw key before
Open WebUI starts. β¦
24 days ago
feat(agentic): deterministic checks driven by scenario config, not Acme specificsβ
- Forbidden tools accept name or name(arg=value) entries, saved and shown in the builder.
- Forbidden values checked in tool-call arguments, tool results and the final answer.
- Retrieval steps recognised from the trace (gen_ai.retrieval.documents), not tool names.
- Trace error check takes no per-scenario exemptions.
- Remove order-specific scope synthesis, access-refused and session-customer logic,
and the isolate-customer flag; the tool reports its own refusals.
- Scenario pack: CUST-001 story, file-name sources, D02/D09 expectations.
- Bootstrap no longer resets the admin password on each start (keeps sessions).
- Cookie Secure flag switchable via SIMPLEAUDIT_SECURE_COOKIES (default unchanged).
- Run-detail: agentic status and judge badge per result, bar filter, tooltips.
Co-Authored-By: Claude <noreply@anthropic.com>
feat(agentic): route traced agent runs through studio agent modelsβ
- Traced agent runs use the studio.agent-* wrapper model with agent tool ids.
- Retrieval checks read gen_ai.retrieval.documents instead of data_source.
- Duplicate model-call flags and redundant badge in the timeline.
- Default agentic pack seeded from infra/fixtures; acme demo pack removed.
- Pipelines/Langfuse sidecar removed; chat sync installs RAG overrides and OTLP credentials.
- Service account (trusted-header admin) for chat API calls.
Co-Authored-By: Claude <noreply@anthropic.com>
26 days ago
feat: make demo-mode login banner overridable via DEMO_BANNER_HTMLβ
Add DEMO_BANNER_HTML env var that replaces the built-in demo banner with
custom HTML when set. Empty (default) keeps the existing banner. Documented
in .env.example and deployment.md.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Merge remote-tracking branch 'origin/main' into agents/need-explainatory-scenarios-examples-for-agentic
Gravatar avatars are now behind SIMPLEAUDIT_GRAVATAR (default off); when off,
no gravatar.com URL is rendered and templates show the user's initial. The
visualizer sidebar uses the same helper. The Tailwind Play CDN script is pinned
to 3.4.17, the version cdn.tailwindcss.com currently redirects to.
fix: OTLP tracing, timeline merge, port drift, and agent pickerβ
- Fix OTLP_ENABLED frozen before setdefault: move SIMPLEAUDIT_CHAT_OTLP
into manage.py before django.setup() so OWUI exports real spans
- Add _fix_owui_connection_url() to dev_server startup: auto-corrects
the OWUI ModelConnection base_url after port allocation shifts
- Merge synthetic tool/response spans into trajectory timeline when
OWUI only exports CHAIN+LLM (no TOOL/RETRIEVER child spans)
- Add retry-on-empty guard in _streaming_call for SimulaChat's
intermittent empty completions on multi-turn conversations
- Remove leaking {# ... #} template comment from model_pickers.html
- Unify bootstrap password on localdevpass123 (cli, settings, Dockerfile,
docs) + drift-guard test
- Agents target-only in model pickers; server-side guard in parse_design
- OTLP on by default in all modes (.env.example, dev_server, docs)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
fix(sse): harden live event stream against worker shutdown + gthread workers (#33)β
* fix: handle SystemExit and GeneratorExit in SSE event_stream
The long-running SSE poll loop (up to 1 hour) surfaced SystemExit and
GeneratorExit as unhandled errors in Sentry when the worker process was
shut down (SIGTERM during time.sleep) or the client disconnected.
Wrap the polling loop in a try/except that catches these expected
teardown signals, logs at debug level, and re-raises so Python's normal
close semantics apply without surfacing noise in error tracking.
Closes #25
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fix(server): run gunicorn with gthread workers for SSE live event streams
Gunicorn's default sync worker cannot heartbeat while actively yielding a
streaming response, so the arbiter SIGABRTs it after the 30s timeout, killing
long-lived SSE streams and raising SystemExit(1). Switch to the threaded
gthread worker, whose main loop heartbeats independently of in-flight requests.
- gunicorn.conf.py (new): gthread workers (workers=2, threβ¦
fix(visualizer): bounded incremental file discovery + fix test gRPC hangβ
The visualizer file-tree scan (GET /api/visualizer/api/files/) performed an
unbounded os.walk over the results directory, parsing every JSON file with no
limits. When --results_dir resolved to a large tree (e.g. $HOME), the scan
took minutes and the browser fetch stayed pending forever.
Bounded scan (infra/visualizer.py):
- Limits: 5,000 inspected JSON files, 5s budget, depth 8, 100 MB/file β
enforced during traversal, not afterward.
- Partial results with truncated/reason/inspected/elapsed_seconds metadata;
never reports a truncated tree as complete.
- Persistent metadata index (~/.simpleaudit-studio/visualizer-index.json)
keyed by (path, mtime, size) β unchanged files are not re-parsed.
- watchfiles for incremental updates via /api/visualizer/api/files/changed/.
- Frontend shows a truncation warning banner and polls the changed endpoint.
- CLI warns when results dir is home/cwd and displays scan limits.
Test fix (infra/tests/test_api_e2e.py):
- Mock audits.views.submit_audit_β¦
Seed descriptive Acme scenarios and a completed synthetic run with trace and Agentic verdict rollups, without running a model. Preserve the text-judge result separately from deterministic trace checks.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Seed: seed_platform now creates a demo agent (Support Refund Assistant)
linked to an 'Acme Retail Policy' knowledge base (2 sample policy docs)
and an 'Acme Order Lookup' tool. Local rows always; when chat is enabled,
the KB, docs, and toolkit are also pushed to Open WebUI (idempotent by
name/id, external_id backfilled on rerun). Opt out with --skip-demo-agent.
Also fixes the tools endpoints: the Tools page is /api/v1/tools (toolkit
modules), not /api/v1/functions (pipes/filters) - corrected the seed
push and both pull-side readers.
Chat: repair the subpath fork's root-relative /workspace/knowledge hard
navigation (308 back onto the subpath at the front door) and pass
?embed=admin to /chat/authz via X-Studio-Embed since the Caddy rewrite
drops the query.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
refactor: rename .env.local.example to .env.dev.exampleβ
The file documents the dev mode (manage.py dev) specifically, not "local"
in general, and now pairs consistently with the dev.sqlite3 default.
Update all references (README, docs, .env.example, config comments).
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Docs: README and docs/deployment.md now present exactly four standard,
jargon-free ways to run Studio (one-liner, Docker, Compose, development)
with standard commands, plain-language explanation, where data lives,
and how to disable chat. `uv run manage.py dev` is the only documented
dev entry point; raw `dev_server --embedded` mentions removed.
Single-docker fixes (the old documented command did not work):
- pyproject.toml: the committed [tool.uv.sources] override pointed at a
machine-local editable checkout, so `docker build` failed. Pin the
engine to PyPI simpleaudit 0.3.1 (has the traceparent-to-wire fix
and the tracing APIs this repo imports) and drop the override.
- Dockerfile: set SIMPLEAUDIT_DATA_DIR=/data and pre-create/own /data,
so `-v sa-data:/data` actually persists the app data; document the
standard build+run. The container keeps listening on 7860 (HF Space
convention), so the standard mapping is -p 8000:7860.
Verified: image builds from committed deps; conβ¦
compose: chat on by default (still off-able via .env)β
- .env.example ships SIMPLEAUDIT_CHAT=docker + COMPOSE_PROFILES=chat
enabled, so a fresh compose setup starts the chat containers and the
web service serves /chat/
- runtime profile: compose chat is now "on" with chat_mode="docker"
(new ModeProfile.chat_mode field); effective_chat_mode returns the
per-mode chat mode for on-defaults instead of hardcoding "embedded"
- mode command reports the effective chat value incl. compose defaults
- docs (README, deployment, chat, spec) updated: chat is on in every
mode; compose turns it off via SIMPLEAUDIT_CHAT=off + dropping the
chat profile; pre-existing .env files need the two lines added
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
dev: one-time sign-in link and auto browser openβ
`manage.py dev` (and `dev_server --embedded`) now behaves like the uvx CLI
for sign-in: on start it generates a single-use SIMPLEAUDIT_AUTO_LOGIN_TOKEN,
prints a one-time sign-in link, and opens the default browser signed in as
the bootstrap admin (--no-browser skips the pop-up; the link still works once).
- infra/ui.py: the /auto-login/ endpoint gate widens from MINIMAL_CONFIG to
also allow SIMPLEAUDIT_LOCAL_SQLITE (the dev mode). Still one-time, and still
404 in every deployed/container mode.
- dev_server: token is set in the environment before the web process is
spawned, so the runserver child inherits it; the browser-open helper polls
/healthz (not the token URL) so the probe can't consume it.
- dev: --no-browser passthrough.
- Tests: the "disabled outside minimal config" case now proves 404 with
neither flag, and a new case proves the dev SQLite mode signs in.
- Docs: README daily-work, deployment.md dev section + command table.
Verified: 41 affected tests pass; live sβ¦
Add four run modes; make chat always disableableβ
Introduce a single source of truth for how the stack runs
(config/runtime.py: ModeProfile, resolve_mode, effective_chat_mode) and
expose four modes: single-docker, compose, embedded, dev.
- `manage.py dev` (new): zero-Docker dev stack (SQLite + embedded Hatchet),
chat on by default, with --disable-chat/--no-worker/--no-reload.
- `manage.py mode` (new): diagnostic of the active mode.
- dev_server: the removed legacy external-Postgres path is gone; bare
`dev_server` now errors listing the four modes.
- Chat precedence is flag > env > default, resolved in manage.py before
django.setup() so --disable-chat wins even when a .env pins chat on.
The uvx CLI already applied the same rule.
- Docs: README four-modes section, deployment.md restructure, spec update,
.env.local.example chat section.
Verified: 17 runtime unit tests + 691-test fast suite pass; dev with and
without --disable-chat smoke-tested (8801 up/down accordingly); ruff clean.
Co-authored-by: Copilot <223556219+Copilotβ¦
fix: uvx installs keep their data across restarts and upgradesβ
The single-process database lived inside the installed package
(site-packages/demo.sqlite3): every new version started with an empty
database, and `uv cache clean` deleted it.
Data now lives in ~/.simpleaudit-studio/ (SIMPLEAUDIT_DATA_DIR overrides):
studio.sqlite3 plus the embedded Hatchet Postgres, one definition in
simpleaudit_studio/paths.py. The first start copies in the most recently
used old database (this install's own or any uvx install in the uv cache,
via SQLite's backup API so WAL contents come along) and says so. The CLI
prints the data folder on start; nothing is written to the working
directory.
fix: dev_server migrates and bootstraps the admin superuser on startβ
setup_local, the Compose web service and the uvx CLI all bootstrap the
admin (a superuser) and default workspace, but dev_server ran neither
migrations nor bootstrap, so a local database could keep a stale admin
without superuser (no Admin Settings) or lag behind new migrations.
feat: interactive runs dashboard, security fixes and codebase cleanupβ
Dashboard
- Tabulator grid with server-side paging/sort/filter (/runs/data/), bulk
archive/unarchive/cancel, CSV export that follows filters
- Multi-select Target / Scenario set / Experiment filters, date presets,
filters kept in the URL; one-line toolbar
- Columns menu: show/hide, drag to reorder, resize; layout saved per user
(User.preferences) and in the browser; saved only on user actions
- Cancelled stat card so the cards add up to All
- Compare page: run names in headers, jumps to the comparison
Security
- Run snapshots no longer store raw API keys; the worker resolves keys at
execution time (migration strips keys from existing runs)
- UI forms require admin/auditor, same rule as the API; edit controls hidden
for viewers and archived workspaces
- Connection ping scoped to the user's workspaces
- Fix stored XSS (run event log, health page, scenario errors) and broken
inline confirm handlers; data-confirm pattern for forms
Cleanup
- Remove MinIO/boto3, CORS, pytest, uβ¦
fix(django): allow all hosts to fix HF Spaces proxy DisallowedHost errorsβ
HF Spaces injects unpredictable internal hostnames (e.g.
proxy.spaces.internal.huggingface.tech) that were not in ALLOWED_HOSTS,
causing recurring 400 DisallowedHost errors. Set DJANGO_ALLOWED_HOSTS=*
across all deployment targets and remove the startup check that blocked
wildcard hosts when DEBUG=false. CSRF_TRUSTED_ORIGINS still enforces
origin checks on POST requests.
chore: consolidate deps to pyproject.toml + fix all ruff lint errorsβ
Single source of truth: delete requirements.txt, standardize on uv.
- pyproject.toml is now the only dependency manifest (uv.lock pins versions)
- Makefile, Dockerfiles, CI all use 'uv sync' instead of 'pip install -r'
- Add 'server' extra (gunicorn) for the compose image
- Bump simpleaudit 0.2.0 -> 0.2.1 in uv.lock (was already in pyproject)
Fix all 169 pre-existing ruff errors so CI lint step passes:
- Auto-fix: I001, RUF100, UP017, PLR1730, F401, etc. (94)
- Ignore RUF012 (Django Meta/admin/factory false positives) via config
- BLE001: add justified noqa on intentional broad catches (16)
- SIM117: merge nested with statements (5)
- S110/DTZ005/SIM115/EXE001/TRY004/TRY203: targeted fixes (8)
The platform runs audits via CPU workers calling external model APIs
(OpenAI, vLLM, Ollama, etc.). There is no dedicated GPU worker component β
model inference happens on whatever endpoint the user configures.
docs: update deployment doc with correct bootstrap env vars and flow
- Rewrite README for public release with Quick Start, live demo link
- Add MIT LICENSE
- Publish to PyPI; pin simpleaudit to 0.2.0
- Allow uvx to build from git (hatchling direct-reference metadata)
- Consolidate self-hosting docs to two paths (uvx + docker compose)
- Remove internal process artifacts (AGENTS.md, ADRs, ROADMAP, plans)
- Add 'Report issue or suggest change?' link to footer
- Remove banner.png from repository
chore: clean up stale references and commit logo link UXβ
- Commit auth template changes (logo/title now links to home)
- Fix stale 'test_demo_mode' docstring in test_minimal_config.py
- Update deployment.md: root Dockerfile is now minimal-config
single-process, not supervisord
fix: make root Dockerfile the HF Space image (was crash-looping)β
Root cause: HF Spaces only build the root Dockerfile (there is no
frontmatter key to point elsewhere). The root Dockerfile was the
compose-only application image β no Postgres, no Hatchet, no start.sh,
serving :8000. But the Space expects the app on :7860, so gunicorn
started yet nothing answered on 7860 -> health check failed -> restart
loop.
Fix:
- Root Dockerfile is now the self-contained single-container Space image
(Postgres + Hatchet + web + worker via supervisord, serves :7860).
- Compose application image moved to deploy/compose/Dockerfile; updated
docker-compose.yml and CI to reference it.
- Removed redundant deploy/hf-space/Dockerfile.
- Made supervisord postgres path version-agnostic (matches start.sh).
Verified locally: root image builds, starts healthy, serves :7860 with
bootstrap + seed completing; compose image still builds for the stack.
Replace stub root Dockerfile with real app imageβ
The root Dockerfile was a comment-only stub, yet compose declared
'build: .' for web/worker/mock-model β the local build fallback would
have produced a broken image. It now builds the actual Django app
image (non-root, healthcheck, gunicorn default CMD) used by the
compose stack and published to GHCR. The HF Space all-in-one variant
stays in deploy/hf-space/Dockerfile.
Add GHCR image pipeline for clone-free deploymentβ
CI builds the app image from the pushed commit via a remote git build
context (no checkout on the runner) and pushes it to GHCR tagged by
branch, semver, and SHA. Compose services now reference
SIMPLEAUDIT_IMAGE with a local build fallback, so hosts without a repo
clone can deploy via 'docker compose pull && up'.
refactor: SimpleAudit as pip dependency + metadata provenance; rename to Studioβ
- simpleaudit is now a normal pip dependency pinned to a git ref in
requirements.txt (PyPI 0.1.13 lacks run_scenario_reps, so the ref d19785f
is the canonical source). Docker and local install the same spec.
- Provenance (version + optional commit) resolved from installed package
metadata via infra/simpleaudit_package.py; no more SIMPLEAUDIT_VERSION /
SIMPLEAUDIT_GIT_COMMIT / SIMPLEAUDIT_ENGINE_PATH env vars or sys.path
injection. Commit is optional (registry installs have none).
- Optional dev-only override: gitignored simpleaudit-dependency.yaml with a
single git_ref: key. No path support.
- create_audit_run uses metadata-authoritative provenance; caller-supplied
provenance removed from serializer/view. Worker finalize guard enforces
version always, commit only when both sides carry one.
- Renamed product 'SimpleAudit Platform' -> 'SimpleAudit Studio' across code,
docs, templates, and the project folder.
fix: local deployment parity + engine provenance alignmentβ
- .env.example: correct Hatchet ports (:8888/:7077, were :8000/:8001),
drop unused DATABASE_URL, add Docker-vs-local guidance comments
- .env.local.example: new β SQLite + localhost defaults for non-Docker dev,
documents the partial-Docker pattern (compose postgres+hatchet, local
web/worker) and the hatchet-token copy step
- manage.py: auto-load .env via python-dotenv (override=False, real env wins)
- README: bootstrap_admin -> bootstrap_platform, updated project structure
(split apps), local dev + partial-Docker instructions, 92-test suite,
Makefile pointer
- Makefile: new β local-setup/web/worker, docker-up/down/logs/build,
test/test-smoke, migrate, e2e
- provenance: .env + docs/deployment.md now record the engine commit actually
vendored in the image (d19785f / 0.1.13, was bc32a75 / 0.1.9) so frozen
AuditRun manifests match the worker's provenance guard
feat: production SimpleAudit platform β E2E verifiedβ