
A policy proves someone wrote a policy. An audit trail proves what your agents actually did, and it is the one control you cannot apply retroactively.
The question a CISO gets asked about AI has changed. A year ago it was whether the company had a policy. Now it is narrower and much harder: show me what your AI agents did last Tuesday, on which systems, at whose instruction, and prove the record has not been edited since.
That question is nearly impossible to answer for the population of agents most companies never inventoried: the coding agents their own developers run. Those agents hold a checkout of the source code, a shell, cloud credentials, and a route to production, and they take hundreds of actions a day. If nobody recorded those actions as they happened, there is no honest answer to give, because an audit trail is the one security artifact that cannot be produced retroactively.
This article is about what that record has to contain, which frameworks are asking for it, and why the order of operations in AI coding agent security matters more than the tooling.
What is an AI audit trail for coding agents?
An AI audit trail for coding agents is a chronological, attributable, and tamper-evident record of the prompts, tool calls, commands, policy decisions, and system interactions produced by AI agents, kept as they happen. It allows a security team to reconstruct what an agent did, investigate an incident, and demonstrate compliance to an auditor or a customer.
Three words in that definition carry the weight. Chronological means the order is preserved, so a sequence can be replayed rather than guessed at. Attributable means every action resolves to a named person, because an agent is not an accountable party. Tamper-evident means that if the record is altered or switched off, that fact is visible rather than silent. An AI agent audit trail missing any one of those is a log file, not evidence.
Governance says what should happen. An audit trail proves what did.
It is worth separating two things that get sold together. Governance is a statement of intent: the policies, the approved tool list, the rules about what agents may touch. An audit trail is evidence: what actually occurred, attributed and time stamped, whether or not it followed the policy.
Auditors and regulators increasingly want the second one. A policy document proves that someone wrote a policy. It says nothing about the Tuesday in question. Writing about the gap in September 2026, IDC observed that in one industry governance survey, most organizations said they could not verify what their AI agents actually do across business systems. That is a statement about missing records rather than missing policies, and the two failures have very different remedies.
The practical consequence for a security leader is uncomfortable. Every other control you own can be improved after an incident. Logging cannot. The evidence either exists from the moment the action happened or it does not exist at all.
What the frameworks are actually asking for
Three reference points matter here, and the useful observation is that they converge on the same underlying artifact.
The most specific is the European Union's AI Act. Article 12 states that "High-risk AI systems shall technically allow for the automatic recording of events (logs) over the lifetime of the system." It frames the purpose explicitly as traceability: the logging has to be capable of "identifying situations that may result in the high-risk AI system presenting a risk," and of supporting post-market monitoring. Note what that is and is not. It is a requirement that the system be built so the record exists. It is not a requirement to write a policy about records.
Timing here is widely misreported, and it is worth getting right before anyone plans around it. The AI Act applies generally from 2 August 2026, and a great deal of published commentary stops there. The high-risk obligations are carved out of that date by Article 113, which sets 2 December 2027 for systems classified as high-risk under Article 6(2) and Annex III, and 2 August 2028 for those classified under Article 6(1) and Annex I. If you have read that high-risk logging duties begin in August 2026, that is the general application date rather than the high-risk one.
In the United States, the NIST AI Risk Management Framework, published as AI 100-1 and released on 26 January 2023, is the common reference for structuring AI risk work. NIST notes on the same page that the framework is being revised as part of the White House AI Action Plan, so anyone building a programme against it should expect movement. ISO/IEC 42001, the international standard for AI management systems, is the third reference most enterprise buyers will encounter, usually through a customer questionnaire rather than by choice.
The frameworks differ in scope and in force. They do not differ much in what they need from you. Each one, in its own vocabulary, asks whether the operation of the system can be reconstructed afterwards by someone who was not there. That is a single artifact, and building it once is considerably cheaper than assembling it three times for three questionnaires.
Does any of this actually bind your coding agents?
Often not directly, and it is worth being precise rather than alarmist. The AI Act's logging duty attaches to systems classified as high-risk, which is a defined category tied to the uses listed in Annexes I and III, not a description of any software that happens to use a model. An internal coding assistant is unlikely to fall inside it on its own.
Three things complicate that comfortable answer. The classification follows the use, so an agent that writes or modifies a system which is itself high-risk pulls your development process into the conversation. Customers do not wait for regulators, and enterprise security questionnaires are already asking for AI agent compliance evidence regardless of statutory scope. And the frameworks that are not law, which is most of them, apply by contract rather than by jurisdiction.
The reasonable position for a CISO is therefore that the AI audit trail requirements are driven by your customers and your own incident response needs first, and by regulation second, for most internal deployments. That is a better reason to build the record than a date on a calendar, and it does not expire if a classification changes.
What a CISO needs to see in the record
"Log everything" is not a specification. For coding agents, a record is useful to a security team only if it can answer a specific set of questions without a follow-up investigation.
Two of those rows deserve emphasis because they are the ones most commonly missing.
The first is recording what was blocked. Teams instinctively log successes and discard refusals, which is backwards. A refused attempt to drop a production table tells you more about where your exposure sits than a thousand successful file edits, and a count of blocked attempts over time is the clearest evidence you have that a control is doing work.
The second is tamper-evidence. If recording can be turned off on a laptop and nothing anywhere notices, then every clean report is only a report about machines that chose to be recorded. The gap has to be visible as a gap.
What one entry in the log should look like
Specifications are easier to argue about than to implement, so here is the same seven answers expressed as a single event. This is the shape of AI audit logging that survives a real investigation.
Notice what is present that most logging leaves out. The decision is recorded as its own field, with the rule that produced it, so a blocked attempt is a first-class event rather than an absence. The environment is separate from the tool, because the same query is unremarkable in development. The session identifier is what lets you reconstruct an order of events rather than a pile of them. And the hash chain is what turns a list into evidence.
Keeping the record trustworthy and usable
A record that can be quietly edited, quietly switched off, or read by anyone is not an audit trail. Three controls do most of the work, and they are worth specifying before you buy AI agent monitoring software rather than after.
Tamper-evidence. The common approaches are append-only or write-once storage, hash chaining where each entry includes a digest of the previous one so any edit breaks the chain, and periodic signing or anchoring of digests by a separate system. The weaker but essential companion control is detecting absence: if recording stops on a machine, that machine has to be flagged, because a silent gap is indistinguishable from a quiet week.
Role-based access. The audit trail contains prompts, commands, and fragments of source code, which makes it sensitive in its own right. Reading it should be a named role, access to it should itself be logged, and the people subject to the recording should not be the people who can alter it. Separation of duties applies to the evidence as much as to the systems it describes.
Getting it where your analysts already work. An audit trail nobody queries during an incident is shelfware. Export to the SIEM or log platform your security team already uses, through a streaming forwarder or a scheduled export, so that agent activity correlates with the rest of your telemetry instead of living in a separate console. The practical test is whether an analyst can pivot from a suspicious database event to the agent session that caused it without opening a second tool.
How long to keep it
Retention is where good intentions meet a storage bill, and the honest answer is that there is no single correct number. Set it from three inputs rather than by habit.
Your contractual commitments usually set the floor, because enterprise customers increasingly specify retention in the agreement. Your own investigation window sets the practical minimum, and incidents involving agents are frequently discovered long after the fact, so a period measured in months rather than weeks is sensible. Your data protection obligations set a ceiling, because a record containing personal data cannot be kept indefinitely just because storage is cheap.
Two refinements make the bill manageable. Tier the data, keeping full session detail hot for the investigation window and compressed or summarised records for longer. And write down the deletion process, because a retention policy you cannot demonstrate executing is not a policy. Whatever you choose, state the period, apply it consistently, and be able to show that expired records actually went away.
What the report at the end looks like
The artifact a CISO is eventually asked for is not the raw log. It is a short report, drawn from the log, that answers a specific question for a specific audience, and it should be generated rather than assembled by hand.
A useful one states the period and the scope, the agents and people in scope, the volume of activity recorded, the policy decisions made, with blocked attempts broken down by rule and by target, any gaps in recording with their explanation, and the integrity status of the record. For an example of the shape, a weekly report for a single engineering team might state that across 85 sessions, 3,330 actions were recorded for 12 named developers, 37 were blocked, the most frequently blocked target was the production database, no recording gaps were detected, and the hash chain verified. That is two paragraphs, it is checkable, and it is the difference between AI agent governance as a claim and as a practice.
Why you cannot assemble this afterwards
There is an order to oversight, and it is not negotiable.
You cannot govern what you never recorded, because a policy with no observation is an assertion. You cannot prove anything without both, because evidence is the record plus the decisions applied to it. And you cannot reconstruct a sequence of individually allowed actions unless you kept them all, which is precisely the case that per-call policy alone cannot catch, as we argued in the piece on blocking risky tool calls before they run.
This is why the recording comes first. We made that case at length in AI observability for coding agents, and the audit trail is the reason it matters to a CISO rather than only to an engineering manager. Observe produces the record. Govern adds the decisions. Prove turns both into something you can hand to an auditor, a customer, or a board.
A practical consequence: the day you discover you need the evidence is always too late to start collecting it. The cost of recording from the beginning is a storage bill. The cost of not having recorded is an unanswerable question during an incident.
The questions worth asking your own team
Before buying anything, four questions tend to expose where a programme actually stands.
Which agents are running inside the company right now, on whose machines, and who approved them. Most answers to this are incomplete, and the gap between the approved list and the running list is the real risk surface.
If an agent took a destructive action this morning, how long would it take to produce the full session, attributed to a person. If the answer is measured in days, or involves asking a developer what they remember, there is no audit trail.
What happens if someone turns recording off. If nothing happens, the control is advisory.
Where does the record live, and who can read it. A log of your own source code and commands sitting in a vendor's cloud is a transfer of risk rather than a reduction of it.
About Tericsoft and Super Eye
Tericsoft is an AI first, outcome driven technology partner, and Super Eye is our oversight layer for the AI coding agents a company's own developers run, including Claude Code, Codex, and Cursor.
It is built in the order this article describes. Observe records every prompt and tool call, tied to the person, the machine, and the repository, with every session searchable, secrets hidden as they are typed before anything is stored, and a laptop flagged in the admin panel straight away if recording is switched off there. Govern adds the decisions, with allow and block rules for every tool an agent can reach, scoped per company, team, or person, blocked attempts stopped before they execute and logged either way, and an exportable audit trail. Prove turns the two into evidence, matching work to sessions and producing reports.
It runs on your own server, inside your network, and the records go to that server rather than to us, which answers the last question in the list above by construction.
We run it on our own fleet, which is where our numbers come from rather than from a customer. In one recent week it recorded 846 prompts across 85 sessions and 3,330 logged actions over 59 tools, and blocked 37 attempts, with production database queries and recursive storage deletes the most frequently stopped.
An attributed, time stamped record of what an AI system actually did, kept as it happens, so the operation can be reconstructed later.
Governance states what should happen. An audit trail is evidence of what did happen, which is what an auditor or a regulator asks to see.
Article 12 requires high-risk systems to technically allow automatic recording of events over the system lifetime, for traceability.
Article 113 sets 2 December 2027 for Annex III high-risk systems and 2 August 2028 for Annex I. General application is 2 August 2026.
No. Logging is the one control that cannot be applied retroactively. The record either existed when the action happened or it does not.


