Chapter 4. Auditability & Reproducibility: full audit trails and decision tracing | Grigoriy Dobryakov

Grigoriy Dobryakov

Course · Enterprise AI Governance Architecture

Chapter 4AI Governance course

Chapter 4. Auditability & Reproducibility: full audit trails and decision tracing

Six months after launch, Kovcheg receives a request from a regulator: a customer is appealing a loan denial dated May 12. The question is simple and lethal: "Why did the AI recommend denial?" If you don't have an answer — not "the model decided so," but a reconstructible chain: what the system prompt was, what customer data was pulled in, which model version answered, which guardrails and policies fired — then a high-risk system is unprovable, and therefore non-compliant.

This chapter covers the audit plane: the layer where every AI decision leaves an immutable trace, sufficient to reproduce and explain it to a regulator, an auditor, or an incident review. Without it, every preceding control plane is unprovable: guardrails that can't be shown in a log don't exist as far as a regulator is concerned.

The customer's business goal

The ability to reconstruct the full reasoning chain and reproduce the context behind any Kovcheg decision. Promises to the business:

  1. Everything that shaped a decision can be reconstructed from its trace_id.
  2. The log is immutable — it can't be rewritten after the fact (otherwise it's useless as evidence).
  3. The log's own retention and protection comply with GDPR (the log contains PII — ch. 1).

Driver: threat or regulator

Architectural pattern

Immutable AI Trace Log Pipeline built on OpenTelemetry GenAI Semantic Conventions — end-to-end tracing with standard spans, exported to immutable storage with a retention policy.

Why OTel SemConv rather than a proprietary format: the observability ecosystem is fragmented (Langfuse, Helicone, Traceloop, LangSmith — incompatible formats = vendor lock-in). GenAI Semantic Conventions (under CNCF) define a shared vocabulary: a span from a LangChain agent looks the same as one from a bare OpenAI call. An honest caveat: as of mid-2026 the conventions are still in Development status — in production, teams turn on OTEL_SEMCONV_STABILITY_OPT_IN for dual emission (legacy + new attributes) to survive the transition to stable.

Engineering stack & providers

Engineering implementation

### Step 1. An end-to-end trace_id

A single id runs the whole chain: gateway (ch. 1) → RAG + FGA (ch. 2) → input guardrails (ch. 3) → the model → tools (ch. 9) → output guardrails → response. The same id is the key into the PII mapping store (ch. 1) and the budget tracker (ch. 5).

### Step 2. What exactly gets captured in the spans

Per GenAI SemConv plus audit extensions:

### Step 3. Export to immutable storage

app (OTel SDK) → OTLP → collector → Kafka → ┬→ ClickHouse (analytics/dashboards)
                                            └→ WORM/append-only (legal audit, retention)

The append-only layer isn't "a database everyone agreed not to write over" — it's storage with technical impossibility of overwrite (object-lock / WORM).

### Step 4. Reproducibility

Given a trace_id, the full input is reassembled. With a fixed model version and seed, a decision can be replayed — with the caveat noted in failure modes.

### Step 5. The log's own privacy

The audit trail contains PII and secrets → encryption, role-based access, a separate TTL that balances Art. 12 (retain) against GDPR (don't over-retain).

Where it breaks

Standards and mapping

Lab and artifact

Instrument Kovcheg with OTel GenAI SemConv, export through Kafka into ClickHouse plus an object-lock layer; given a trace_id, reconstruct the full context of the decision from the introduction; configure log retention and encryption. Artifact: a trace-event schema (SemConv attributes + audit extensions) + a "replay one decision" dashboard + a retention/protection policy (evidence for ch. 6).

Maturity checklist

Sources

In practice

How it actually works — engineering breakdowns

Standalone howto from practice, showing this control plane on real code and a working artifact.

Read next

Putting AI into production under regulatory risk?

Designing the control plane for your system: privacy, access, guardrails, audit, EU AI Act / ISO 42001 compliance — as working architecture, not a policy PDF.

Email me

The transition engine

Next Move Engine — the system that takes a team to an autonomous delivery loop.

Next Move Engine →