← Overnight blog Compliance & Audit

The Audit Trail Problem: Proving What Ran and Who Approved It

For AI-built software, the auditor's question (what ran against our data, and who approved it?) usually has no good answer. Here is why application logs can't provide one, and what a real record of autonomous execution actually requires.

Explainer 5 min read Updated July 21, 2026

Every compliance review of AI-generated software eventually reaches the same two questions: what ran against our data, and who approved it? A working AI code audit trail answers both in seconds, naming the exact code that executed, the identity behind it, and the approval that authorized it, all recorded as it happened. In practice the answer is usually a shrug and a Slack search. The app has logs, and the logs describe what the app did. They say nothing about who let an autonomously-generated program touch production data in the first place.

Why the auditor's question has no answer

An audit trail is, in the words of one SOC 2 practitioner, "a detailed set of information that provides evidence for an activity that has occurred." Auditors lean on it to satisfy the standards for sufficiency and appropriateness of evidence. When an agent writes a tool at 2 a.m. and runs it, the activity that most needs evidence is the one nobody captured: the decision to let unreviewed code reach real records. Traditional pipelines assume a human wrote the code, opened a pull request, and got a review, and that human-shaped paper trail is the approval record. Autonomous generation removes the human from the loop and takes the record with it.

What application logs record, and what they miss

Most AI deployments produce logs. As one analysis of AI-agent audit requirements puts it bluntly, "they are the wrong logs." Application and infrastructure logs show that a connection occurred and a request returned 200. They rarely show which regulated record was read or under whose authorization. Orchestration logs attribute activity to a workflow type or a shared service account, which is a long way from an individual, authenticated program and the human who delegated to it. What you end up with is detailed telemetry about application behavior with a hole exactly where accountability should be.

There is a subtler gap too. App logs are best-effort artifacts the developer chose to emit, and nothing ties them cryptographically to the specific build that ran. NIST's log-management guidance warns that logs "need to be protected from breaches of their confidentiality and integrity," noting that many rootkits are "specifically designed to alter logs to remove any evidence" of what executed. A record that an attacker or a buggy agent can quietly rewrite carries the weight of a rumor, and an auditor will treat it that way.

The core gap

Application logs answer "what did the app do?" An audit trail has to answer "what code ran, whose identity authorized it, and can I prove this record hasn't been touched since?" The first falls out of running software. The second has to be designed in.

What a real AI code audit trail actually needs

Strip it to essentials and the requirements are concrete. Every execution and every approval has to be recorded as it happens, each one attributable to an identity, covering both the program that ran and the human who authorized it, with anonymous service accounts ruled out. The record has to be tamper-evident: reviewers of AI-agent controls note that "tamper-evidence is a technical property, not a policy one," and a writable table guarded by access controls doesn't qualify. And it has to be queryable as evidence. SOC 2 audit logs must let you "prove that the logs have not been modified since the events occurred," which is why practitioners reach for hash chaining, where each event's hash depends on the last, and retain roughly fifteen months of history to cover a Type II window.

Put together, a defensible trail captures the signed identity of the code that ran, the human authorizer behind it, the specific data touched, the operation performed, the policy decision that permitted or denied it, and a timestamp nobody can quietly rewrite.

Logging vs. an audit trail by construction

This is the distinction that matters. Logging is something you bolt on. You decide what to emit, where to ship it, and how to protect it, then hope the coverage holds while a fleet of agents generates apps faster than anyone can instrument them. An audit trail by construction is produced automatically by the runtime the code executes in, because the boundary that mediates every call is also the thing writing the record. You can't run outside it, so you can't run without being recorded.

Best-effort logging keeps failing the auditor's question for a structural reason: the record is written by the same application whose behavior is in question, after the fact, if at all. Move the record to the boundary, the layer that has to see every execution and every approval to do its job, and the evidence gets captured at the one point nobody can skip. This is the same logic behind treating compliance as a property of the runtime rather than of each individual app. Prove the boundary once and every program inside it inherits an attributable trail, written before anyone thinks to ask for it.

Sources

  1. NIST Special Publication 800-92, "Guide to Computer Security Log Management" (log confidentiality/integrity protection; logs altered to remove evidence) · nvlpubs.nist.gov
  2. Linford & Co., "What is an Audit Trail & How Does it Relate to SOC 1/SOC 2?" (audit trail as evidence; sufficiency and appropriateness of evidence) · linfordco.com
  3. Kiteworks, "Tamper-Evident Audit Trails for AI Agents: What SIEM Integration Actually Requires" (wrong logs; identity/authorizer attribution; tamper-evidence as a technical property) · kiteworks.com
  4. AuditKit, "SOC 2 Audit Log Requirements" (proving logs unmodified; hash chaining; ~15-month retention for Type II) · auditkit.dev
Early access

Request access

Tell us where you want to run AI-written code and we will get back to you.

We use this to connect with you, and for nothing else. No recurring marketing emails.