What the rules point to
For high-risk AI systems, the AI Act requires technical capability for automatic recording of events over the system's lifetime, and deployers are expected to keep the logs under their control for a period appropriate to the intended purpose, generally at least six months. Those high-risk obligations now apply from late 2027 and 2028, but building logging into a system is far easier at design time than later.
Separately, the GDPR's accountability principle means you must be able to demonstrate how personal data is processed, while data minimization and storage limitation mean you should not keep more than you need. Logs sit in the middle of both.
What to record
Aim for enough to reconstruct a decision after the fact. That usually includes a request identifier and timestamp; the model and version; the prompt template and configuration versions; the sources retrieved; any tool calls and their results; the output; and what a human reviewer did, including overrides and the reason. Record errors, guardrail triggers, and fallbacks.
Record references and hashes where possible instead of full content. Store identities as pseudonymous identifiers that can be resolved only by authorized staff.
Capture the chain of events
Request, context, model version, tools, output, and human action tied together by one identifier.
Minimize content
Prefer identifiers, references, and redacted text over raw personal data wherever you can.
What to leave out, and how to protect the rest
Leave out data you have no need for, including secrets, credentials, and unnecessary sensitive categories. Redact personal data from free-text prompts and outputs before storage where feasible. Set retention periods by purpose, and delete on schedule.
Protect logs like production data: restrict access, encrypt them, make them tamper-evident, and audit who reads them. Plan how you will respond to a data subject request that touches logs, and how long regulators or customers may expect you to hold them.
Designing logging for an AI system that will face EU scrutiny? Talk to us about an observability and traceability design.
Key takeaways
- High-risk AI systems must be capable of automatic event recording, and deployers are expected to keep logs, generally for at least six months.
- GDPR accountability and minimization mean logs must be useful without becoming a store of unnecessary personal data.
- Record the chain of events with versions and human actions; prefer references, hashes, and redaction.
- Protect logs with access control, encryption, tamper evidence, and defined retention.
Zetrixweb