Skip to main content

schemabrain audit

The CLI surface for the tamper-evident audit chain. Two subcommands:
  • audit list — read recent rows, with optional filters.
  • audit verify — re-walk the chain and report mismatches.
The same data is rendered visually in the Audit Viewer dashboard surface.

list

List recent mcp_audit rows with optional filters. Two output modes: rich-formatted table (default) or JSON Lines.

Examples


verify

Re-walks the chain hash for every row and reports mismatches. The fast yes/no integrity check operators run before trusting the audit log.

How verification works

For every row, verify recomputes chain_hash from the previous stored chain_hash plus the canonical bytes of the current row, and compares against the stored value:
A ChainMismatch is reported for every row where recomputed ≠ stored. With --full, all mismatches are collected; without it, the walk stops at the first. --since is the operator’s tool when a known-good chain head has been archived externally (a CI artifact, a nightly backup, a cron-emailed head hash). Walk only rows after that anchor — fast on stores with millions of rows.
Rows at or before the --since cursor are not verified. If an attacker tampered with a row before the cursor, a since-cursor walk will not catch it. Run an occasional full walk (or compare your archived head hash against the store’s current head hash) to close that window.

Examples


Manual tamper demo

For a hands-on walk-through of how a forged row breaks verify, see audit-chain — Verify it yourself.

Tamper-evident audit chain

The mechanism this CLI surface reflects.

Audit Viewer dashboard

Visual rendering of the same chain.

schemabrain tail

Live event stream from a running serve process.

Observability

Where audit rows fit in the event-bus substrate.