# Audit trail — make every AI action accountable

An AI action that isn't logged didn't happen — you can't verify it, explain it to
a regulator, or learn from it. In a regulated setting the audit trail isn't
overhead; it's the thing that lets you use AI at all.

## Log every call

For each AI call, capture enough to reconstruct and explain it later:

- **Who / what** triggered it (user or system, correlation id)
- **Which model** and version, and the **data class** it was given (see `model-tiers.md`)
- **Inputs** — the prompt (PII scrubbed/tokenised), parameters, retrieved context
- **Outputs** — the response, token counts, cost
- **Outcome** — accepted / rejected / edited, and by whom
- **Timestamp** and latency

That single record serves four masters at once: debugging, cost analysis,
quality measurement, and compliance.

## Put humans on the gates that matter

Not every output needs a human; the irreversible ones do. Define the gates
explicitly:

- **Auto-proceed** — low blast-radius, verified by an automated check.
- **Human-in-the-loop** — a person reviews before the action takes effect
  (money movement, customer-facing decisions, anything of record).
- **Fail-closed** — if a check or a reviewer is unavailable, the action *blocks*;
  it does not sail through on a timeout.

The builder of an output should never be its only approver — true for people,
true for AIs.

## Verifying non-code and probabilistic output

Code has tests; a summary, a classification, or a forecast does not. Hold it to a
measurable standard anyway:

- **Baseline it.** Keep a human-graded reference set. Score new output against it.
- **Sample continuously.** Audit a random slice of production output, not just the
  launch batch — quality drifts.
- **Track the error rate over time**, with a threshold that trips a review.
- **Watch for metric-gaming.** If the AI grades its own work, have a *different*
  pass check it — systems quietly learn to satisfy the measure instead of the goal.

## The one-line test

> If a regulator asked "why did the system do that, and who approved it?" —
> could you answer from the record alone? If not, the trail isn't complete yet.
