Reference · Records
What an AI Agent Audit Trail Must Record
A log helps a developer debug. An audit trail lets a stranger reconstruct what the agent did, under whose authority, and what changed.
What this page is. A synthesis of the NIST SP 800-53 Rev. 5 audit and accountability controls, NIST SP 800-92 on log management, the OWASP Logging Cheat Sheet, AICPA Trust Services Criteria CC7.2 and CC7.3, and ISO/IEC 27001:2022 controls A.8.15 to A.8.17. The field schema is our recommendation; the controls are the standards'.
What it is not. An audit opinion or a universal requirement. NIST SP 800-53 is a control catalog; it binds a private company when a contract, regulation, or its own risk decision says so. Your auditor and your client agreement govern.
01The short answer
An audit trail for an agent has to answer five questions without the person who built it in the room: who or what triggered the run, what the agent read, what it decided, what it did, and what changed. If the record cannot answer those, it is a log, not evidence.
The difference is not volume. It is structure, attribution, protection, retention, and export. A console that shows activity for thirty days is a debugging aid. An audit trail is a record you can hand to a reviewer, a client, or an incident investigator and have them reach the same conclusion you did.
02What the standards ask
Three bodies of guidance do most of the work. None of them is AI-specific; that is the point. An agent is a system that logs, and the same controls apply.
| Source | Control | What it asks |
|---|---|---|
| NIST SP 800-53 Rev. 5 | AU-2 Event Logging | Identify the event types the system must log, and coordinate the list across the organization.[1] |
| NIST SP 800-53 Rev. 5 | AU-3 Content of Audit Records | Record what happened, when, where, the source, the outcome, and the identity involved.[1] |
| NIST SP 800-53 Rev. 5 | AU-6 Audit Record Review, Analysis, and Reporting | Review and analyze records for signs of inappropriate activity, and report the findings.[1] |
| NIST SP 800-53 Rev. 5 | AU-8 Time Stamps | Use internal clocks and an authoritative time source to stamp records.[1] |
| NIST SP 800-53 Rev. 5 | AU-9 Protection of Audit Information | Protect audit information and tools from unauthorized access, modification, and deletion.[1] |
| NIST SP 800-53 Rev. 5 | AU-11 Audit Record Retention | Retain records for a defined period that meets legal, regulatory, and organizational needs.[1] |
| NIST SP 800-53 Rev. 5 | AU-12 Audit Record Generation | Generate records for the defined event types, with the defined content, at the defined time.[1] |
| AICPA TSC (2022) | CC7.2 | Monitor system components for anomalies and analyze whether they represent security events.[4] |
| AICPA TSC (2022) | CC7.3 | Evaluate security events and take action where they could or did cause a failure.[4] |
| ISO/IEC 27001:2022 | A.8.15 Logging | Produce, store, protect, and analyze event logs.[5] |
| ISO/IEC 27001:2022 | A.8.16 Monitoring activities | Monitor networks, systems, and applications for anomalous behavior and act on the results.[5] |
| ISO/IEC 27001:2022 | A.8.17 Clock synchronization | Use approved time sources and keep clocks synchronized.[5] |
NIST SP 800-92 adds the operational layer: log management is a lifecycle, not a file. It covers generation, transmission, storage, analysis, disposal, and the protection of the logs themselves.[2] The OWASP Logging Cheat Sheet adds the application-level detail: what to log, what not to log, and how to protect the record.[3]
03The fields
This is our recommended schema, grouped by the question it answers. It is designed to satisfy AU-3's content requirement and to make CC7.2 and CC7.3 testable. It is not a mandate from any of the standards.
| Group | Field | Why it matters |
|---|---|---|
| Who and when | Event time, UTC, RFC 3339 | Orders the trail and survives time-zone disputes. AU-8. |
| Run or session ID | Reconstructs one execution end to end. | |
| Trigger: person, schedule, or event | The accountability anchor. Without it, the action belongs to nobody. | |
| Agent name and version | Attributes behavior to a build, not a brand. | |
| Model, provider, and version | Shows what saw the data, and lets you reproduce the decision. | |
| What it read | Input reference and hash | The document or message ID, not the full content. The hash proves the input did not change. |
| Retrieved source IDs | Which records the agent used, so the answer can be traced. | |
| What it did | Tool name and target system | What action was attempted, and where. |
| Arguments, redacted or hashed | Enough to reconstruct the call without storing secrets or full PII. | |
| Policy decision and rule ID | Allow, deny, or requires approval, and the rule that produced it. | |
| Outcome and downstream change | Success, denied, or error; the record ID and a before/after hash where something changed. | |
| How sensitive | Data classification | The sensitivity of the data touched, so access and retention can follow it. |
Two fields are easy to leave out and expensive to add later: the trigger identity and the policy rule. The first makes the action attributable; the second makes the decision reviewable. A log with a tool call but no trigger and no rule is an activity feed.
04A sample record
Illustrative, not a real record. The shape is the point: the content is referenced and hashed, the decision cites a rule, and the approval is in the record rather than in a chat thread.
{
"ts": "2026-11-30T14:02:11Z",
"run": "r-4821",
"trigger": {"type": "user", "id": "jsmith"},
"agent": {"name": "invoice-matcher", "version": "2.3.1"},
"model": {"provider": "pinned", "version": "2026-10"},
"input": {"doc": "invoice-INV-1042", "sha256": "9f2c…"},
"sources": ["po-8821", "vendor-master-114"],
"tool": {"name": "ledger.post", "target": "quickbooks"},
"arguments": {"invoice": "INV-1042", "amount": "4120.00", "account": "6100"},
"policy": {"decision": "requires_approval", "rule": "AP-17"},
"approval": {"by": "controller:lee", "ts": "2026-11-30T14:01:58Z", "scope": "post"},
"outcome": {"status": "success", "record": "je-5521", "before": null, "after": "a71e…"},
"classification": "confidential"
}
A reviewer can answer the five questions from this record alone: who triggered it, what it read, what it decided, what it did, and what changed. That is the test.
05Tamper evidence
AU-9 is the control that turns a log into evidence: the record and the tools that produce it must be protected from unauthorized access, modification, and deletion.[1] For an agent, that means the agent's own identity should not be able to edit or delete its record. Practical measures:
- Append-only or write-once storage. The writer can add, not rewrite.
- A separate write identity and account. The agent writes through a credential that has no update or delete permission on the log store.
- A hash chain or signed records. Each record carries a hash of the previous one, or a signature, so a deletion or edit is detectable.
- Access to the logs is itself logged. Reading the audit trail is an auditable event.
- Gap detection. AU-5 covers the failure of the logging process; the system should notice when logging stops or a record is missing.[1]
- A tested export. The record is only useful if it can leave the platform in a readable, complete form.
OWASP's guidance is blunt about the threat: logs are a target. An attacker who can write to them can cover their tracks, and an attacker who can read them can exfiltrate secrets. The controls are the same as any sensitive store: restrict, encrypt, monitor, and test.[3]
06Retention
AU-11 requires a defined retention period; it does not prescribe one.[1] The period comes from the client agreement, the audit period, and any legal or regulatory requirement. A SOC 2 examination typically looks back over a period; a client contract may require longer; a regulation may require a specific minimum. The number is a decision, not a default.
What matters is that the decision is written down, enforced, and verifiable. “We keep logs” is not a policy. A dashboard with a thirty-day window is not a record. Deletion should be logged and testable, and legal holds should override the schedule.
07What not to log
An audit trail that stores everything creates a second copy of the sensitive data it was meant to protect. OWASP lists what should usually be removed, masked, hashed, or encrypted before it reaches a log: access tokens, session identifiers, passwords, encryption keys, bank and card data, sensitive personal data, and data of a higher classification than the log store is allowed to hold.[3]
For an agent, the practical rule is: log the reference, the hash, the decision, and the outcome; keep the full content under the same access and retention boundary as the data it contains, if you keep it at all. That is why the sample record above has `"doc": "invoice-INV-1042"` and a hash, not the invoice text.
08The one-day test
This is our exercise, not a NIST requirement. Pick one agent and one day. Then answer, from the record alone:
- Who or what triggered the run?
- What did the agent read, and can you prove the input did not change?
- Which records did it retrieve?
- What did it decide, and which rule allowed or denied the action?
- What tool did it call, in which system, with what arguments?
- Who approved the action, and when?
- What changed downstream, and can you show before and after?
- Where is the record held, and how long will it be kept?
If any answer is missing, the corresponding control cannot be evidenced for that day. The finding is not that the agent behaved badly; it is that the record cannot prove it behaved well. Fix the missing link before the auditor asks for it.
09Failure modes
- Chat history as the record. It shows a conversation, not the change, the rule, or the approval.
- No trigger identity. The action cannot be attributed to a person or schedule.
- Tool call without a target or arguments. You know something happened, not what or where.
- Approval in chat. It has no scope, no timestamp tied to the credential, and no place in the record.
- Agent can edit its own log. The record is not protected under AU-9.
- Clock drift. Records from different systems cannot be ordered.
- Retention shorter than the audit period. The evidence is gone before the review.
- Full PII in the log. The audit trail becomes a second data breach surface.
- Provider logs treated as your trail. The model provider's logs show their system, not your trigger, rule, approval, and downstream change.
10FAQ
Is chat history an audit trail?
No. It shows a conversation. It does not show which record changed, which rule allowed it, who approved it, or what the downstream system recorded.
Must we log the full prompt?
Not necessarily. Log a reference and a hash, the rule applied, and the decision. If you need the content, store it under the same access and retention boundary as the data it contains.
Does NIST SP 800-53 apply to a private company?
Not by itself. It is a control catalog used by U.S. federal agencies and widely adopted elsewhere. It applies when a contract, regulation, or your own risk decision makes it apply.[1]
How long should we keep the trail?
There is no universal period. It comes from the client agreement, the audit period, and any legal or regulatory requirement. Write it down, enforce it, and make deletion verifiable.
Do we need a SIEM?
No. A structured, access-controlled, tamper-evident store with a tested export can satisfy the controls. A SIEM helps with correlation and review; it is not the requirement.
What about the model provider's logs?
They are evidence about the provider's system. They do not show your trigger identity, your policy rule, your approval, or the record that changed in your downstream system. You need your own trail.
The control-mapping checklist · v2.0
Map the record to the control
The checklist pairs each SOC 2 criterion and ISO/IEC 27001:2022 control with what an agent must demonstrate and the evidence to keep. The audit-trail rows are in section D, logging and monitoring.
One email with the checklist, then one check-in from a real person. No list. Or read it now, no email required. Privacy.
11Sources
- NIST, SP 800-53 Rev. 5 — Security and Privacy Controls for Information Systems and Organizations (September 2020, updated December 2020; Release 5.2.0, August 2025), Audit and Accountability family, AU-1 to AU-16. csrc.nist.gov/pubs/sp/800/53/r5/upd1/final
- NIST, SP 800-92 — Guide to Computer Security Log Management (September 2006). csrc.nist.gov/pubs/sp/800/92/final
- OWASP, Logging Cheat Sheet. cheatsheetseries.owasp.org/cheatsheets/Logging_Cheat_Sheet.html
- AICPA, 2017 Trust Services Criteria (With Revised Points of Focus — 2022), CC7.2 and CC7.3. Download the criteria
- ISO, ISO/IEC 27001:2022 — Information security management systems — Requirements, Annex A controls A.8.15, A.8.16, A.8.17. iso.org/standard/27001
Next: Prompt injection for business owners · SOC 2 for AI agents · The control-mapping checklist