AI audit trails must capture system inputs, outputs, operator interactions, performance metrics, and decision rationale. The EU AI Act Article 12 mandates automatic logging for high-risk AI systems with retention aligned to the system's intended purpose, typically at least the duration of regulatory obligations under Article 19.
AI Audit Trail Requirements: What to Log, How Long to Keep, and Access Rules
Legal Foundation for AI Audit Trails
Article 12 of the EU AI Act establishes that high-risk AI systems shall be designed and developed with capabilities enabling automatic logging of events ("logs") over the lifetime of the system. These logs must be adequate to enable post-market monitoring per Article 72 and traceability of the AI system's functioning.
This requirement intersects with GDPR obligations. Article 22(3) of the GDPR gives data subjects the right to obtain human intervention in automated decision-making, which requires logs sufficient to reconstruct and explain decisions. Article 30 of the GDPR mandates records of processing activities that must include AI processing operations.
What to Log
Mandatory Logging Events Under the EU AI Act
- Periods of each use of the system (start, duration, end)
- The reference database against which input data is checked
- Input data for which the search has led to a match
- Identification of natural persons involved in the verification of results (per Article 14)
Recommended Additional Logging
| Category | Events to Log | Rationale |
|---|---|---|
| Model operations | Model version, inference parameters, confidence scores | Reproducibility, drift detection |
| Data pipeline | Data source, preprocessing steps, data quality flags | Data governance (Art. 10) |
| Human oversight | Operator overrides, escalation decisions, review outcomes | Oversight verification (Art. 14) |
| System health | Error rates, latency, resource utilization | Robustness monitoring (Art. 15) |
| Access events | Who accessed the system, what actions were taken | Security audit, GDPR Art. 32 |
| Incidents | Anomalies, failures, bias detections | Incident reporting (Art. 62) |
Retention Periods
Article 19(1) of the EU AI Act requires providers to keep logs automatically generated by their high-risk AI systems, to the extent such logs are under their control, for a period appropriate to the intended purpose of the high-risk AI system, of at least six months, unless provided otherwise in applicable Union or national law.
Sector-specific requirements may extend this period significantly.
| Context | Minimum Retention | Authority |
|---|---|---|
| EU AI Act general | 6 months (minimum) | Art. 19(1) |
| Financial services (MiFID II) | 5 years | MiFID II Art. 16(6) |
| Medical devices | 10 years (15 for implants) | MDR Art. 10(8) |
| GDPR processing records | Duration of processing + limitation period | GDPR Art. 5(1)(e), Art. 30 |
| Employment decisions | Varies by member state (typically 2-6 years) | National labor law |
Access Rules and Controls
Logs must be accessible to deployers per Article 26(5) and to market surveillance authorities per Article 72. However, access must be controlled to protect personal data, trade secrets, and system security.
- Implement role-based access control (RBAC) with principle of least privilege
- Maintain an access log for the audit logs themselves (meta-logging)
- Ensure logs are available in machine-readable format for regulatory requests
- Separate personal data from operational logs where feasible to simplify GDPR compliance
- Encrypt logs at rest and in transit per ISO/IEC 27001 controls
Technical Implementation
Architecture Considerations
Audit trail systems should be append-only to prevent tampering. Consider using write-once storage, cryptographic chaining (hash chains), or immutable ledger technologies to ensure log integrity. ISO/IEC 27001 Annex A control A.12.4 provides baseline guidance for event logging.
Scalability
AI systems processing millions of transactions generate substantial log volumes. Design storage and retrieval architecture with production-scale volumes in mind. Tiered storage (hot/warm/cold) allows cost-effective retention while maintaining accessibility for regulatory requests.
Common Pitfalls
- Logging only outputs without inputs makes decision reconstruction impossible
- Storing logs in formats that cannot be efficiently queried delays regulatory responses
- Failing to include model version information makes performance comparisons unreliable
- Retaining personal data in logs beyond necessity violates GDPR data minimization (Art. 5(1)(c))
Check your AI compliance readiness — free.
Take the Readiness Check 3 minutes · 10 questions · no signup requiredThis article is for informational purposes only and does not constitute legal advice. Regulatory requirements change frequently — verify current rules with official sources. Built by Sawai Gyoseishoshi Office, Hiroshima, Japan.