Trace-native CI/CD for AI agents — production failures become regression tests that block the PR. Auto-detect, cluster, freeze into hermetic cases, replay in CI for $0.
Python agentagent-observabilityai-agentsci-cdclickhouseevalsevaluationllmllm-as-judgellm-evaluationllm-observabilityllm-opsllmopsmcpmonitoringopentelemetrypythonself-hostedtracing
feat(audits): list the tools on a real machine
Wuthrich Juliendac7f3a996f5
diff --git a/backend/tests/test_assistant_tools.py b/backend/tests/test_assistant_tools.pyindex bdab5b2..eb149c8 100644--- a/backend/tests/test_assistant_tools.py+++ b/backend/tests/test_assistant_tools.py@@ -290,6 +290,7 @@ async def test_the_assistant_builds_an_audit_end_to_end(client, audits_db, make_catalog = await t["audit_catalog"].ainvoke({})assert "sycophancy" in {p["key"] for p in catalog["presets"]} and catalog["variation_axes"]+ assert "bash" in catalog["packs"]["dev"] and "refund_issue" in catalog["packs"]["support"]made = await t["create_audit"].ainvoke({"preset": "sycophancy", "target_model": "openai/gpt-4o-mini"})assert made["name"] and made["seeds"] >= 1 and made["link"] == f"/audits/{made['id']}"diff --git a/backend/tracely/domain/audit/brief.py b/backend/tracely/domain/audit/brief.pyindex 60b29eb..e653996 100644--- a/backend/tracely/domain/audit/brief.py+++ b/backend/tracely/domain/audit/brief.py@@ -72,7 +72,7 @@ def catalog_brief(catalog: dict) -> dict:"variation_axes": catalog.get("variations") or [],"extra_dimensions": [d["name"] for d in catalog.get("behaviours") or []],"real_machine": catalog.get("sandbox") or {"available": False},- "packs": ["dev", "office", "support", "data", "devops"],+ "packs": {k: [t["name"] for t in v] for k, v in (catalog.get("packs") or {}).items()},}diff --git a/backend/tracely/domain/audit/dimensions.py b/backend/tracely/domain/audit/dimensions.pyindex c831eaa..1cd15bf 100644--- a/backend/tracely/domain/audit/dimensions.py+++ b/backend/tracely/domain/audit/dimensions.py@@ -289,7 +289,7 @@ PRESETS: list[dict] = [def catalog() -> dict:"""What the Audits UI offers when creating an audit."""- from tracely.domain.audit import library, seeds+ from tracely.domain.audit import library, seeds, toolingreturn {"validity": VALIDITY_DIMENSIONS,@@ -297,4 +297,5 @@ def catalog() -> dict:"presets": PRESETS,"library": {"petri": {"seeds": len(library.petri_seeds()), "tags": library.petri_tags()}},"variations": [{"name": k, "description": v} for k, v in seeds.VARIATIONS.items()],+ "packs": tooling.pack_listing(),}diff --git a/backend/tracely/domain/audit/tooling.py b/backend/tracely/domain/audit/tooling.pyindex 3fbed95..af9cabc 100644--- a/backend/tracely/domain/audit/tooling.py+++ b/backend/tracely/domain/audit/tooling.py@@ -120,6 +120,21 @@ def pack_tools(names: list[str], taken: set[str], images: bool = False) -> list[return out+def pack_listing() -> dict[str, list[dict]]:+ """What each pack hands the target, for the create form and for agents: every tool's name,+ its arguments (`?` marks an optional one) and its description — exactly what the target sees."""++ def row(tool: dict, note: str = "") -> dict:+ params = tool["parameters"]+ required = set(params.get("required") or [])+ args = [k if k in required else f"{k}?" for k in params.get("properties") or {}]+ return {"name": tool["name"], "args": args, "description": tool["description"] + note}++ out = {name: [row(t) for t in tools] for name, tools in PACKS.items()}+ out["dev"].append(row(VIEW_IMAGE, " Offered only to a model that takes images."))+ return out++def resolve(path: str, cwd: str, home: str) -> str:"""An absolute, normalised path for what the target typed (`~`, relative, `..`)."""path = (path or "").strip()diff --git a/docs/pages/product/audits.mdx b/docs/pages/product/audits.mdxindex cf082e7..a26a8de 100644--- a/docs/pages/product/audits.mdx+++ b/docs/pages/product/audits.mdx@@ -38,6 +38,8 @@ On a real machine you choose **what is on it**. Each pack is a set of real tools| Data | a SQL warehouse || DevOps | services, deploys, CI runs, a secrets vault |+The exact tools are listed in the app: when you pick **A real machine** in the form, and under an audit's **Settings**, **What's on the machine** shows every tool with its arguments and description, as the target sees them.+The attacker can also give the target a tool of its own with a small program behind it, so that tool really executes too.A real machine removes the easiest way for a model to notice a test: tool results that are too tidy, or that contradict each other. By default the box has no network; **Web access through an allowlist** lets it read package registries and documentation through a proxy that logs each request and refuses everything else. It runs as an unprivileged user, and is destroyed when the rollout ends. It is available when the deployment has a sandbox configured (`SANDBOX_BACKEND`); see the note in `docker-compose.sandbox.yml` before enabling it on a shared host.diff --git a/frontend/app/components/AuditDetail.tsx b/frontend/app/components/AuditDetail.tsxindex 793db98..a56ef71 100644--- a/frontend/app/components/AuditDetail.tsx+++ b/frontend/app/components/AuditDetail.tsx@@ -14,6 +14,7 @@ import {type AuditRun,type AuditSeed,} from "@/app/lib/audits";+import { PackTools } from "./PackTools";import { TimeAgo } from "./TimeAgo";import { Toggle } from "./Toggle";import { Badge } from "./ui";@@ -399,6 +400,10 @@ export function AuditDetail({ audit, catalog }: { audit: Audit; catalog: AuditCa? `a real machine (${(audit.config.environment.packs ?? ["dev"]).join(", ")})` +(audit.config.environment.network === "allowlist" ? ", allowlisted web access" : ", no network"): "the attacker invents tool results"}+ {audit.config.environment?.mode === "sandbox" && (+ <PackTools packs={audit.config.environment.packs ?? ["dev"]}+ network={audit.config.environment.network === "allowlist"} catalog={catalog} />+ )}</Setting>{(audit.config.attacker.media?.length ?? 0) > 0 && (<Setting k="Attacker can send">{audit.config.attacker.media!.map((m) => (m === "voice" ? "voice messages" : "images")).join(", ")}</Setting>diff --git a/frontend/app/components/AuditsManager.tsx b/frontend/app/components/AuditsManager.tsxindex bef9d43..032e877 100644--- a/frontend/app/components/AuditsManager.tsx+++ b/frontend/app/components/AuditsManager.tsx@@ -14,6 +14,7 @@ import {type TargetTool,} from "@/app/lib/audits";import { listJudgeModels, type JudgeModelOption } from "@/app/lib/evaluators";+import { PackTools } from "./PackTools";import { Toggle } from "./Toggle";import { Badge } from "./ui";import { IconChevron } from "./icons";@@ -368,6 +369,7 @@ function NewAuditForm({)}</div>)}+ {sandbox && canSandbox && <PackTools packs={packs.length ? packs : ["dev"]} network={network} catalog={catalog} />}</Opt><Opt label="Attacker can send" hint="The model under test must accept images or audio, or the run is refused.">diff --git a/frontend/app/components/PackTools.tsx b/frontend/app/components/PackTools.tsxnew file mode 100644index 0000000..b075ee7--- /dev/null+++ b/frontend/app/components/PackTools.tsx@@ -0,0 +1,39 @@+import { PACKS, type AuditCatalog } from "@/app/lib/audits";+import { IconChevron } from "./icons";++/** What a target on a real machine can actually do: every tool of the chosen packs, with the+ * name, arguments and description the target itself is given (`catalog.packs`). */+export function PackTools({ packs, network, catalog }: { packs: string[]; network: boolean; catalog: AuditCatalog }) {+ const chosen = PACKS.filter((p) => packs.includes(p.key) && catalog.packs?.[p.key]?.length);+ if (!chosen.length) return null;+ const count = chosen.reduce((n, p) => n + catalog.packs![p.key].length, 0);+ return (+ <details className="group/tools mt-2">+ <summary className="flex cursor-pointer list-none items-center gap-1.5 text-[12px] text-fg-faint transition-colors hover:text-signal">+ <IconChevron className="h-3 w-3 transition-transform group-open/tools:rotate-90" />+ What's on the machine · {count} tools+ </summary>+ <div className="mt-2 space-y-3 rounded-lg border border-line px-3 py-3">+ <p className="text-[12px] leading-relaxed text-fg-muted">+ A Linux box the target works on as an ordinary user. The default image has Python 3.12, git, curl, jq,+ ripgrep, sqlite3, pytest, pandas and numpy. {network ? "Web access only to allowlisted hosts, through a logging proxy." : "No network."}{" "}+ It is destroyed when the rollout ends. The attacker fills it with files and data before the target's first turn.+ </p>+ {chosen.map((p) => (+ <div key={p.key}>+ <div className="font-mono text-[10px] uppercase tracking-wider text-fg-faint">{p.label}</div>+ <ul className="mt-1 space-y-1">+ {catalog.packs![p.key].map((t) => (+ <li key={t.name} className="text-[12px] leading-snug">+ <code className="font-mono text-fg">{t.name}</code>+ <code className="font-mono text-fg-faint">({t.args.join(", ")})</code>+ <span className="text-fg-muted"> — {t.description}</span>+ </li>+ ))}+ </ul>+ </div>+ ))}+ </div>+ </details>+ );+}diff --git a/frontend/app/lib/audits.ts b/frontend/app/lib/audits.tsindex 2fde844..2455649 100644--- a/frontend/app/lib/audits.ts+++ b/frontend/app/lib/audits.ts@@ -224,6 +224,8 @@ export type AuditCatalog = {library?: { petri: { seeds: number; tags: { tag: string; count: number }[] } };// The axes a seed can be varied along.variations?: { name: string; description: string }[];+ // Every tool of each pack as the target sees it; a trailing `?` marks an optional argument.+ packs?: Record<string, { name: string; args: string[]; description: string }[]>;};/** The tool packs a sandboxed target can be given, in the order the form lists them. */