Skip to main content

The logging architecture: what your organization's systems must record, for whom, for how long

The short answer

Evidence is designed into the system as a logging architecture

Whether anyone can ever find out what your AI did to a specific person on a specific day depends entirely on what you decided, in advance, to record. You cannot log a decision after it is made; either the system captured it at the time or the fact is gone. The logging architecture is the deliberate plan for what each system records, for whom, and for how long.

What you will be able to do

  • Design a logging architecture for a real AI system: a deliberate specification of what the system records, for whom, and for how long, rather than an accident of whatever the software happened to write to a file.
  • Distinguish logging from monitoring, and explain why a healthy real-time dashboard is not the same as a durable record that can reconstruct a single past decision months later.
  • Specify the reconstruction record for one decision: the model version, the configuration, the inputs, the output, the reasons or features that drove it, the human who touched it, the timestamp, and the actor identity, so that one decision on one person on one date can be rebuilt from the log.
  • Explain why every record must carry the version of the model and configuration that produced it, and why an output logged without its version is unreconstructable.
  • Design the log backward from its consumers: the affected person who asks "why me," the auditor or regulator, the incident responder, the model team, the board, and your own successor, each of whom asks a different question the record must answer.
  • Set a defensible retention period for each class of record, holding the duty to be able to prove what happened (including at least the six months the EU AI Act requires for high-risk system logs) against the duty of data minimization and storage limitation, with a legal-hold rule that overrides deletion.
  • Test a logging architecture the way an adversary will: pick one past decision and try to reconstruct it end to end, and treat every gap you hit as a defect to fix before the auditor, the court, or the affected person finds it for you.

The ideas, one by one

Logging is not monitoring

Monitoring tells you the system's health now; it is often sampled, aggregated, short-lived, and mutable. Logging is the durable, reconstructable, trustworthy record that answers a question asked months later about one decision. A healthy dashboard is fully compatible with a decision you cannot rebuild, so "we have observability" is not an answer to "can you reconstruct that decision."

Reconstruct the decision, not just the event

A consequential decision is reconstructable only if the record captures identity, versions, inputs, output and action, reasons, and the human in the loop, joined by identity and time. Logging that a score was produced is not logging why that score, from which version, on which inputs, reviewed by whom. If you cannot fill every field for one person on one date, that field is where the important question will land.

Version everything, or the record cannot be rebuilt

The version is the most commonly omitted and most fatal field. Models are retrained and reconfigured and their behavior shifts between versions, so an output logged without the model and configuration version that produced it is a number you cannot verify. If it can change and it moves the output, the version is part of the record, every time.

Design the log backward from its readers

Six readers ask six questions: the affected person ("why me"), the auditor, the incident responder, the model team, the board, and your successor. Designing for identified readers turns "log everything, just in case" into a bounded, defensible set. The affected person is the reader most often forgotten, and a log that can honestly answer "why me" usually answers everyone else too.

Retention is a per-class decision with a basis, not a global default

Hold the duty to prove what happened against the duty to minimize data by classifying records and setting each a period with a written basis: the legal floor (at least the EU AI Act's six months for high-risk logs), the longest realistic challenge or audit window, and the privacy duty to delete after, with a legal hold that freezes deletion when a dispute is live. Six months is a floor, not the answer.

Integrity and queryability are what make a log evidence

A log that can be silently edited is a rumor, not a record, so it must be append-only, hashed, access-controlled, with trustworthy timestamps and actor identity. A log you cannot retrieve at the grain of one subject's one decision fails its readers when they need it. The blunt test: could the affected person get the record of their own decision without a lawsuit.

The log defends you as much as it exposes you

The absence of a record does not protect you; an unexplained consequential decision is often treated as indefensible, and the record that could indict you is the one that could exonerate you. Rotterdam's incomplete records saved no one; they left the serious questions unresolvable in every direction. Log as the evidence that you governed.

But logging everything forever is its own failure

Recording every raw personal record indefinitely is a privacy violation, a surveillance archive, and a breach waiting to happen. The goal is sufficient reconstruction, not maximum recording: reference rather than hoard the sensitive bulk, keep only what identified readers will genuinely need, and delete on a defensible schedule. The "for whom" and "for how long" questions are what keep "what" from metastasizing.

Vendor and agent logs are the hard edges

You must keep logs to the extent they are under your control, so a vendor's logs need a contract that guarantees your access, or the decisions are unreconstructable; logging is a procurement requirement. An agent's actions are its decisions, taken in sequence, so its record must preserve the whole trajectory and its containment events, not just a final output.

Prove the architecture by reconstructing one real decision

A logging architecture is proven by trying to rebuild one past decision end to end and writing down exactly what you could not. The reconstruction test is where you find the missing version field or unretained record yourself, rather than having the auditor or the affected person find it at the worst possible time. Finding your own gaps first is the whole discipline.

The record has to exist before the question is asked

You cannot go back and log a decision after it has been made, so the logging architecture must be designed before the decisions it will need to reconstruct. Whether a harm can be proven, in either direction, is decided by what was recorded at the time and whether the right people can reach it, not by what actually happened. Rotterdam's most important record was missing when the question came, and no amount of later effort could put it back.

Separate the raw data's lifetime from the record's lifetime

Recording a hash and a reference to an input rather than the raw personal data lets you delete the raw data on the privacy schedule while keeping the reconstruction record for the accountability window. This is what dissolves the apparent standoff between minimization and accountability: you can honestly say both "we no longer hold her raw data" and "we can still show what our system decided about her," because you distinguished the raw data from the record of its use before either clock started running.

The human-in-the-loop record is the highest-value log

Whether a person meaningfully governed a decision, rather than deferring to the machine, turns entirely on whether the human's actual action was captured: who reviewed, when, for how long, and what they did, including every override. A bare "reviewed: yes" looks like oversight and proves nothing; capturing the human's real action is what lets an auditor tell a genuine check from a rubber stamp, which is why it sits at the top of the record.

Logging is a procurement decision, not only an engineering one

For any consequential system you buy, the decision records may sit inside the vendor's infrastructure, and you must keep logs only to the extent they are under your control. If the contract does not guarantee you access at the grain, speed, form, and retention your readers need, the decisions are unreconstructable and the vendor is a black box exactly where your risk is highest. Close it in the contract, or flag it as a known gap in your evidence.

Design comes before storage: what, then for whom, then for how long

The three questions of the title are an ordered method, not a checklist to tick in any order. First establish what must be recorded so one decision can be rebuilt; then name the readers who bound that set and expose its gaps and excess; then set retention per class with a defensible basis. Starting from the storage technology, or from "log whatever the system emits," is how organizations end up with logs that are simultaneously too much (a privacy hoard) and too little (unreconstructable), which is the worst of both duties.

Listen to it

The same lesson, talked through by two hosts as episode 77 of the podcast.

Real cases

These examples show logging architecture done well and done badly, with the reasoning made explicit. The deep anchor is Rotterdam; the others sharpen a single point and are treated in depth by their owner topics or are clearly labeled as illustrative method.

Example 1 (the anchor): the records that made discrimination provable, and the one that surfaced only by accident. Rotterdam's welfare-fraud model scored every recipient on 315 variables and referred the highest scorers, about a thousand people a year, for investigation, and it systematically rated young mothers and non-Dutch-speakers as higher risk, with poor Dutch roughly doubling a person's score (Lighthouse Reports, VPRO, and WIRED, "Inside the Suspicion Machine," March 2023). The discrimination became provable only when investigators obtained a specific set of records, the source code, the trained model, the inputs and outputs, and the technical documentation, and could reconstruct the model's behavior directly. The training data, the 12,707 past investigations the model learned from, was officially withheld on privacy grounds and surfaced only because it had been accidentally leaked inside materials the city did share; with it, the investigation found the training set itself skewed (about half its cases labeled fraud against a real rate near a fifth), so the model had learned what being investigated looks like rather than what fraud looks like. The lesson for logging architecture is the whole topic in one case: the harm was real when the model ran, but examinable only where the record existed and reachable, and the deepest record reached the people who needed it only by accident, which protected no one.

Example 2 (the legal floor, established): the EU AI Act's record-keeping and retention duties. The EU AI Act makes logging a legal obligation for high-risk AI systems, not merely good practice. Article 12 requires such systems to technically allow the automatic recording of events over their lifetime, sufficient to identify risks, support post-market monitoring, and monitor operation; Articles 19 and 26 require providers and deployers, respectively, to keep those automatically generated logs, to the extent under their control, for a period appropriate to the intended purpose and at least six months, unless data-protection or other law says otherwise (Regulation (EU) 2024/1689, Articles 12, 19, 26). The lesson: for high-risk systems, "what to record" and "for how long" are partly answered by law, and the six-month figure is a floor to build above, not a target to hit, because the realistic window for a challenge to a consequential decision is usually far longer than six months. An architecture that treats six months as the retention answer has misread a minimum as a maximum.

Example 3 (the privacy counterweight, illustrative method): the log that becomes the breach. A logging architecture that records everything, forever, including raw personal data, creates a hazard of its own, and the pattern needs no single named company because it is common: an organization, trying to be thorough, logs full personal records and sensitive inputs in plaintext and retains them indefinitely, and the log itself becomes a concentrated store of personal data, a violation of data-minimization and storage-limitation duties and a rich target the day it leaks. The lesson: more logging is not automatically safer logging. The discipline is to record references and hashes rather than raw copies wherever reconstruction allows, and to delete on a defensible schedule, so that the log proves what the system saw and did without becoming a surveillance archive. Sufficiency, not maximization, is the goal, and the privacy duty is part of the design, not an obstacle to it.

Example 4 (the version gap, illustrative method): the unreconstructable decision after four retrains. Consider an organization that logs, for each decision, the input and the output and the timestamp, but never the model version. It looks complete on the dashboard. Then, a year later, an affected person disputes a decision, and by now the model has been retrained four times; the team can see the input and the output but cannot say which model produced them, and independent research has shown the same model's behavior can shift substantially between versions (see Topic 10.3), so they cannot even assume the current model would behave the same way. The decision is unreconstructable through a single missing field. The lesson: version everything that can change and affects the output, because a logged output without its version is a fact you cannot verify, and the omission looks harmless right up until the moment someone asks.

Example 5 (designing for the affected person, referenced): the right to know why. The reader most often forgotten, and the one Rotterdam's recipients never got served, is the affected person asking "why me." Under the GDPR, a person subject to a significant automated decision has rights to information about it, and the deep treatment of the two gates and the law's reach is owned elsewhere (see Topic 5.3); referenced here for the logging point, that right is empty if the log cannot reconstruct that person's specific decision in human-readable terms. The lesson: designing the log backward from the affected person forces the "why" and the human-in-the-loop records to be genuine, not just an internal event id, and a log that can honestly answer "why me" to the person harmed can usually answer the auditor, the board, and the successor too. Serve the hardest reader first.

Example 6 (the agent trajectory, referenced): logging what the agent did, step by step. An AI agent that takes actions, calls tools, and chains steps multiplies what must be recorded, because the record has to preserve the whole trajectory, not just a final answer. Module 7 built the agent audit trail for this reason (see Topic 7.4), and the kill-switch test record captures the containment events (see Topic 7.5); referenced here to mark that the agent's actions are the decisions, and each must be reconstructable in sequence. The lesson: a logging architecture designed for the request-and-response shape of a scoring model will under-record an agent by construction, capturing the conclusion but not the steps, so an investigator could not answer "what did it do, in what order, and why did it act there." As agents take on more consequential action, keeping their trajectories reconstructable is the architecture's hardest frontier.

Example 7 (the vendor black box, illustrative method): the log you never contracted for. A large share of the AI an organization runs is bought, and its decision records may sit inside the vendor's systems. If the contract does not guarantee access to those logs at the grain and speed your readers need, then when a regulator or an affected person asks you to reconstruct a decision, you cannot, because the record is not, in the AI Act's words, under your control (Regulation (EU) 2024/1689, Article 26). The lesson: logging is a procurement requirement, not only an engineering one. For any consequential bought system, the contract must specify what the vendor logs, your right to obtain it, its form, and its retention, or your architecture has a hole exactly where you have the least visibility. A logging design that stops at your own code and treats vendor systems as opaque is incomplete by construction.

Example 8 (integrity as the difference between record and rumor, illustrative method): the log anyone could edit. Two organizations keep decision logs. In the first, the log is append-only, hashed, and access-controlled, with trustworthy timestamps and actor identity; in the second, an administrator can quietly edit past entries. In a dispute, only the first has evidence: the second's log, however detailed, is worth little, because if any entry could have been changed, every entry is potentially the changed version, and an investigator cannot rely on the timeline (see Topic 11.4). The lesson: integrity is not a nice-to-have on top of logging, it is what makes a log function as evidence rather than as a story, and it is an architecture decision made in advance, because you cannot retrofit trustworthiness onto records that were always editable. A tamper-evident log defends you; an editable one cannot.

Example 9 (the queryability failure, illustrative method): the record that took two years to reach the people who needed it). Part of what made the Rotterdam situation so severe was not only which records existed but how unreachable they were: it took a two-year investigation, public-records pressure, and technical expertise to get the model and its inputs and outputs into a form where the decisions could be examined at all, and the affected recipients themselves had no realistic path to their own records (Lighthouse Reports, VPRO, and WIRED, March 2023). Generalize the pattern and it needs no single company: an organization that "has the logs" but can only extract one decision through a heroic engineering effort has, for the reader who needs it, a record that is effectively absent. The lesson: queryability is not a convenience layer on top of logging, it is part of whether the record exists in any meaningful sense, and the test is whether an entitled person could obtain their own decision quickly rather than after a campaign.

Example 10 (the human-in-the-loop record as the highest-value log, illustrative method): proving oversight was real. Consider two deployments that both claim "human review" of an AI system's consequential outputs. The first logs only "reviewed: yes"; the second logs who reviewed, when, for how long, and what they did, including every override and its corrected value. When an auditor asks whether the human oversight was meaningful or a rubber stamp, only the second can answer, and if its records show uniformly two-second reviews with a zero override rate, the auditor can see the rubber-stamping directly (see Topic 4.4). The lesson: the record of the human in the loop is the highest-value log in the architecture, because the whole question of whether a person governed the decision, rather than deferring to the machine, turns on whether the human's actual action was captured, and "reviewed: yes" is the field that looks like oversight and proves nothing.

Example 11 (retention read as a floor, not a ceiling, established): the six-month minimum against the multi-year claim. A lender keeps its AI decision logs for exactly six months, reasoning that it has met the EU AI Act's requirement. Two years later a borrower brings a discrimination claim well within the statutory window for such claims, and the decision records are long gone, so the lender cannot reconstruct what happened and cannot defend itself (Regulation (EU) 2024/1689, Articles 19 and 26, set the at-least-six-months floor; the realistic challenge window for a lending-discrimination claim is measured in years). The lesson: the six-month figure is a floor to build above, matched to the realistic period in which a decision can be challenged or audited, not a target to hit; an architecture that treats the legal minimum as the retention answer under-retains exactly the records it will be asked for, and reproduces Rotterdam's inability to produce the record when the question finally comes.

Example 12 (the agent trajectory in the wild, referenced): logging an agent's actions, not just its verdict. As AI agents take on consequential action, calling tools, moving money, sending communications, or changing records, the logging burden shifts from recording an output for a human to act on to recording a sequence of actions the agent took itself, and the containment events when a limit or kill switch fired (see Topic 7.4), (see Topic 7.5). Referenced here to mark the frontier: an architecture built for a scoring model logs the conclusion, but an investigator asked "what did the agent actually do, in what order, and why did it act at that point" needs the whole trajectory, which the request-and-response design never captured. The lesson: for agents, the actions are the decisions, so the reconstruction record becomes a reconstruction of a sequence, and the hardest part of a modern logging architecture is keeping that sequence intact at a grain fine enough to answer the forensic question.

Where people go wrong

  • "We have great observability, so logging is covered." Observability and monitoring tell you the system's health right now; they are often sampled, aggregated, short-lived, and mutable, because operational telemetry does not need to survive for years or stand up as evidence. Governance logging must reconstruct a single past decision months later, durably and trustworthily. A healthy dashboard is fully compatible with a decision you cannot rebuild, which is why "we have observability" is not an answer to "can you reconstruct that decision."
  • "We log that the decision happened, so we can reconstruct it." Logging the event ("a score was produced") is not logging the decision (why that specific score, from which version, on which inputs, reviewed by whom). Reconstruction requires the join across model, data, configuration, and people, tied together by identity and time. If you cannot fill every field of the reconstruction record for one person on one date, you have logged an event, not a decision, and the missing field is where the important question will land.
  • "We do not need the model version; we can just rerun the current model." The current model may not behave like the one that made the decision, because models are retrained and reconfigured and their behavior shifts between versions (see Topic 10.3). An output logged without the version that produced it is a number you cannot verify. Version everything that can change and affects the output, every time, or the record is a story you cannot check.
  • "Log as little as possible, because records are liabilities." For consequential decisions this is backward. The absence of a record does not protect you; it leaves you unable to show you did the right thing, and an unexplained consequential decision is often treated as an indefensible one. The record that could indict you is the one that could exonerate you. Rotterdam's incomplete records saved no one; they left the serious questions unresolvable in every direction.
  • "So log everything, forever, to be safe." The mirror-image error. Logging every raw personal record indefinitely is a privacy violation, a surveillance archive, and a breach waiting to happen, and it violates data-minimization and storage-limitation duties. The goal is sufficient reconstruction, not maximum recording: enough to rebuild what identified readers will need, kept as long as they might need it, referencing rather than hoarding the sensitive bulk, and no more.
  • "Six months is the retention rule for AI logs." Six months is the EU AI Act's floor for high-risk system logs (Articles 19 and 26), not a universal answer and not a ceiling. Retention is a per-class decision with a stated basis: the legal floor, the longest realistic window for a challenge or audit, and the privacy duty to delete after. For many consequential decisions the realistic challenge window is years, so treating six months as the target under-retains exactly the records you will be asked for.
  • "We will pull the logs when someone asks." If the log is not queryable at the grain of one subject's one decision, quickly, then for the purpose that matters you do not have that record. A log that needs a data-recovery project or a court order to extract a single decision fails its readers when they need it. Design for retrieval by subject and date, at single-decision grain, so the affected person could get their own record without a lawsuit.
  • "A log is a log; it does not matter who can edit it." A log that can be silently edited is not evidence, because if any entry could have been changed, every entry is suspect. Integrity, append-only storage, hashing or chaining, access controls, trustworthy timestamps and actor identity, is what separates a record from a rumor, and it must be designed in advance, because you cannot retrofit trustworthiness onto records that were always editable.
  • "Our vendor handles the logging." The AI Act requires you to keep logs to the extent they are under your control (Article 26), and a vendor's logs are not under your control unless your contract makes them so. If procurement did not secure your right to obtain vendor logs at the grain and speed your readers need, you cannot reconstruct those decisions. Logging is a procurement requirement, not only an engineering one; a vendor black box is a hole exactly where visibility is lowest.
  • "An agent just needs its final output logged." An agent's actions are its decisions, and it takes many in sequence, so the record must preserve the whole trajectory, every tool call and action in order, plus any containment events (see Topic 7.4), (see Topic 7.5). A logging design built for request-and-response will under-record an agent by construction, capturing the conclusion but not the steps, so an investigator could not answer "what did it do, in what order, and why did it act there."
  • "The log is for the auditor." The auditor is one reader of six, and designing only for them misses the affected person asking "why me," the incident responder needing a trustworthy timeline, the model team debugging drift, the board wanting portfolio-level inspection, and the successor inheriting the system. Design backward from all the readers; the affected person is the one most often forgotten and the one whose question, answered honestly, tends to answer everyone else's.
  • "We reconstructed the architecture on paper, so it works." A logging architecture is proven by trying to reconstruct one real past decision end to end, not by reasoning that it should work. The reconstruction test is where you discover the missing version field, the unretained record, the unqueryable store. Skipping it means the auditor or the affected person runs the test for you, at the worst possible time. Run it yourself, and write down what you could not rebuild.
  • "Logging the input and the output is enough to reconstruct the decision." Inputs and outputs alone tell you what went in and came out of an unknown system, because they omit the version that produced the result, the reasons behind it, and the human who did or did not intervene. You can neither verify nor reproduce the output without the version, cannot explain it without the reasons, and cannot show oversight without the human record. Reconstruction is a join across model, data, configuration, and people, keyed by identity and time; inputs-and-outputs is a partial record that fails exactly the questions that matter most.
  • "The human review field can just be a yes or no." "Reviewed: yes" is the field that looks like oversight and proves nothing. To show that human control was meaningful rather than a rubber stamp, the record must capture who reviewed, when and for how long, what they did (approved, overrode, modified, escalated, or nothing), and the corrected value on any override. Without those, an auditor cannot distinguish a genuine check from a formality, and the highest-value record in the whole architecture collapses into a checkbox that hides the very thing it was supposed to prove.
  • "We can decide what to log after we see what goes wrong." You cannot log a decision after it has been made; either the system captured it at the time or the fact is gone forever. Deciding what to record only after an incident means the incident itself is unreconstructable, which is the exact failure the post-incident review exists to prevent (see Topic 3.5). The logging architecture must be designed before the decisions it will need to reconstruct, because the record has to exist the moment the question could first be asked, not the moment someone thinks to ask it.
  • "Retention is a storage question for the infrastructure team." Retention is a governance decision with legal and privacy consequences, not a disk-space setting. How long each class of record lives determines whether you can answer a regulator or an affected person years later and whether you are hoarding personal data in violation of storage-limitation duties, and it carries a legal-hold rule that freezes deletion when a dispute is live. Delegating it to whoever configures the log rotation defaults means the period will be set for operational convenience, which is almost never the period the law, the risk, or the affected person requires.

Questions people ask

What is logging architecture?
A deliberate specification of what each AI system records, for which reader, and for how long, so that a single decision can be reconstructed after the fact. The artifact this topic produces, and the foundation the rest of Module 10's evidence stands on.
What is logging (governance-grade)?
The durable, complete, trustworthy recording of what a system did, decision by decision, designed to reconstruct a specific past decision months later. Distinct from operational telemetry, which is often sampled, aggregated, short-lived, and mutable.
What is monitoring?
Real-time observation of a system's health, error rate, throughput, and uptime, through dashboards and alerts. Tells you the state now; it does not, on its own, reconstruct a single past decision, which is why it is not a substitute for logging.
What is reconstruction record?
The set of records needed to rebuild one decision completely: identity (system, decision id, subject id, timestamp), versions (model, configuration, prompt or policy), inputs (or a reference plus hash), output and action, reasons, and the human in the loop. If any part is missing for one decision, that decision is not fully reconstructable.
What is reconstruction test?
The act of proving a logging architecture works by taking one real past decision and trying to rebuild it end to end from the records that exist, then writing down exactly what could not be rebuilt. The difference between a proven architecture and a paper one.

Keep going

Watch the lesson and prove it

Proving it happens inside the program: watch, explain it in your own words, and it goes on a record employers can check.

Watch the lesson and prove it →