Hashlogics
Blog

Audit Trails Are the Feature Nobody Asks for and Everybody Needs

Nobody writes 'audit trail' into the first draft of a spec. Every regulated system ends up needing one, usually the week an examiner calls.

The short version

4 things that decide this

  1. 01An audit trail is the record of who saw what, who approved what, and what an AI system was given before it produced an answer.
  2. 02It rarely appears in an early spec, because the buyer is thinking about the feature, not the review that comes after it ships.
  3. 03TrialTriage, a clinical trial matching platform we built, logs 23 distinct audit action types and enforces role-based access across four user types.
  4. 04The fix is not a logging library added at the end. It is treating every decision point as a record from the first design pass.
The setup

Nobody puts the audit trail in the pitch

A buyer asks for faster trial matching, faster audits, or faster compliance checks. Nobody opens a requirements call by asking for a record of who approved what. The audit trail shows up later, once the system is live and someone outside the building wants to know how a decision got made.

That someone is usually a regulator, an insurer, or a client's own compliance team. They rarely ask whether the AI was right. The real question is who saw the recommendation, who signed off, and what the model had in front of it at the time. A system with no answer has a working feature and an unfinished product.

This is why the requirement gets missed. It is invisible right up until it is the only thing that matters, and by then it is expensive to bolt on.

The mechanism

Why the record matters more than the recommendation

In a regulated workflow, the AI's output is rarely the final word. A nurse, an auditor, or a compliance officer reviews it before anything happens. The final answer is only one link in the chain that gets examined afterward. Data the model saw matters. So does the suggestion it made, who reviewed it, and when they signed off.

We built TrialTriage to match cancer patients to clinical trials. Large language models generate ranked matches from patient records, guidelines, and trial data. A nurse reviews, adjusts, and finalizes every match, so clinical judgment stays in the loop. The platform tracks 23 distinct audit action types across four user roles. Every step of that review gets an owner and a timestamp.

Insurance audits carry the same shape. PremiumAudit.io digitizes the full audit lifecycle: scheduling, document intake, extraction, report writing, and review. Each role gets its own dashboard. Carriers, auditors, and policyholders each see a different slice of the same record. That is what lets a carrier answer 'how was this figure calculated' months after an audit closes.

Shift Link, a workforce compliance platform for a UK staffing firm, checks documents and tracks their expiry automatically. Consultants work from real-time dashboards and alerts, so compliance gaps surface before a shift is booked. That only holds if every check and every alert gets written down somewhere a reviewer can find later.

  • 01Who saw the recommendation, and when.
  • 02What the model was given as input at that moment.
  • 03Who reviewed, changed, or approved the output, with a timestamp attached.
Where the record has to startLive
  1. InputThe data the model was given for this decision.
  2. Model outputThe recommendation, ranked or drafted.
  3. Human reviewWho looked at it, and what they changed.
  4. ApprovalWho signed off, and when.
  5. Audit recordAll four steps, written down before the next one starts.

Each step writes its own record. Reconstructing the chain afterward from logs built for something else does not hold up.

The fix

Design the record before you design the feature

Start by listing every decision point in the workflow: where the model produces something, where a human reviews it, and where an approval happens. Each one needs a record before the feature ships, not a log statement added when a client asks for one.

21 CFR Part 11, the FDA rule that governs electronic records in regulated industries, requires an audit trail that is secure, computer-generated, and time-stamped. Changes to a record cannot obscure what was recorded before. That standard is a reasonable target even outside pharma. It describes what an examiner actually wants: a record nobody can quietly edit, including the system's own operators.

Role-based access belongs in the same design pass. A carrier, an auditor, and a policyholder may all touch one audit. Each should see only their own slice, and the record should show exactly what each one saw. Bolting that on after launch means fixing permissions on data nobody scoped correctly the first time.

Questions, answered

Questions this raises

01What does an audit trail need to include for an AI system?

It needs to show who saw the model's output, what data it was given, and who reviewed and approved the recommendation, each with a timestamp. TrialTriage tracks 23 distinct audit action types across four user roles for this reason. A record showing only the final decision will not satisfy an examiner.

02Does an AI decision need to be explainable to pass a compliance review?

The record of what happened matters more than an explanation of the model's internal reasoning. A reviewer wants to know what data the system saw, what it recommended, and who signed off, not a walkthrough of the model's weights. Building that chain of custody is what makes a decision defensible later.

03When should audit logging get built into an AI system?

Before the first version ships, not after a client or regulator asks for it. A system that was not designed to record each decision point usually needs its data model rebuilt, not a single log line added.

Written by Abdul Basit, CEO, HashlogicsVerified
Start

Let’s build the one that runs after.

We build AI agents and automation, then stay on under an agreed service level. A senior engineer reads every brief, and your call gets scheduled within 24 hours.

What happens next

  1. 01

    You send a brief or book a call

    Two minutes, whichever you prefer.

  2. 02

    A senior engineer replies within 24 hours

    Not a sales rep.

  3. 03

    Honest scoping, in writing

    And if we’re not the right fit, we say so.

Abdul Basit, CEO of Hashlogics

“I started Hashlogics because too many teams ship a demo, get paid, and disappear. We build to a standard we’d run ourselves — and we stay to keep it running.”

Abdul Basit · CEO · a direct line

Not ready to talk? Take the checklist.

12 questions to ask any AI agency before you sign. They separate a demo shop from a team that ships to production.

Get the checklist

Free · no newsletter