§08 · Audit-export documentation

What an audit-export evidence pack actually contains.

The audit-export endpoint mints a signed PDF and a review-ready Excel workbook covering the evidence your workspace produced. This page describes the scope across the Evidence Pilot, Regulated Team, and Enterprise paths, plus the verification procedure outside counsel or a regulator can run on receipt.

Quick read

Explain this simply

The short version: this is a signed export of recorded workspace evidence. The PDF is built for receipt verification; the Excel workbook is built for review and traceability.

  1. What is in the file?

    The export covers records that were recorded in the selected window. It does not add events that were never recorded, or records outside that window. Start with the sample walkthrough →

  2. What controls the coverage?

    Your workspace tier controls which of the five named event categories can appear. See the tier matrix → Read the category definitions →

  3. How do you check the result?

    Included records carry the signed and file-integrity details described in the verification section. For a concrete example, follow the sample decision, chain and reviewer note examples.

Export evidence pack

Download a review-ready Excel workbook.

Sign in to choose one of your owned models. The workbook includes its existing evidence summary and canonical links back to the EvalRecord, drift, alert, access-control, and reviewer sign-off pages.

Public sample
Preview a complete evidence replay before connecting a model.
Explore a sanitized healthcare coverage-decision replay with one decision, evaluator runs, reviewer notes, sign-offs, and a tamper-evident timeline.
§1 · Per-tier export coverage

Which event categories each workspace tier captures in the export.

The pricing tier you select at sign-up drives the workspace's tiercolumn, which the export route checks at request time. The matrix below is what outside counsel and a regulator can expect to see in the resulting export: ✓ means the category is folded into the signed payload, — means the category is not surfaceable from this tier.

Workspace-tier audit-export coverage by event category. Rows are the marketing tier label; columns are the five event categories the export can surface.
Marketing tierSeat bandEval runsDrift-ledger entriesReviewer notesSign-offsHash-chain anchors
Evidence Pilot1 workflow · 1 model · 30 days
Regulated TeamTeam workspace
EnterpriseMulti-team deployment

The Evidence Pilot produces a focused replayable package for one workflow and one model. Regulated Team carries the ongoing signed evidence trail, including drift and reviewer context. Enterprise adds the full procurement-ready export surface and buyer-defined retention window and category set per engagement.

§2 · What each category contains

The five event categories folded into the signed payload.

Every category surfaces as one export line-item per record in the window, plus a chain-anchor row that links the record back to its position in the hash chain. The canonical JSON view folds everyper-kind column below — adding or removing one record of any family shifts the content hash.

Eval runs
Every EvalRecord row in the window, joined to the Model it was scored against — surfaces the canonical JSON view of inputs, evaluator name, resolved dimension scores, and the per-record hash that joined the same chain.
Drift-ledger entries
Every anchored drift signal that joined the same hash chain in the window — captures the model output, the comparator baseline, the drift magnitude, and the threshold that triggered the entry.
Reviewer notes
Free-text reviewer annotations linked back to a specific EvalRecord or drift-ledger entry by stable per-kind id — surfaces reviewer name, timestamp, and the verbatim note text.
Sign-offs
The human approval events appended to the chain after the export window closes — surfaces approver identity, approval timestamp, comment, and the prior chain root that the sign-off extended.
Hash-chain anchors
The per-window SHA-256 root plus the previous-root linkage that makes the export tamper-evident — lets an auditor replay the chain forward from any anchor and prove no event was inserted or removed after the fact.
§3 · PDF authentication

How the exported PDF is rendered and signed — so outside counsel can verify tamper-evidence on receipt.

The PDF is server-side rendered by the renderDocumentPdf helper exported from the pdf module (pure pdf-lib, no network egress, no native deps, serverless-safe). The DocumentSpec it consumes is built by the user-owned buildAdminAuditExportDocumentSpec helper in src/lib/business/admin-audit-export.ts, so the same SHA-256 fold covers the line items, the meta rows, and the footer.

Algorithm
hash        = sha256Hex( canonicalJson( { start, end, events } ) )
fingerprint = sha256( BETTER_AUTH_SECRET ).slice( 0, 16 )
signature   = sha256Hex( hash + ":" + fingerprint )
fileHash    = sha256Hex( renderedPdfBytes )

# PDF footer line (printed on every page of the export)
hash:           <hash>
signature:      <signature>
file-hash:      <fileHash>
fingerprint-id: <first-12 hex chars of fingerprint>

# Verification (no secret required)
1. Read all events the export route returned for the (start, end) window.
2. Build { start, end, events } sorted by ISO timestamp, canonical-JSON it.
3. sha256 the canonical-JSON bytes → recover the content hash.
4. sha256( contentHash + ":" + fingerprint ) → recover the signature.
5. sha256 the downloaded PDF bytes → must equal the file-hash on the footer
   AND the X-PDF-SHA256 response header.
  • Content hash (per window). The payload folds the kindof every event into a canonical-JSON view, sorted by ISO timestamp and stable per-kind id before canonicalization — so a defensive events.reverse() produces the same hash bytes.
  • Keyed HMAC signature. The signing fingerprint is sha256(BETTER_AUTH_SECRET).slice(0, 16) — sixteen hex characters of the deployment's session signing secret. Per-deployment stable by construction: two deployments holding different signing secrets produce different signatures for the same window, so a signature cannot be replayed across environments.
  • PDF integrity hash. The route returns the PDF with an extra X-PDF-SHA256 response header carrying sha256(PDF bytes) AND prints the same value on a footer line of every PDF page. A downloader can verify with sha256sum workspace-audit-*.pdf against the header — a bit-for-bit integrity check independent of the signed hash above.
  • No secret required.The verification recipe on the right of the algorithm block is reproducible from the exported data alone — an outside-counsel reviewer never needs the deployment signing material to confirm tamper-evidence, only the four values printed on the PDF footer.
Rotation behaviour
What happens when the deployment's session secret rotates.
Rotating the deployment's session secret flips the HMAC signature on a given content hash but keeps the content hash itself intact, so a forward-only audit chain can still cross-reference the report by its hash even after the signing material rotates. The PDF file hash is unaffected by any signing rotation — it is a property of the rendered bytes alone.
§4 · Procurement & outside-counsel onboarding

Need a signed audit-export pack for your next review?

Review the Evidence Pilot or send us your outside-counsel brief directly. We'll scope the right PDF or Excel pack for your next review.

Request pricing updates
One field. We'll send updates on the Evidence Pilot and Regulated Team paths, plus a sample PDF, Excel pack, and the verification recipe.
Tell us the specifics
Five fields. We'll route the right security packet and a sample audit-export PDF and Excel pack tailored to your framework mapping.
Compliance needs

Pick every shape your procurement team will ask about.

What to read next