Skip to content

About

inspect eval --paranoid: tamper-evident Inspect logs, witnessed to a transparency log

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

5 Commits

Folders and files

Repository files navigation

inspect-paranoid

inspect eval --paranoid: an Inspect extension that makes eval logs tamper-evident. It never makes them tamper-proof: anyone with write access can still change a .eval file. What changes is that the edit now contradicts something the editor cannot reach, so an auditor can say which layers disagree.

It packages the .eval half of control-tower's integrity module and the ti spec (../trajectory-integrity/docs/SPEC.md) as a standalone Inspect hook. It adds two witnesses that work after Rekor v1: Rekor v2, and our own C2SP tile log in the layout Tessera writes, cosigned by tlog-witnesses.

uv add inspect-paranoid            # installing registers the hook; it is inert until enabled

# run: preflights every witness, then execs `inspect eval` with the hook required
uv run inspect-paranoid eval -w tlog:~/.local/state/inspect-paranoid/tlog -w rekor task.py --model ...

# or, without the wrapper (e.g. in .env, which Inspect loads)
INSPECT_PARANOID=tlog:./.paranoid/tlog,rekor INSPECT_REQUIRED_HOOKS=inspect_paranoid/paranoid inspect eval task.py

# audit later: exit 0 OK, 1 TAMPER, 2 GAP, 3 UNVERIFIABLE
uv run inspect-paranoid audit logs/<log>.eval -w tlog:./.paranoid/tlog -w rekor
uv run inspect-paranoid chain logs/<log>.eval     # per-sample heads and the run root
uv run inspect-paranoid tlog verify ./.paranoid/tlog --vkey <vkey> --cosigner <vkey>@<url>
uv run inspect-paranoid tlog onboard ./.paranoid/tlog --contact you@example.org   # ask public witnesses
uv run inspect-paranoid fuzz logs/<log>.eval -w tlog:./.paranoid/tlog   # what would an edit get past?

An extension cannot add a flag to inspect eval, so --paranoid is spelled inspect-paranoid eval or INSPECT_PARANOID=.... INSPECT_REQUIRED_HOOKS makes Inspect refuse to start if the package isn't installed. Without it, a missing install would silently turn paranoid mode off.

What is committed, and when

The projection is ti-inspect-v1 (projection.py), in three parts:

  • Events. Each sample event becomes one canonical JSON line, and the lines form a ti chain. This extends control-tower's v0 projection with the offered tools, tool choice, generate config, the answering model version, a hash of the raw API call, and the scorer.
  • Sample fields. One hash over everything else on the sample: scores, messages, output, input, target, metadata, store, error, limit, retries.
  • Header. One hash over the eval spec, plan, results and reductions.

The sample fields and the header are deny-lists, so new Inspect fields are covered automatically. Heads no longer match control-tower's v0 heads.

when witness session head witnesses
every sample event, as it completes <run>/<eval>/<id>/<epoch>/<attempt>/<event uuid> sha256 of its line tlog, file
sample end <run>/<eval>/<id>/<epoch> sha256(event chain head ‖ sample fields) all
run end, per task <run>/<eval> sha256(RFC 6962 root over the samples ‖ header) all

Inspect's own score-editing API (edit_score) changes committed fields after they were witnessed, so the audit reports such an edit as TAMPER. That is the correct reading: the score changed after the fact. Tags, metadata and invalidated, which the edit API records with provenance, are left out.

At run end a manifest goes beside the log as <log>.eval.paranoid (not .json, which Inspect would read as a log). It holds the heads, the root, every receipt and every publish error. It is a convenience: whoever the audit is about can rewrite it.

Streamed events cover the window a sample-end head leaves open. Without them, an attacker who kills the run mid-sample and edits the buffer faces no commitment at all. They are keyed by event uuid, not position, because hooks see events in completion order while the log stores them in creation order. Inspect emits the init span and sample_init before a hook can subscribe, so those three events per sample are covered only by the sample head. A retried attempt's events are tagged with its attempt number and excused once the log shows a later attempt.

INSPECT_PARANOID_STRICT=1 (--strict) fails closed. If the start-of-run witness check failed, or any publish for a sample failed, the sample's next model call raises a limit error, so the agent never acts on top of a history nobody witnessed. Inspect swallows every other hook exception; LimitExceededError is the one it lets through.

Witnesses

spec what it is what it is worth
tlog:<dir> our own C2SP tlog-tiles log: static files, Ed25519 signed-note checkpoints, Tessera's POSIX layout Scannable, so honest entries cannot be hidden. On its own it is worth what its key is worth. With INSPECT_PARANOID_TLOG_WITNESSES=<vkey>@<url>,..., appends ask independent tlog-witnesses to cosign, and they refuse a rewritten or forked tree. With INSPECT_PARANOID_TLOG_ANCHOR=rekor, every run end also logs the checkpoint to Rekor v2. Pin the key with INSPECT_PARANOID_TLOG_VKEY.
rekor Sigstore's public Rekor v2 (log2025-1.rekor.sigstore.dev), hashedrekord v0.0.2 entries, each with an RFC 3161 timestamp from Sigstore's TSA Public and cosigned by the witness network. Each receipt is verified offline: entry body, entry signature, log checkpoint signature against a pinned key, the inclusion proof, cosignatures from at least 2 pinned public witnesses, and the timestamp against the pinned TSA chain. Then, online, Rekor's current checkpoint must extend every receipt's checkpoint (no split view), proven from its tiles. Rekor v2 cannot be searched, so whoever can drop the receipts can hide the entries.
file:<path> JSONL Only across a trust boundary.
terminal stderr The human is the index.

Public witnesses for the tile log

Public witnesses only cosign logs they are configured for, and most configure logs from witness-network.org's lists. inspect-paranoid tlog onboard DIR --contact ... [--qpd N] [--list testing|staging] prints the log-list entry, the request to email to the maintainers (they take requests from people, not agents), and the settings to use once the log is listed. witness/public.py holds the staging witnesses and their endpoints.

The log's origin must be unique and never change, e.g. tlog init DIR --origin example.org/evals. The default inspect-paranoid/<dir> is not unique, and onboard warns about it.

Public witnesses take a fixed number of requests per day (qpd), and an eval appends to the log many times a second. So with public witnesses set INSPECT_PARANOID_TLOG_COSIGN_INTERVAL=<seconds> (onboard prints 86400 / qpd): appends ask for cosignatures at most that often, and run ends always ask. The last cosigned checkpoint is kept as checkpoint.cosigned. The audit accepts it when it covers the run and the entries rebuild to it. INSPECT_PARANOID_TLOG_QUORUM=k asks for k of the listed witnesses instead of all of them, since public witnesses do go down. inspect-paranoid tlog cosign DIR asks for cosignatures right away.

Anchoring the tile log in Rekor

A tile log with no cosigners is worth what its key is worth: steal the key, rebuild the log, and nothing contradicts you. With INSPECT_PARANOID_TLOG_ANCHOR=rekor (or rekor:<url>), each run end logs the tile log's cosigned checkpoint to Rekor v2. The receipt goes in anchors.jsonl beside the log and in the run's manifest. The audit checks every anchor it can find:

  • the Rekor receipt verifies (as above);
  • the checkpoint is signed by the pinned log key;
  • the log's entries rebuild to the checkpoint's root.

With the variable set on audit, an anchor must also cover the run. A rebuilt log then contradicts the anchor (TAMPER). If the attacker also drops every anchor, the run is UNVERIFIABLE.

The gap is re-anchoring: Rekor logs anything, so an attacker can rebuild the log and anchor it again. The audit prints when pinned witnesses vouched for each anchor (by <time>). An anchor dated well after the run is the evidence, and only someone who knows when the run happened can read it.

Rekor v1 is gone on purpose. v1 is in maintenance mode, and the logging-proxy research note (rekor-versions.agents.md) decided against keeping v1 evidence. v2 drops the search index that beacon discovery needed, which is why the tile log exists: it can be scanned like v1 could be searched, and cosigning makes up for us holding its key.

The red-team table

tests/test_redteam.py runs every attack against a real witnessed eval() (mockllm, tools, 3 samples). The attacker is host-side and can rewrite the .eval, the manifest, the file witness and the tile log on disk, including the log's signing key. It cannot rewrite what an independent witness cosigned or what Rekor holds.

attack verdict caught by
honest read-and-rewrite of the log OK (no false positive)
honest run with retries, epochs, a message limit, two scorers, the store OK (no false positive)
edit a tool result TAMPER manifest, tlog, file (sample head and the streamed event)
drop a sample TAMPER witnesses
edit, then forge the manifest to agree TAMPER witnesses only
edit, then delete the manifest TAMPER witnesses
killed before sample end (no sample heads), then edit TAMPER streamed events only
rebuild the tlog with a new key TAMPER pinned log key
rebuild the tlog with the stolen key, cosigner required UNVERIFIABLE the witness refuses to cosign the fork
rebuild the tlog with the stolen key, no cosigner OK: missed by design nothing; an uncosigned log is worth its key
corrupt an entry bundle TAMPER entries don't rebuild to the signed root
strict mode, witness unreachable sample stopped before its first model call
rebuild the tlog with the stolen key, no cosigner, anchored in Rekor TAMPER the anchored checkpoint (from anchors.jsonl or the manifest)
... and drop every anchor UNVERIFIABLE anchoring required on audit
... and anchor the rebuilt log afresh OK: missed, dated the anchor's witness time is after the run
rewrite the tlog, keep the old checkpoint.cosigned TAMPER the cosigned checkpoint is not a prefix
Rekor: altered receipt / no receipts TAMPER / UNVERIFIABLE offline proof check
Rekor: receipt on a checkpoint below the witness quorum UNVERIFIABLE pinned public witness cosignatures
Rekor: split view (receipt's tree is not a prefix of today's) TAMPER consistency proof from Rekor's tiles
Rekor: a timestamp over something else TAMPER RFC 3161 check against the pinned TSA chain

The Rekor rows run against an in-process Rekor v2 (tests/fake_rekor.py: our tile log behind Rekor's API, cosigned by fake witnesses). INSPECT_PARANOID_LIVE=1 also runs them against the real Rekor, Sigstore's TSA and the public witnesses.

Mutation fuzzing

inspect-paranoid fuzz LOG changes one field of a log at a time (every field class, plus dropping the last element of each events/messages/samples list). It writes each mutant, reads it back and audits it for real. It exits 1 if any non-volatile class gets past every layer. tests/test_fuzz.py runs it on the golden run, requires the fields that matter to be caught, and diffs every class's verdict against tests/fixtures/fuzz_baseline.json.

The fuzzer is why v1 exists. Under v0, which covered the events only, 177 of 310 classes got past every layer. That included every score, the headline metric, the sample's messages and output, the tools offered to the model, the raw call and the eval header. Under v1, 231 are caught. Of the 42 that get past every layer, the 6 usage totals are flagged by the lint, and the rest are all volatile (timings, uuids, message ids, usage copies) or invalidated. The messy honest run (retries, epochs, a limit, two scorers, the store) fuzzes the same way, with error_retries, limit and store all caught.

Not done yet

  • Actually being listed. tlog onboard prepares the witness-network.org request, but a person has to send it, from a log served at a stable origin. Until then, tests use in-process witnesses.
  • Re-anchoring (above) is dated, not caught. A deadline for anchoring, checked against a run time the attacker cannot set, would turn it into a verdict.
  • The split-view check covers Rekor only. The tile log's own checkpoints are not compared against what its witnesses publish (e.g. the Markovian witness's /checkpoints).
  • Shard rotation. The pinned Rekor shard and witness keys are as of 2026-11. A new shard's key goes in INSPECT_PARANOID_REKOR_VKEY until it is pinned. New witnesses go in INSPECT_PARANOID_REKOR_WITNESSES.
  • In-sandbox agent transcripts (control-tower's capture.py, Claude Code JSONL polled through the sandbox API) and the dual record. Those are R0 objects; this package covers the R2 .eval log.
  • eval-retry reuses an eval id under a new run id; samples carried over from the first run are witnessed under the old run.
  • Usage totals (samples[*].model_usage, stats.model_usage) are left out of the commitment as derived. The usage_mismatch lint rule checks they equal the sum of the committed per-event usage, so the fuzzer reports them as lint, not missed. It is forensic: a retry that spent tokens before failing might count toward a total with no model event left in the log. That hasn't been measured with a real provider.
  • Lint is forensic, as in control-tower: it reports findings and never raises the verdict.

Layout

merkle.py (RFC 6962/9162 trees and proofs), note.py (signed notes, checkpoints, cosignatures), tlog.py (tile log writer, reader, tlog-witness client), tilehash.py (proofs from a few tiles of a large log), timestamp.py (RFC 3161), projection.py (canonical events, ti chain, manifest), witness/ (public.py: the public witness table), hooks.py, audit.py, lint.py, cli.py.

About

inspect eval --paranoid: tamper-evident Inspect logs, witnessed to a transparency log

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages