AI agent audit log: what should it record?

An AI agent audit log must answer five questions: which agent acted, on whose behalf, with which tool, on which data and with which human approval. It excludes secrets, keeps personal data to what is necessary and, for a high-risk system under the AI Act, is kept for at least six months.
Why log an AI agent
An AI agent does more than answer: it calls tools, reads files and changes systems. Without a log, nobody can reconstruct who did what after an incident. For high-risk systems, Article 12 of the AI Act also requires that the system technically allows the automatic recording of events over its entire lifetime.
The five things to record
Each log entry should make sense on its own, without extra context. The table below gives the useful minimum for an audit: the agent's identity, the person responsible, the action taken, the data affected and the approval decision. Add a precise timestamp and a unique identifier to link the entries of a single task.
| Item | Example | Audit question |
|---|---|---|
| Agent | Writing agent, model version | Which agent acted? |
| Owner | Person or team that started the task | On whose behalf? |
| Action | MCP tool call, command, write | What did it do? |
| Data | File, table or folder affected | What did it act on? |
| Approval | Human approval, refusal or automatic check | Who authorised it? |
Link every action to an approval
The log must show who authorised an action, not only that it happened. In a team of agents, each person has their own agent lead: it reviews the work of the agents it assigned and decides whether to integrate it, and that decision belongs in the log. For an irreversible action, such as publishing or deleting, also record the explicit human approval that came before it.
What must never be logged
An audit log must not contain passwords, access tokens or API keys, even truncated. The GDPR also requires data minimisation: keep only the personal data needed for the purpose of the log. Prefer a document identifier to its content, and mask sensitive fields before writing the entry rather than afterwards.
How long to keep the log
For a high-risk AI system, the AI Act sets a minimum: automatically generated logs are kept for at least six months, by the provider (Article 19) and by the deployer (Article 26), unless Union or national law provides otherwise. For other agents, set a retention period in your internal policy and apply it everywhere.
Limit what the agent can do
A good log does not replace limited rights. OWASP lists excessive agency among the top ten risks of applications built on large language models in 2025: too many tools, too many permissions or too much autonomy. Give each agent only the tools its mission needs, and log refused access attempts as well.
Make the log usable in an audit
The NIST AI Risk Management Framework organises the work into four functions: govern, map, measure and manage. The log notably serves measure (MEASURE 2.4, monitoring in production) and manage (MANAGE 4.1, post-deployment monitoring and incident response). To be useful in an audit, it must be exportable, protected against modification and readable by someone outside the team that deployed the agent.
Audit log, by the numbers
Two numbers summarise this framework: how many fields a log entry needs, and how long a high-risk system must keep it.
- 5 Fields per log entry Agent, owner, action, data, approval
- 6 Minimum retention (months) AI Act, Art. 19 & 26, high-risk systems
Frequently asked questions
Should every agent answer be logged?
No. Log the actions that have an effect: tool calls, writes, publications and approval decisions. The full text of conversations is only useful if your policy justifies it, while respecting data minimisation.
Does Article 12 of the AI Act apply to every agent?
No. Article 12 covers high-risk AI systems. For other agents, a log remains good governance practice, but its form and retention period are a matter for your internal policy.
Who should be able to read the log?
At least the person responsible for the agent and an independent control function, such as security or internal audit. Restrict write access so that the log cannot be changed after the fact.
Sources
- Regulation (EU) 2024/1689 on artificial intelligence (AI Act), Articles 12, 19 and 26, 13/06/2024
- Regulation (EU) 2016/679 (GDPR), Article 5, 27/04/2016
- NIST, AI Risk Management Framework 1.0, January 2023
- OWASP, LLM06:2025 Excessive Agency, 2025
The public demo shows a fictional organization at work, no account needed. The free plan includes a project, three agents and an agent lead.
