Guides · Agent security
AI agent audit log requirements
Something has gone wrong, and you open the log. One useful record tells you which agent acted, the exact tool call it made — arguments and all — what came back, and who approved it; a record that shows only that an action occurred tells you almost nothing. An audit trail is the difference between an incident you can explain and an incident you can only apologise for. For AI agents — which act autonomously, at speed, through tools — the log is also the difference between knowing what the agent did and guessing. This guide specifies what an agent audit log must contain, how it must be protected, and how long it must live to satisfy auditors, insurers and your own incident response.
By the Ingenious AI team · Published 14 November 2026 · Reviewed 14 November 2026
The short answer
An AI agent audit log must record, for every action: which agent (and model version) acted, when, what instruction or context triggered it, the exact tool call with arguments and result, and any human approval joined to it. It must be append-only and tamper-evident, kept for at least a year for customer-facing agents, and exportable in a form an auditor can read. A log you can edit, that drops arguments, or that expires in a week fails every serious requirement, however pretty its dashboard looks.
Try it free: FlightRecorder — see a tamper-evident flight-recorder trail for agents — the audit record this guide specifies, working in practice.
What is an AI agent audit log?
the ordered, tamper-evident record of an AI agent's decisions and actions: the inputs it saw, the tools it called with what arguments, the results it received, the approvals it obtained, and the outputs it produced. It serves three masters at once — incident reconstruction, compliance evidence, and operational debugging — and it must satisfy the strictest of the three, which is usually the one you meet after something has gone wrong.
The fields every record needs
A useful audit record answers six questions without follow-up: Who acted (agent identity, owner, model and version, system-prompt version)? What triggered it (user instruction, scheduled task, or inbound content — with a reference to the content)? What did it do (tool name, full arguments, target system)? What came back (result or error)? Who authorised it (approval record, or the policy that allowed it automatically)? And when (timestamps from a trusted clock, in sequence). Records that omit arguments or approvals are the most common failure: they prove an action occurred while hiding whether it was the right one.
Tamper-evidence is not optional
If the agent — or an attacker who compromises the agent — can edit the log, the log proves nothing. Append-only storage, hash-chaining between records, or writing to a system the agent has no credentials for are the standard patterns. The test is simple: could the subject of the investigation alter the evidence? If yes, you have notes, not an audit trail. This requirement is where home-grown logging most often fails, because the log database sits on the same infrastructure with the same credentials as everything else the agent can reach.
Retention: long enough to discover the incident
Most agent incidents are discovered late — a customer queries a charge weeks later, a monthly review finds an odd pattern, a regulator asks about last quarter. Set retention to cover the discovery horizon: 90 days is an absolute floor, one year is the defensible default for customer-facing agents, and regulated sectors often require more. Storage is cheap; an unanswerable question from an insurer is not. Record the retention decision and its reasoning in the same place you record the log design.
Make it readable by humans who were not there
Auditors, insurers and lawyers will read this trail without your team in the room. Provide an export that renders actions in plain sequence — what happened, in order, with the approvals attached — rather than raw JSON dumps that only the builder can parse. Include the vocabulary: a glossary of tool names and what each does in business terms. The trail that needs its author to interpret it fails at exactly the moment the author is unavailable, conflicted, or gone.
Prove it works before you need it
Test the trail the way you test backups: pick a random past action and reconstruct it fully from the log alone, timed. If a reviewer cannot answer who, what, why and who-approved within a few minutes, the trail has a gap — find it now, on a drill, not during a claim. Run this reconstruction test quarterly, on actions chosen by someone outside the agent's team, and record the result as part of the audit evidence itself.
Your 5-action checklist
- Verify every audit record carries agent identity, trigger, full tool-call arguments, result, approval and trusted timestamps.
- Move the log to append-only, tamper-evident storage the agent itself cannot alter.
- Set retention to at least one year for customer-facing agents and document the reasoning.
- Produce a human-readable export with a tool glossary that an outside auditor can follow unaided.
- Run a quarterly reconstruction drill: rebuild a random past action from the log alone, timed, and record the outcome.
Worked example: Northern Insurance Agency
Northern Insurance Agency — a fictional broker — deployed a claims-triage agent that filed documents, updated the CRM and emailed adjusters. When a claimant disputed a denial letter the agent had sent, the agency's audit trail answered everything in one export: the agent's identity and model version, the adjuster's instruction that triggered it, the exact letter content, the human approval record from the supervising adjuster, and the CRM update that followed — hash-chained, so the insurer accepted the sequence as evidence. The dispute closed in the agency's favour in two weeks. Their previous automation, a script with a 14-day log rotation, would have left them arguing from memory against a customer holding a printed letter.
Sources
- European Union — Regulation (EU) 2024/1689, the AI Act (2024) — Article 12 sets the record-keeping and logging duties for high-risk AI systems that the FAQ above refers to.
- NIST — SP 800-92, Guide to Computer Security Log Management (2006) — the log-management baseline: what to collect, how long to keep it, and how to keep it reviewable.
- NIST — FIPS 180-4, Secure Hash Standard (2015) — SHA-256, the hash function behind the hash-chaining this guide requires.
Frequently asked questions
What is the difference between logging and an audit trail?
Logging records what the system did for debugging; an audit trail additionally guarantees integrity (tamper-evidence), completeness (approvals and arguments included) and retention, so it can be relied on as evidence by people who distrust the system. Most agent logs fail on integrity, not on content.
Should we log the prompts and model outputs too?
Yes, with care. Prompts and outputs are often needed to explain why an agent acted, and they can contain personal data — so store them under the same access controls and retention rules as the data they contain, and never let the log become a shadow copy of your customer database accessible to everyone.
Who should be able to read the audit trail?
The agent's owner, incident responders, and compliance or audit functions. Not the whole company, and never the agent itself with write access. Access to the trail is itself an auditable event in well-run setups.
Does the EU AI Act require agent audit logs?
For high-risk systems, yes — the Act requires automatically generated logs kept for an appropriate period, and logging is one of the core high-risk obligations. Even outside the Act's high-risk tier, insurers and enterprise customers increasingly ask for exactly this evidence during vendor reviews.
Can we build this ourselves instead of buying?
You can, but the hard parts are not the writing of records — they are tamper-evidence, retention discipline and readable export under pressure. Teams commonly build the capture and buy or adopt the integrity layer; whichever route you take, test it with the reconstruction drill before trusting it.
Related guides and tools
- How to choose a website security scanner
- DMARC setup guide for small businesses
- Website security checklist for small businesses
- AI agent security: a buyer's guide
- How much does a website security audit cost?
- DMARC vs SPF vs DKIM: what each one actually does
- How to stop email spoofing of your domain
- AI chatbot security checklist
- All Ingenious AI guides
- The full Ingenious AI platform suite
- The security suite overview
- FlightRecorder — free tool