AI Governance
AI Agent Audit Trail: What to Log So You Can Explain Every Action
By Clateway Technology Council · · 5 min read
Key takeaways
What an AI agent audit trail must capture to explain any action: identity, delegation, tool calls, approvals, retention and tamper-evidence.
Bottom line: an AI agent audit trail must let you answer four questions about any action, months later: which agent did it, for whom, why, and who approved it? That takes more than application logs. You need one connected trace per task covering prompts, tool calls, data retrieved, identities and approvals. Store it tamper-evident, keep it for at least six months (longer where your regulator expects it), and protect it like the sensitive data it contains.
Why agents need a different kind of audit trail
Traditional audit logs record that a user changed a record. An agent gets there through a chain: it reads a ticket, retrieves three documents, calls a model twice, invokes two tools and then changes the record. If you only log the last step, you can't tell whether the agent did what it was asked or what a hidden instruction in one of those documents told it to do.
The Cloud Security Alliance makes the point in its guide to AI incident response (14 August 2026): "there is no response without logging". Isolated events without correlation "risk obscuring the full causal chain of an attack". Agents are also non-deterministic. You can't re-run an incident and expect the same result, so forensics depend on replaying the record.
The evidence that this gap is real: in CERT-In's advisory of 15 October 2026, none of the organisations whose systems were reached by AI agents had detected it (The Hacker News, 16 October 2026).
What an AI agent audit trail must capture
| Field group | What to record | Why it matters | |---|---|---| | Identity | Agent ID and version, the human or system that delegated the task, the credential used | Attribution; see AI agent identity management | | Intent | The task or instruction received, its source and the autonomy level | Shows what the agent was supposed to do | | Model calls | Model and version, system prompt version, token counts, finish reason | Reproducibility, cost, drift | | Retrieval | Queries sent and document IDs returned | Shows what content could have steered the agent | | Tool calls | Tool name, arguments, result status, target system and records touched | The actual actions and their blast radius | | Approvals | Reviewer identity, timestamp, what they saw, decision | Proves human oversight worked; see human in the loop for AI agents | | Guardrails | Refusals, blocked actions, policy hits | Early warning of goal hijack attempts | | Correlation | Trace ID linking every step, parent and child agents | Rebuilds the full chain across agents |
Okta's guidance on least privilege for AI agents adds one important point: each approval record should hold the reviewer's identity, the timestamp, the decision context and the agent's original request. Together these form a complete chain of custody.
Use OpenTelemetry GenAI conventions as the backbone
You don't have to invent a schema. The OpenTelemetry semantic conventions for generative AI (OpenTelemetry blog, 14 May 2026) define a standard trace shape. A top-level invoke_agent span has child chat spans for each model call and execute_tool spans for each tool call. Attributes such as gen_ai.request.model, gen_ai.usage.input_tokens and gen_ai.response.finish_reasons are standardised. Popular coding agents already emit this telemetry.
Two caveats:
- Content capture is off by default. By default only metadata is recorded. Prompts, tool arguments and results are captured only when you switch them on. Decide deliberately which agents need content capture for audit, and redact where you can.
- Observability is not an audit trail. Traces built for debugging are often sampled, short-lived and editable. An audit trail must be complete for in-scope actions, tamper-evident and kept under a retention policy. Send the audit-relevant spans to a separate, append-only store.
How long to keep AI agent logs
- EU AI Act: deployers of high-risk AI systems must keep the logs the system generates automatically for at least six months (Article 26(6)), and providers have matching duties under Articles 12 and 19. For Annex III uses this applies from 2 December 2027; see EU AI Act and AI agents.
- CERT-In (India): keep API logs for at least 180 days, and keep a tamper-resistant log of agent actions, at least for actions touching production systems and data.
- Sector rules (financial services, health, public sector) often require longer retention. Use the longest one that applies.
Balancing the audit trail with privacy
Agent prompts and retrieved documents often contain personal data, so a full audit trail is a personal-data store in its own right. CSA's advice: don't stop logging; treat interaction logs as sensitive-data archives. Apply strict access control, time-bound retention, and redaction or masking where you can. A log you can't legally keep is as useless in an investigation as one you never collected. Record the purpose and retention in your GDPR records, and reuse that analysis in any AI Act impact assessment.
Make the audit trail tamper-evident
- Write audit events to append-only or write-once storage, separate from the agent's own runtime.
- Never give the agent's identity permission to delete or edit its own logs.
- Hash-chain or sign batches of events so gaps and edits can be seen.
- Alert when logging stops. A silent agent is a finding in itself.
Frequently asked questions
What is an AI agent audit trail?
It is a complete, tamper-evident record of what an AI agent did, for whom and why. It covers the instruction, model calls, data retrieved, tool calls, approvals and results, all linked by one trace ID so the whole chain can be rebuilt later.
Do we need to log full prompts and responses?
For high-impact agents, usually yes, because without content you can't prove whether an action came from the user or from injected text. For low-risk agents, metadata may be enough. Decide per autonomy level and redact personal data where possible.
How long should AI agent logs be kept?
At least six months for high-risk systems under the EU AI Act, and at least 180 days for API logs under CERT-In guidance. Sector regulation may require more. Set retention per agent class and delete on schedule.
Is an observability platform enough for an AI agent audit trail?
Not on its own. Observability tools are built for debugging and often sample or overwrite data. Use them to collect telemetry, then send audit-relevant events to an append-only store with access control and fixed retention.
---
Part of Clateway's agent governance series. Next: AI agent incident response.
Topics: agentic AI, AI governance, EU AI Act
Related articles
- Human in the Loop for AI Agents: Which Actions Need Approval – Human in the loop for AI agents: the five actions that need approval and how to design approvals people actually review.
- Shadow AI Policy: A Vendor-Neutral Guide for CIOs That Actually Reduces Risk – A shadow AI policy that works: why bans fail, the five rules that matter, and a 90-day rollout CIOs can run without buying another tool.
- AI Agent Governance Framework: How to Control Agents by Autonomy Level – A four-level AI agent governance framework for IT leaders: classify agents by autonomy, govern embedded SaaS agents and meet EU AI Act dates.
- AI Agent Security: The New Identity Management Frontier Demanding C-Suite Attention – As AI agents proliferate across enterprise systems with unprecedented autonomy and access privileges, organizations face a fundamental shift in identity and access management. The emergence of…
- Enterprise AI Agents Enter Production: Advanced Models Drive Autonomous – Major cloud providers are launching production-ready AI agent platforms powered by sophisticated models like GPT-6 variants and Claude Opus 5.5, marking a fundamental shift from experimental AI to…
How Clateway can help
- Technology and cyber board advisory – Independent technology and cyber expertise for boards and supervisory boards: advice on management's plans, NIS2 accountability, AI governance and director…
- AI agents for IT, security and compliance – An AI workforce for technology leaders: agents such as an Information Security Officer, SOC analyst or architecture reviewer that read your data and propose…
- AI governance for the enterprise – Use AI safely across your organisation: guardrails per company, private AI routing, zero data retention, AI activity logs, rate limits and an AI kill switch.