Guide
What is AI forensics?
Definition
AI forensics is the reconstruction, from preserved evidence, of what an AI system did in a specific case and why, to a standard that holds up when someone with reason to doubt the findings examines them.
AI forensics answers a narrow question about one decision, asked after the fact: what did this system do, for this person, at this moment, and which part of the system made it do that? The question usually arrives when a claim is denied, a credit application is declined or an AI agent takes an action nobody authorized. It is asked by people with a reason to doubt the answer, such as opposing counsel, a regulator, an insurer or a tribunal.
The discipline has two halves. Before an incident, it decides what evidence an AI system must keep so that any single decision can be reconstructed later. After an incident, it acquires and examines that evidence and reports what it can and cannot support.
Why AI systems need their own forensics
For most of the history of digital forensics, the system that caused the harm still existed afterwards. A server could be imaged. A cloud account left an audit trail. Investigators argued about access and completeness, rarely about whether the system still existed in the form that caused the harm.
AI agents change that. An agent acts at the moment it decides: it approves a claim, declines an applicant, moves money or changes a production system. The decision is made inside a context that exists for a fraction of a second. That context includes the prompt as it was assembled that day, the documents retrieved for it, the results of tool calls and the conversation history as the system saw it. None of it is retained by default.
The components that produced the decision also change. Model versions are rolled over, system prompts are edited and retrieval indexes are rebuilt. The system an investigator examines months later is often a different system from the one that acted. If the run cannot be reconstructed, nobody can show that the system failed, and nobody can show that it did not.
What AI forensics is not
Several established activities are often offered in place of forensics. Each is useful, and each answers a different question.
| Activity | Question it answers | Why it cannot substitute |
|---|---|---|
| Assurance and evaluation | Does a model like this behave acceptably on inputs like these? | It describes a population of runs, stated in advance. A model that is fair on average can still have made an indefensible decision in one case. |
| Monitoring and observability | Is the system behaving normally right now? | It keeps what is needed to detect anomalies. The full context of a run that looked normal is usually not kept. |
| Explainability | Which features or tokens tend to drive the model's outputs? | An explanation computed on a re-created input is a hypothesis about the incident. It needs the actual run, with provenance, to become evidence. |
| Compliance audit | Did the policy and the controls exist? | It does not show whether the system followed the policy on the day in question. |
| AI for digital forensics | Can AI help triage evidence in an ordinary investigation? | It is a tooling choice inside a conventional case. AI forensics investigates the AI system itself. |
What changes when the question is about one decision
- The unit of analysis
- Assurance asks what a model is capable of. Forensics asks what it did on one run: whether this decision was driven by that field, or whether this agent exceeded its authority on this occasion.
- The vantage point
- A developer sees weights, prompts, logs and configuration. An investigator often sees much less. The vendor may refuse access to the model, the deploying organization may hold only API logs, and the affected person may hold only a screenshot. AI forensics has to produce defensible findings across that whole range of access.
- The audience
- Assurance is written for the organization and for a regulator reading in good faith. Forensic findings are read by people looking for the gap. A finding that satisfies an internal review can fail under cross-examination, and the difference is usually whether the evidence chain can be shown or only asserted.
The evidence an investigator needs
To reconstruct one run of an AI agent, an investigator needs a record that binds together:
- the identity and version of the model, and the serving configuration that handled the request;
- the system prompt and application configuration in force at that moment;
- the context actually assembled for the model, including each retrieved item with its identifier and version;
- each tool call, its arguments and the result returned to the model;
- any change made to the request by a gateway or policy layer;
- the output, and the action taken in the world as a result.
Two properties matter as much as the contents. The record has to hold its integrity against whoever kept it, so that a party with an interest in the outcome cannot quietly change it. It also has to show restraint. The context of a run often contains personal data, and a regime that keeps everything collides with privacy law and with the interests of the people the system served.
This is why preparing for AI forensics differs from logging more. Most organizations already log a great deal, and very little of it answers the question that will eventually be asked. Readiness means selecting the smallest record that would let a skeptical examiner reconstruct a run, and preserving it so that it can be verified.
Why cloud forensics does not carry over
Cloud forensics is the closest precedent. It also deals with systems the investigator does not own and evidence held by a third party. Four of its working assumptions fail for AI agents.
- Acquisition assumes there is something to acquire
- In the cloud, the artifacts exist and the hard part is access. For an agent, the most important artifact, the context assembled at inference time, was never written anywhere unless someone chose to keep it.
- Reproduction assumes determinism
- A cloud function redeployed with the same inputs behaves the same way. A language model does not reliably give the same output twice, and the output also shifts with model version and serving conditions. Re-execution is not reconstruction.
- Chain of custody assumes a stable object
- In the cloud the object is a snapshot or a log export. An agent's behaviour comes from a composition of model, prompt, retrieval corpus, tools, gateway policy and user input, each with its own version history and often its own owner.
- Attribution assumes a bounded system
- In an agent incident the failing component is rarely the model alone. The retrieved document was stale, a tool returned an error the model read as success, or the system prompt was edited the week before. Deciding which component is responsible is the investigation itself.
In a cloud investigation, the investigator could eventually go to the provider, which held the authoritative record. In an agent deployment there is no such party. We call this the custodian gap. Whoever is to hold the evidential record of a run has to be chosen before the run happens.
A case worked backwards: Moffatt v. Air Canada
In February 2024, British Columbia's Civil Resolution Tribunal held Air Canada liable after the chatbot on its website told a customer he could book at full fare and apply for a bereavement discount afterwards, which the airline's published policy did not allow (Moffatt v. Air Canada, 2024 BCCRT 149). The case is remembered for the airline's argument that it was not liable for what its chatbot said. The tribunal also noted that Air Canada provided no information about the nature of its chatbot.
A forensic examination would have needed to answer questions the decision leaves open. Which version of the chatbot and its underlying model was running? Was retrieval involved, and if so, which document did it surface and was that document current? What did the full conversation contain according to the system's own record, as distinct from the customer's screenshot? What did the system prompt instruct about policy questions? Did the same question in the same period produce the same answer for other customers?
The dispute was decided on a screenshot and a policy page. The sum at stake was small, which may explain how little was put before the tribunal. The lesson holds regardless: a tribunal decides on the record in front of it, and the record about the software that made the representation was empty.
Before and after: how organizations use AI forensics
Before a dispute, a defensibility review tests whether an AI system keeps enough to reconstruct and defend one decision, and specifies what is missing. The AI Evidence Platform keeps that record as decisions are made, sealed at capture and held independently of the systems it records.
After a dispute or a failure, a post-incident investigation preserves what survives, reconstructs what the system did as far as the evidence allows, and states plainly where alternative explanations remain open. Where a matter requires it, that work supports expert evidence and testimony.
Questions people ask about AI forensics
Is AI forensics the same as digital forensics?
Can a disputed AI decision be reconstructed by re-running the same prompt?
Can the model vendor provide the evidence?
Is our AI monitoring or observability enough?
Does a human in the loop make AI forensics unnecessary?
When should an organization start preparing for AI forensics?
Who needs AI forensics?
Further reading: Where assurance stops · How investigator access shapes an AI investigation · AI reverse engineering and AI forensics