Wise Agents
  1. Home
  2. Blog
  3. AI Agent Audit Logs: What to Record and How Long to Keep It

AI Agent Audit Logs: What to Record and How Long to Keep It

AI agent audit logs: the fields to record for every run, what AI Act Articles 12, 19 and 26(6) and GDPR say about keeping them, and a review routine.

A rhombus holding stacked log-entry lines, one with a gold dot and one with a small spark, on a night background.

An auditor asks a lending team a plain question about a decision an agent helped with last spring: what did it read, what did it propose, and who approved it? (A typical request, not a client.) The team opens the log. It holds a final answer and a timestamp. Everything in between is either gone or sits in a raw dump of prompts that nobody is allowed to open.

Good AI agent audit logs prevent that scene. They record, for every run, who or what started it, which agent version and model ran, what the agent read and called, what it proposed, who approved it and what happened next. They hold references to personal data, not copies. For a high-risk system the AI Act sets a floor of six months for keeping those logs. GDPR asks you to keep them no longer than you need, and to write down why.

We read the AI Act, the GDPR, DORA’s logging rules and the regulator guidance cited here on 15 November 2026. This is an engineer’s reading for your DPO and counsel to confirm, not legal advice. The dates in the AI Act changed with the Digital Omnibus on AI, so check them again before you rely on them. Our earlier posts cover the seven questions a DPO asks about an agent and what applies to a deployer. This one goes deep on the record itself.

What should AI agent audit logs answer?

Start from the questions, not from the fields. After an incident, a complaint or an inspection, someone will ask:

  1. Who started this run: a person, a schedule, another system?
  2. Which agent ran, in which version, on which model?
  3. What did it read and call, and what did those tools return?
  4. What did it propose, and on what data?
  5. Who approved it, what did they see, and did they change anything?
  6. What happened next, and where is that result stored?
  7. Who has looked at this log since?

A debugging trace answers none of these well. It is built for engineers, holds full content, and is usually short-lived. An audit trail is built for an auditor or a DPO, holds little content, and has to stay readable for months. We keep the two apart, and we suggest you do too: they have different readers, different risks and different retention, and the next sections show why.

Do the AI Act’s logging rules apply to your agent?

Only to high-risk systems. Article 12 opens with “High-risk AI systems shall technically allow for the automatic recording of events (logs) over the lifetime of the system.”

An agent that evaluates the creditworthiness of natural persons, or prices life and health insurance, is on the Annex III list (point 5(b) and 5(c)). Whether yours is on it is a classification question. Our post on the AI Act for deployers covers the risk classes.

The date matters too. Under the Digital Omnibus on AI, the high-risk rules for Annex III systems apply from 2 December 2027 (Article 113(c)(i)). Some guides written before the Omnibus, such as this one, give 2 August 2026, which no longer holds for Annex III systems.

Six provisions matter for those systems. Five deal with logs, and the sixth, Article 18, is often confused with them. We read the amended text on the Commission’s AI Act Service Desk.

ArticleWhose dutyWhat it asks
12Provider (the builder)Design the system so it records events automatically, for three purposes: spotting risk situations or a substantial modification, supporting post-market monitoring, and supporting the deployer’s monitoring under Article 26(5)
13(3)(f)ProviderTell deployers how the system lets them collect, store and interpret the logs
16(e) and 19ProviderKeep the logs under its control for at least six months, unless other law says otherwise
21(2)ProviderGive an authority access to the logs when it makes a reasoned request
26(5) and 26(6)Deployer (the user)Monitor the system, and keep the logs under your control for at least six months, unless other law says otherwise
18ProviderKeep the technical documentation for ten years. This is documentation, not logs, and the two periods are often mixed up

Two phrases carry most of the weight. The first is “to the extent such logs are under their control”. If the vendor’s platform holds the logs, your contract has to give you access to them and say who keeps what. The second is “unless provided otherwise in applicable Union or national law, in particular in Union law on the protection of personal data”. The six months is a default floor, and data protection law can override it.

Financial institutions get a specific rule. Where Union financial services law sets internal governance requirements, Article 26(6) says they “shall maintain the logs as part of the documentation kept pursuant to the relevant Union financial service law”. Your log then sits inside your existing record-keeping regime, with that regime’s periods.

The Regulation lists minimum log fields for one case only: remote biometric identification systems under Annex III point 1(a). For everything else, Article 12(2) asks for logging “appropriate to the intended purpose”, which leaves the design to you. That is why the schema below gives a reason for every field.

What does GDPR ask of a log?

A log of an agent that handles people’s cases is full of personal data, and it holds two sets: the people the agent handled, and the staff who approved. The French regulator, the CNIL, says so directly. Its logging recommendation (deliberation 2021-122) notes that logs also contain data about authorized users, which can reveal their professional behavior, so you should scale what you collect about them to the sensitivity of the main processing.

The rules that bite, article by article:

  • Purpose and minimization, Article 5(1)(b) and (c). Data must be collected for specified, explicit and legitimate purposes, and be “adequate, relevant and limited to what is necessary”. Logging every prompt in full fails this test unless you can show the need. The CNIL adds that reusing log data for any purpose other than securing the processing may be a misuse of purpose.
  • Storage limitation, Article 5(1)(e). Data kept “for no longer than is necessary for the purposes”. The European Data Protection Board’s guidelines on data protection by design say controllers must determine what personal data and what length of storage is necessary for back-ups and logs, and must be able to justify the period.
  • Security, Articles 5(1)(f) and 32. The log is also a security control. The EDPB says logs “shall be protected from unauthorised and accidental access and change and reviewed regularly”.
  • Accountability, Articles 5(2) and 25. You must be able to demonstrate compliance. The log is part of how you do.
  • Access, Article 15. A person may ask what you hold about them and, for automated decision-making, for “meaningful information about the logic involved”. In Pankki S (C-579/21), the Court of Justice held that information about consultations of a person’s data, specifically the dates and purposes, is information that person has the right to obtain. It did not give a general right to the identity of the employees involved, unless that is essential to exercise their rights. The case concerned bank staff reading a customer’s file. An agent reading that file is a close parallel, so we would plan for the same question.
  • Erasure, Article 17. The right to erasure does not apply to the extent that processing is necessary for compliance with a legal obligation, so a log you must keep by law can stay. Personal data kept beyond that need has no such exemption, so an erasure request can reach it.

Put together, the six-month floor and the minimization rule do not collide as long as you read the floor correctly. The AI Act asks you to keep logs for “a period appropriate to the intended purpose”, at least six months. GDPR gives no number. So you choose a period for each type of log, write the reason down, keep less personal data in each entry, and delete on a schedule.

What should one run record contain?

Think of the record as a chain of events that share a run id. Each event carries a few fields. The content itself, the text of the customer’s message or the retrieved document, stays where it already lives, and the log points to it.

One agent run drawn as six events, with the fields each event records and the content that stays out of the log.

Example run record. The skeleton on the top row is kept for the long period. The content layer on the bottom row stays in the system of record, or lives briefly.

Here is the field-by-field version, with the reason for each field.

FieldWhat it holdsWhy it earns its place
run_id, event_id, seqOne id per run, one per event, and the orderA reviewer can replay a run in order and tell a gap from a quiet run
tsTime of each event in UTC, from a synchronized clockThe CNIL asks for a timestamp on every record. DORA’s technical standard requires financial entities to synchronize clocks to a documented reliable time source
actorWho or what started the run: a user’s pseudonymous id, a schedule or an upstream systemThe CNIL asks for the author to be individually identified. Store an id, not a name
agent, agent_versionWhich agent, and which approved specification and releaseTies every action to the instructions in force. OpenTelemetry’s GenAI conventions name gen_ai.agent.id and gen_ai.agent.version for this
modelThe model requested, the model that answered, and the route named in the contractOpenTelemetry names gen_ai.request.model and gen_ai.response.model. A model swap is a change you want visible in the record
input_refA case or message id and a keyed hash of the input, not the textShows what came in without a second copy of it
sourcesIds and versions of the documents or records the agent retrievedLets you explain later why it proposed what it did, and show that the source was current
tool_callsTool name, call id, status, duration, and arguments by referenceThe actions the agent took. OpenTelemetry says tool arguments and results may contain sensitive information
proposalThe action proposed: its type and outcome class, not the narrativeWhat the approver saw when they decided
checksRules, limits and safety checks that fired: a cost cap, a blocked tool, a stopArticle 12(2)(a) wants risk situations identifiable, and Article 26(5) wants the deployer to monitor
approvalApprover id and role, the decision (approved, rejected, changed), scope, time and expiryEvidence that oversight was real. Article 26(2) asks for people with the competence and authority to oversee the system
outcomeExecuted, rejected or failed, and the id of the record it wroteCloses the chain, so a reviewer can go from a payout back to its input
log_access (a separate stream)Who read, exported, changed or purged the log, and whyThe CNIL suggests an alert when an authorized account changes log data. Questions like the one in Pankki S need the purpose of each access too
retention_classA label on each event that names its retention periodLets the purge job run by itself. The EDPB lists automation of deletion as a design element

Here is the same idea as a record you can copy. Every value is an example.

{
  "run_id": "run_8f21",
  "seq": 4,
  "ts": "2026-11-15T09:41:07Z",
  "type": "approval",
  "agent": "claims-triage",
  "agent_version": "2026-11-02.3",
  "actor": "usr_pseudo_2c91",
  "input_ref": {"case": "C-10442", "hmac": "9b1e…"},
  "proposal": {"action": "refuse", "reason_code": "R7", "source_ids": ["doc_113@v6"]},
  "approval": {"by": "usr_pseudo_77ad", "role": "claims_lead", "decision": "changed", "expires": "2026-11-15T10:41:07Z"},
  "retention_class": "events-12m"
}

What to leave out by default matters as much. Skip the full prompt and the full answer, the agent’s reasoning text, special categories of data, and any secret. Some guides tell you to capture the agent’s chain of thought, and that is the quickest route to an unreadable, over-retained log. OpenTelemetry’s registry says gen_ai.input.messages is “likely to contain sensitive information including user/PII data”, and that system instructions, tool arguments and tool results “may contain sensitive information”. Treat content as something you switch on for a reason.

Finally, protect the log itself. The CNIL recommends keeping it apart from the main system, writable by the application and not overwritable, and time-stamping and signing entries when they are created. DORA’s technical standard asks financial entities to protect log information against tampering, deletion and unauthorized access, and to detect a failure of the logging system.

A standard on this topic is close. ISO/IEC 24970 describes “common capabilities, requirements and a supporting information model for logging of events in AI systems”, and the ISO page lists it as an international standard under publication. We have not read the text, so we don’t build on it yet, but it is worth watching.

How long should you keep each log?

There are two anchors and one rule. The floor is the AI Act’s six months for a high-risk system. The regulator’s guidance is the ceiling you will meet in practice. The CNIL recommends six months to a year for standard logs. It accepts up to three years in the most common cases where internal control is the documented reason, and it says anything longer needs a case-by-case analysis. The rule is that every period needs a written reason.

Timeline of retention anchors: AI Act six-month floor, CNIL one and three years, ten-year documentation period.

Where each anchor sits. The AI Act floor and the CNIL range apply to logs. The ten-year period in Article 18 applies to technical documentation, not to logs.

Here is a starting table. The anchors are sourced. The “starting point” column is our suggestion, labeled Example, and your DPO and counsel set the real period.

Log layerWhat it holdsAnchorStarting point (Example)
Event skeletonIds, timestamps, versions, tool names, outcomes, no contentAt least six months for a high-risk system (Articles 19, 26(6)). CNIL standard: six months to one year12 months, with the reason written down
Approval recordWho approved, what they saw by reference, the decisionTied to the decision it supports. Some Annex III decisions carry a right to explanation (Article 86)The life of the decision plus the period in which it can be challenged. Counsel names the number
Content layerPrompts, outputs, retrieved text, if you keep them at allMinimization and storage limitation (Article 5(1)(c), (e))As short as the purpose allows, for example 30 days for debugging
Access and security logWho read, exported, changed or purged the logCNIL: six months to one year, up to three years with a documented internal-control reason12 months
Incident fileReports, investigation, fixesThe AI Act’s serious-incident deadlines (15, 10 and 2 days, Article 73) are reporting deadlines, not retention periods. DORA asks entities to log incidentsSame as the incident file in your policy
Technical documentationNot a logTen years after the system is placed on the market or put into service (Article 18)Ten years

A few points make the table work.

Split the log in two. The skeleton carries no content and as little personal data as you can manage, so it can stay for the long period. The content layer is where the risk sits, so it gets the short one. A key joins them. An erasure request then reaches the content layer and the key, while the skeleton keeps serving the six-month floor. The CNIL points the same way when the underlying data is kept for less than six months: keep pseudonymous identifiers in the log, or purge the main-data fields automatically when their time runs out.

Financial entities set the period themselves. DORA’s technical standard on ICT risk management says that, under the standard framework, the entity “shall establish the retention period, taking into account the business and information security objectives, the reason for recording the event in the logs, and the results of the ICT risk assessment”. It also requires you to define which events are logged and to cover access control, change management and ICT operations. The agent’s audit log sits beside those logs, it does not replace them.

A tool’s default is not a policy. LangSmith keeps base traces for 14 days, and extended traces for 180 days by default (the default as of 14 September 2026). Langfuse deletes nothing automatically until you set a retention policy, and the minimum you can set is 3 days. Neither default is a decision about your agent’s records.

To set a period, five steps are enough:

  1. Name the purpose of each log layer (security, oversight evidence, explanation to a person).
  2. Find the legal floor for it: the AI Act for a high-risk system, your sector rules, a contract.
  3. Pick a period and write the reason. The EDPB says you must be able to disclose the rationale and legal grounds for a retention period.
  4. Automate the purge, and log each purge as an event.
  5. Review the period each year, and when the agent or its risk class changes.

Redact, reference or hash? How to keep personal data out of the log

The aim is a log that can prove what happened without becoming a second customer database. Four techniques do most of the work, and each fits a different field.

Decision tree for one value: leave it out, log a reference, log a keyed hash, or keep it briefly in a content layer.

Ask the questions in order for each value. Most fields end at “leave it out” or “reference”.

TechniqueWhat it doesUse it forWatch out for
Leave it out or mask itThe value never reaches the logSecrets, special categories of data, anything you can’t name a use forYou can’t reconstruct what was masked, so choose with care
ReferenceThe log holds an id that points to the record in the system you already keepCustomer, case, document and policy dataWhen the source record is erased, the reference points nowhere, which is usually what you want
Plain hashA fixed-length fingerprint of the valueAlmost nothing in this listThe Article 29 Working Party’s opinion on anonymization techniques notes that if the input range is known, hashing every possible value rebuilds it. A national identification number is its example. Salting reduces the risk but may not remove it
Keyed hash (HMAC)A fingerprint made with a secret key that you store apart from the logMatching the same person or case across entries without storing the idThe key becomes the sensitive asset. The same opinion says it is much harder for an attacker to replay the function without it

Two cautions apply to all of them. Pseudonymized data is still personal data. GDPR recital 26 says personal data that “could be attributed to a natural person by the use of additional information should be considered to be information on an identifiable natural person”. The EDPB suggests pseudonymizing logs as a security measure, for example with hashing or encryption, but that lowers the risk and does not take the log out of GDPR. And dates, times and amounts in an entry can still identify a person, so ask your DPO whether the skeleton still counts as personal data once the key is gone.

The second caution is about the word “immutable”. Guides often ask for an immutable log, and appending is a good property for events. But a person’s personal data can’t sit in a store you promise never to change. Put the append-only skeleton in one place and the personal content in another, joined by the key, and an erasure request touches only the second.

Who reads the log, and how often?

A log nobody reads is a liability that happens to be well organized. The CNIL’s recommendation says the main reason for keeping logs is active security. You analyze them in real time or in the short term to spot abnormal operations, and you set up a formal process to raise and handle alerts. For an agent, the same idea covers oversight. Article 26(5) asks deployers to monitor the operation of the system, and our post on designing the approval step explains why approval and override rates, per reviewer, show whether the human is still in the loop.

This routine is our suggestion. The frequencies are examples, so set your own.

  1. Every day, automatically. Alerts for a logging failure, a tool call outside the agent’s specification, a cost cap or stop that fired, and a run that reached an outcome with no approval where one was needed. DORA’s standard asks financial entities to detect a failure of the logging system.
  2. Every week, a person. Pick a handful of runs and trace one from its outcome back to its input, using only the log. If you can’t, a field is missing.
  3. Every month, the process owner. Review approval rate, override rate, time per review, errors and new tools, and the list of who can read the log. Write down what you decided.
  4. Every quarter, the DPO. Check that the purge ran and was logged. Answer a Pankki-type question for one real person, covering who consulted their data, when and why, and time how long it takes.
  5. After every release or model change. Check that every field still fills, and that agent_version and model changed when they should.
  6. Every year. Re-justify each retention period, and update the DPIA if the log’s content changed.

How do we record a run at Wise Agents?

On the Wise Agents platform every run is recorded step by step: what came in, which sources and tools were used, which model answered and who approved. Approvals keep who asked, who decided, what the approval covered and when it expires. A read that is audited is written before the tool runs. Secret-shaped strings and stored credential values are scrubbed from tool results and records, and content is kept out of our telemetry by default. Deleting an agent erases its conversations, runs, files, knowledge, credentials, memory and keys, with a receipt for each step.

That gives you the raw material for the schema above. On request we provide extracts of the records, which you can hand to an auditor or a DPO, and the retention period you need goes into the contract. The trust page shows the run-record layer next to Articles 12 and 26(6), and our AI Act map gives Article 12 and Article 26 a row each.

The test we would want a vendor to pass is simple: pick one case and ask for its record. If the answer is a final output and a timestamp, the log is not an audit trail yet.

Bring one process. In 45 minutes you get a first view of its risk class, the controls it needs and whether an agent is the right tool at all. Book a scoping call.

Questions

Does the AI Act require audit logs for every AI agent?

No. Article 12 applies to high-risk AI systems, and for Annex III systems that is from 2 December 2027. An agent that is not high-risk has no AI Act logging duty, but GDPR accountability and security duties, and sector rules such as DORA, still push you to keep a record of what it does.

Is six months the right retention period for AI agent logs?

Six months is the floor in Articles 19 and 26(6) for a high-risk system, and it gives way to other Union or national law, including data protection law. GDPR sets no number: you choose a period for each log type and write down why. The French regulator's guidance is six months to one year for standard logs.

Can we log full prompts and outputs?

You can, but the law does not ask for it and GDPR makes it expensive. Prompts and outputs often hold personal data, so keep them by reference or in a short-lived layer, and keep the thin event record, with ids and timestamps, for the long period.

Does a person have a right to see the log of who accessed their data?

In part. The Court of Justice held in Pankki S (C-579/21) that a person may obtain the dates and purposes of consultations of their personal data. It did not give a general right to the names of the employees involved. Plan to answer that question for any person within the normal one-month access deadline.

Sources

  1. eur-lex.europa.eueur-lex.europa.eu/eli/reg/2024/1689/oj
  2. ai-act-service-desk.ec.europa.euai-act-service-desk.ec.europa.eu/en/ai-act/annex-3
  3. ai-act-service-desk.ec.europa.euai-act-service-desk.ec.europa.eu/en/ai-act/article-113
  4. digital-strategy.ec.europa.eudigital-strategy.ec.europa.eu/en/news/ai-omnibus-enters-force
  5. www.helpnetsecurity.comwww.helpnetsecurity.com/?p=366232
  6. ai-act-service-desk.ec.europa.euai-act-service-desk.ec.europa.eu/en/ai-act/article-13
  7. ai-act-service-desk.ec.europa.euai-act-service-desk.ec.europa.eu/en/ai-act/article-16
  8. ai-act-service-desk.ec.europa.euai-act-service-desk.ec.europa.eu/en/ai-act/article-21
  9. ai-act-service-desk.ec.europa.euai-act-service-desk.ec.europa.eu/en/ai-act/article-18
  10. ai-act-service-desk.ec.europa.euai-act-service-desk.ec.europa.eu/en/ai-act/article-73
  11. ai-act-service-desk.ec.europa.euai-act-service-desk.ec.europa.eu/en/ai-act/article-86
  12. eur-lex.europa.eueur-lex.europa.eu/eli/reg/2016/679/oj
  13. curia.europa.eucuria.europa.eu/jcms/upload/docs/application/pdf/2023-06/cp230107en.pdf
  14. www.cnil.frwww.cnil.fr/sites/cnil/files/atoms/files/recommandation_-_journalisation.pdf
  15. www.cnil.frwww.cnil.fr/fr/la-cnil-publie-une-recommandation-relative-aux-mesures-de-journalisation
  16. www.edpb.europa.euwww.edpb.europa.eu/sites/default/files/files/file1/edpb_guidelines_201904_dataprotection_by_design_and_by_default_v2.0_en.pdf
  17. ec.europa.euec.europa.eu/justice/article-29/documentation/opinion-recommendation/files/2014/wp216_en.pdf
  18. eur-lex.europa.eueur-lex.europa.eu/eli/reg_del/2024/1774/oj
  19. eur-lex.europa.eueur-lex.europa.eu/eli/reg/2022/2554/oj
  20. opentelemetry.ioopentelemetry.io/docs/specs/semconv/registry/attributes/gen-ai/
  21. www.iso.orgwww.iso.org/standard/88723.html
  22. docs.langchain.comdocs.langchain.com/langsmith/billing
  23. langfuse.comlangfuse.com/docs/administration/data-retention
  24. www.fast.iowww.fast.io/resources/ai-agent-audit-logging.md
  25. wiseagents.aiwiseagents.ai/trust.html
  26. wiseagents.aiwiseagents.ai/ai-act.html
  27. wiseagents.aiwiseagents.ai/blog/human-oversight-in-practice
  28. wiseagents.aiwiseagents.ai/contact.html

Read on or before 15 November 2026. Not legal advice: your counsel and data protection officer decide.

Written by

The Wise Agents team

Engineers who build and run AI agents for regulated companies. We read every article we cite on the day we state, and say what your counsel or DPO must confirm.

About us

Bring one process. Leave with a risk class, a pass bar and a plan.

A 45-minute scoping call with the people who would build it. You get a first view of the AI Act risk class, the controls it needs, and whether an agent is the right tool at all.

Or read the trust page first