What an AI agent audit trail is
An AI agent audit trail is a record system that captures each action an agent attempts, the decision made about it and the result. It is built so that missing or changed entries show. Each entry says which agent, owned by whom and acting for whom, did what to which record. It also names the policy version, any approval and the result.
It is not the same as the logs you already have. Application logs show what a service did, often under one shared credential. Model-provider logs show what a model was asked and answered, not what the tool call then did at the service. Observability traces help with debugging, but they are often sampled and easy to edit. An audit trail is complete, unsampled and built to be shown to someone who has no reason to trust you. That is the difference between agent activity evidence and agent telemetry.
AI agent logging matters more than logging for human users, because no person clicks each button. When something goes wrong, the record is often the only witness. This page covers what to record, what to leave out, how to make the record tamper-evident and how to map it to frameworks. It is part of our practical guide to AI agent security.
Questions auditors and incident responders ask
Design the record backward from the questions. These come up in audits, customer security reviews and incident investigations:
- Which agents exist, and who owns each one? The agent inventory answers this.
- What was this agent allowed to do on a given date, and which policy version said so?
- Whom was the agent acting for when it made this call?
- Who approved this action, and were they independent of the person who asked?
- Which records did it read or change?
- What did it try to do that was refused?
- Can you show the record is complete and unaltered?
- How long do you keep it, and who can read it?
If your logs can't answer question 2 for last quarter, you will be rebuilding policy from memory during an incident. Version your policies and write the version into every decision.
Incident responders add a speed requirement. They need to filter by agent, by person acted for, by record and by outcome within minutes. Store structured fields, not free text.
What to record for each agent action
Record one entry per decision at the point where the action is enforced, usually a gateway or proxy in front of the service. Recording inside the agent is weaker, because a manipulated agent can skip writing the entry. The OWASP Logging Cheat Sheet frames the minimum as "when, where, who and what". For agents, "who" has three parts: the agent, its owner and the person it acts for.
| Field | Example | Why it matters |
|---|---|---|
| Agent identity | spiffe://northwind.example/agents/invoice-reconciler |
Ties the action to exactly one agent identity |
| Owner | team:finance-platform |
Someone answers for the agent |
| Acting for | none, or a user ID | Separates the agent's actions from a person's |
| Operation | billing.refunds.create |
The exact tool or API call |
| Target | invoice INV-20931 |
The record it touched |
| Decision inputs | amount 450 USD | The non-sensitive values a rule depended on |
| Decision and reason | held: above 100 USD | Why it was allowed, held or denied |
| Policy version | billing-refunds v14 |
What the rules were at the time |
| Approval | approver, time, uses allowed | Who took responsibility |
| Outcome | executed, status 201 | What actually happened at the service |
| Time, request ID, chain hash | ISO 8601 timestamp | Ordering, correlation and tamper evidence |
An example receipt
The JSON below is illustrative. The field names are ours for this example, not a standard or a product schema. It records a refund by the invoice reconciler at Northwind, a simulated company from AgentFort's lab demos:
{
"receipt_id": "rcpt_01JB8X4Q7M",
"time": "2026-10-28T14:09:41.207Z",
"agent": "spiffe://northwind.example/agents/invoice-reconciler",
"owner": "team:finance-platform",
"acting_for": null,
"operation": "billing.refunds.create",
"target": { "type": "invoice", "id": "INV-20931" },
"decision_inputs": { "amount": 450, "currency": "USD" },
"decision": "allowed_after_approval",
"reason": "refunds above 100 USD need Finance approval",
"policy": { "id": "billing-refunds", "version": 14 },
"approval": { "approver": "user:dana", "approved_at": "2026-10-28T14:09:38Z", "uses": 1 },
"outcome": { "executed": true, "status": 201 },
"data_findings": [],
"prev_hash": "sha256:9c1e…",
"hash": "sha256:4b7a…"
}
What to leave out of the record
An audit trail that copies everything becomes a second store of your most sensitive data. The OWASP cheat sheet says access tokens, passwords, encryption keys, session identifiers, payment card data and sensitive personal data should usually not be recorded directly. For agents, leave out:
- The values of sensitive fields in requests and responses. Record the field and the action taken, such as "SSN masked", not the number.
- Prompts and model responses that contain personal data. If you must prove which content was involved, record a reference or a keyed hash. Plain hashes of short values such as phone numbers can be reversed by guessing.
- Credentials of any kind, including the token the agent presented.
- Full documents the agent read. Record the document ID and any finding, such as "hidden instruction detected", as covered in data protection for AI agents.
Investigators sometimes want content. If you keep it, put it in a separate store with stricter access, short retention and its own access log, not in the audit trail.
Denials and approvals belong in the record
Many teams log only successful calls. For agents, refusals are often the more useful evidence.
A denial shows that a control operated. An auditor testing "agents can't refund another customer's invoice" wants to see refused attempts, not just an absence of bad refunds. Denials also reveal attacks. A burst of refused calls from one agent can mean a prompt injection is steering it, or that it is probing for access. And denials expose broken grants: an agent refused the same legitimate call all day needs a policy fix.
At Northwind, four refund requests produced four different records. A $40 refund ran. A $450 refund was held for Dana in Finance and ran once after she approved it. A $4,500 refund was blocked by a limit of $2,000 per invoice per week. A refund on another customer's invoice was denied after the invoice was read. Each record is evidence that a specific rule worked; see spending limits for AI agents.
Approvals need their own fields: who asked, who approved, what exactly they saw, when, and how many times the approval may be used. Record that the approver was not the person the agent acts for. Separation of duties only counts as evidence if the log shows it. Human approval for agent actions covers the workflow.
Tamper evidence: hash chains and evidence in your own account
Logs count as evidence for AI agent actions only if you can show nobody altered them. The usual technique is a hash chain. Each entry includes a hash of the previous entry. Change or delete one entry, and every later hash stops matching.
AWS CloudTrail uses a version of this. It hashes each log file with SHA-256 and delivers an hourly digest file listing those hashes. It signs each digest, and each digest carries the previous digest's signature. AWS says this makes it "computationally infeasible to modify, delete or forge CloudTrail log files without detection."
A chain has limits. It detects edits inside the chain. It doesn't stop someone deleting the whole chain or its newest entries. Close those gaps:
- Sign the latest hash periodically and store it in a separate system with different administrators.
- Write entries to storage with retention locks, so they can't be overwritten.
- Number entries in sequence and report delivery gaps instead of hiding them.
- Log every access to the trail itself, as OWASP recommends.
Keep the authoritative copy in a cloud account you control, next to your services. A vendor's console is a useful view. Your evidence shouldn't depend on a vendor's retention settings, uptime or continued existence. Keeping it in your account also keeps sensitive metadata inside your boundary.
Mapping the AI agent audit trail to compliance frameworks
No framework prescribes a receipt format for agents. Several ask for evidence that an agent audit trail supplies. For AI agent compliance work, as of October 2026:
| Framework | What it asks (paraphrased unless quoted) | What agent records contribute |
|---|---|---|
| NIST AI RMF | GOVERN 1.6: inventory AI systems. MANAGE 4.1: post-deployment monitoring, including incident response, recovery and change management. MANAGE 4.3: track, respond to and document incidents and errors. | Inventory links; per-action history for incident timelines; policy versions for change records |
| ISO/IEC 42001:2023 | Requirements for an AI management system: the policies, objectives and processes for responsible development, provision or use of AI | Evidence that documented access rules, approvals and reviews ran for each agent |
| EU AI Act, Article 12 | High-risk AI systems "shall technically allow for the automatic recording of events (logs) over the lifetime of the system", for traceability | Automatic, per-event records with timestamps and identities |
| EU AI Act, Articles 19 and 26(6) | Providers and deployers keep the logs under their control for at least 6 months, unless other law says otherwise | Retention and access controls on the trail |
Read the EU rows carefully. The logging duties apply to high-risk AI systems, and whether an agent is high-risk depends on its use case, so check with counsel. Timing has also moved. The AI Omnibus was published in the Official Journal on 24 July 2026. According to the Future of Privacy Forum, it moves obligations for Annex III high-risk systems to 2 December 2027 and for Annex I systems to 2 August 2028. Article 19 also defers to EU data protection law, which can limit what you keep.
Sending agent receipts to a SIEM with OCSF
Your security team will want agent records in its security information and event management (SIEM) system, next to everything else. A shared schema saves mapping work. The Open Cybersecurity Schema Framework (OCSF) is an open-source schema for security events, built from categories, event classes and a shared attribute dictionary.
A tool call fits OCSF's API Activity class in the Application Activity category. As of October 2026, the schema's development branch (1.10.0-dev) also includes an AI Operation profile, with attributes for the agent (ai_agent), the model and the delegation the operation ran under. Check which schema version your SIEM supports before relying on it. One reasonable mapping:
| Receipt field | OCSF attribute |
|---|---|
| Agent identity and version | ai_agent.uid, ai_agent.version (AI Operation profile) |
| Acting for | actor.user, plus delegation.uid |
| Operation | api.operation |
| Target record | resources |
| Decision | actor.authorizations[].decision |
| Policy and version | actor.authorizations[].policy.name, .version |
| Owner, approval, chain hash | unmapped, or a custom extension |
Validate the mapping with a few real events before you build detections on it. Field names in a development branch can still change.
AI agent audit trail checklist
- Record every decision at the enforcement point, including allows, holds and denials.
- Write the agent, its owner and the person it acts for into every entry.
- Version your policies, and record the version on each decision.
- Record approvals with the approver, the exact call approved and the number of uses.
- Leave secrets, tokens and sensitive values out; record data types and actions instead.
- Chain entries with hashes, and sign or anchor the latest hash outside the chain.
- Keep the authoritative copy in an account you control, with retention locks.
- Report delivery gaps and log every read of the trail.
- Map entries to a schema your SIEM understands, and test detections on real events.
- Set retention per regulation and data class, and review it each year.
How AgentFort handles this
AgentFort keeps a receipt for every request: the agent's identity, the owner's grant, the policy and the outcome. Allowed and denied activity are both recorded and can be filtered. Data protection receipts say what was found, where, what was done and how long it took, never the values. Receipts are chained, so a missing or edited entry shows. They are kept on the customer's side and reconciled to the console, with delivery gaps reported. When an agent is refused, it gets a short reason and a receipt number, never the rule's details. See AgentFort Access, or request a demo.
Frequently asked questions
Are model provider logs enough for an AI agent audit trail?
No. Model invocation logs show which identity called which model and, if enabled, the prompt and response. They don't show the tool call that followed, the record it touched, the policy decision, the approval or the outcome at the service. They also hold exactly the content you usually want to keep out of an audit trail. Keep them as a supporting source, linked by request ID where you can.
What is the difference between an audit trail and observability tracing for AI agents?
Tracing is built for debugging and performance. It is often sampled, it may include full prompts and outputs, and teams can change or delete it freely. An audit trail is built for evidence. It records every decision without sampling, keeps sensitive values out, and is tamper-evident with controlled retention. You can feed both from the same enforcement point, but keep them as separate stores with separate access rules.
Do AI agent audit logs contain personal data?
Usually yes, even without prompts. The identity of the person an agent acted for, approver names and record IDs that point to customers are all personal data under laws such as the EU General Data Protection Regulation (GDPR). Minimize what you keep, use stable pseudonymous IDs where a name isn't needed, restrict who can search the trail, and set retention per data class. Record the type of sensitive data found, never the value.
Who should be able to read AI agent audit logs?
Security operations, internal audit and incident responders need search access across all agents. Agent owners should see entries for their own agents. Very few people need export rights, and nobody should be able to edit or delete entries. Log every query against the trail itself, because the audit trail reveals which customers and people agents served and is a target in its own right.
Can an AI agent audit trail show why the model made a decision?
Only partly. The trail records what the agent asked to do and why the control allowed, held or refused it. It can also record which model and agent version were involved. It can't reliably record the model's reasoning, because a model's stated explanation is generated text and may not reflect what drove the output. Treat the action record as the evidence and reasoning text as context.
Sources
- OWASP Logging Cheat Sheet
- Validating CloudTrail log file integrity, AWS documentation
- NIST AI Risk Management Framework, Core
- ISO/IEC 42001 offering, Microsoft compliance documentation
- EU AI Act Article 12: Record-keeping
- EU AI Act Article 19: Automatically generated logs
- The AI Act implementation timeline: what changes under the AI Omnibus (Future of Privacy Forum)
- Open Cybersecurity Schema Framework (OCSF) schema repository