Skip to content
Brihat InfotechBrihat Infotech

AI Engineering

What an AI audit trail actually has to capture

Recording that a decision happened is not an audit trail. Reconstructing why it happened, eleven months later, with the model since replaced, is.

Animesh Pathak4 Aug 20264 min read

Most AI systems log something. Very few log the thing a regulator will actually ask for.

The test is specific: eleven months from now, a customer disputes a decision. The model has been upgraded twice, the prompt rewritten, the retrieval index rebuilt. Can you show what happened and why?

If the answer requires anyone to remember anything, the trail is not an audit trail.

The eight things to capture

  1. The input, as received. Not as normalised — the raw submission, so a dispute about what was actually provided has an answer.
  2. The retrieved context or features. Which documents came back, which features were computed, what values they held. This is the most commonly omitted item and usually the most important, because a wrong answer is far more often a retrieval failure than a reasoning one.
  3. Model and prompt version. Identifiers that resolve to an artefact you still hold. "GPT-class model, September" is not a version.
  4. Tool calls and their results. What the system did, in order, with what came back — including failures and retries.
  5. The raw output before any post-processing, plus the processed result.
  6. Confidence, and the threshold in force. A score means nothing without the cutoff it was compared against, and thresholds change.
  7. Human involvement. Whether it was reviewed, by whom, and whether they agreed or overrode. An override is the most valuable record in the system and the one most often left out.
  8. Timestamps on each stage, which is what lets you correlate with an incident later.

Why a debugging log will not do

The two are optimised for opposite things.

Debug logAudit trail
Question answeredWhat is happening now?What happened then, and why?
Time horizonHours to daysYears
RetentionRotatedFixed, defensible period
GranularityWhatever helped an engineerFixed schema, every field, every time
MutabilityFreely rotated and prunedAppend-only

Teams discover the difference at the worst moment: the incident is a year old, the logs rotated after ninety days, and the model that produced the decision no longer exists.

Versioning is the part that fails quietly

Logging "model version 4" is useless if version 4 has been overwritten. The artefacts have to be retained alongside the reference: the model or its identifier with the provider's own version, the exact prompt text, the retrieval index or a snapshot identifier, and the configuration in force.

This is why a model and prompt registry is not administrative overhead. It is the thing that makes the log mean something.

Reproducibility, and its honest limits

The strongest position is being able to re-run the decision and get the same result. That is achievable with deterministic settings and retained artefacts, and worth engineering for.

It is not always achievable — a provider may retire a model version, and non-determinism can be inherent. Where exact reproduction is impossible, the fallback is a complete record of what happened plus the reasoning artefacts, and being straightforward about the limit. A claim of reproducibility that fails under examination is worse than an accurate account of what was retained.

The log is a data store

An audit trail for a system processing personal data contains personal data. It therefore inherits every obligation the rest of the system carries: access control, retention limits, inclusion in deletion requests, and the same residency constraints.

The recurring failure is a logging pipeline built by engineers for debugging that quietly accumulates prompts and inputs outside the boundary the rest of the architecture respects — often in a third-party observability tool in another jurisdiction.

Retention, stated rather than assumed

Sector rules usually decide this rather than AI-specific ones: lending and insurance decisions commonly need to be defensible for years. That has to be balanced against storage limitation under the DPDP Act, which expects data not to be kept indefinitely without purpose.

The defensible answer is a stated period tied to a stated purpose, applied consistently, rather than either extreme.

Build it first

Retrofitting an audit trail onto a working system means reconstructing which version of what was in force during a period nobody instrumented — and the answer is usually that it cannot be done.

In regulated Indian sectors this is not hygiene. It is the difference between a system that can go live and a pilot that stays one.

  • ai
  • governance
  • audit
Questions this raises

Enough to reconstruct the decision: the input as received, the retrieved context or features, the model and prompt version, any tool calls and their results, the raw output, the confidence or score, the threshold in force at the time, and whether a human reviewed or overrode it. Anything less records that a decision occurred without preserving why.

AP

Written by

Animesh Pathak

Founder

Founded Brihat Infotech in 2022 and has led delivery on every engagement since. Works problem-first: map how the organisation actually runs before proposing a system, then stay on the engagement long enough to be accountable for whether it gets used.

Next step

Bring us the problem. We will bring the architecture.

A discovery call takes forty-five minutes. You leave with our read on the problem, the shape of the system we would propose, and a straight answer on whether we are the right team for it.

  • No sales deck
  • An engineer on the call, not an account manager
  • NDA before you share anything