Agent Autopsy

Field guide

AI Agent Forensics: How to Investigate What an Autonomous Agent Actually Did

The suspect is software. The witness is a log. The interview is impossible.

A practical introduction to agent DFIR — the discipline of reconstructing an AI agent’s actions, identities, and decisions after an incident, from the evidence you already have.

Field guide · start here 7 min read

What is AI agent forensics?

AI agent forensics is the application of digital forensics and incident response (DFIR) to autonomous AI agents. When an agent — an LLM-driven system with credentials, tool access, and the authority to act on its own — does something it shouldn’t, agent forensics is the work of reconstructing exactly what it read, called, changed, and decided, to an evidentiary standard that holds up under scrutiny.

It is a post-incident discipline. Where monitoring and observability watch an agent while it runs, agent forensics answers the question that comes after the alert, the outage, or the suspicious invoice: what actually happened, how did it start, and can we prove it? Borrowing the language of traditional disk forensics, it is dead-box work — you examine the record of what an agent did after the fact, from logs already in hand, rather than from a sensor you wish you had installed beforehand.

Why AI agents need their own forensic discipline

Incident responders have investigated compromised servers and user accounts for decades. Agents break several assumptions those playbooks rest on:

  • One agent is many identities. A single agent acts through an API key with its model provider, a service principal in one cloud, a role ARN in another, an OAuth token for a SaaS app. There is no tidy “user” to pivot on — reconstructing the actor means resolving a sprawl of non-human identities (NHIs) back to one entity.
  • The evidence is scattered by design. The trail of a single agent action lands in different systems: model-provider request logs, cloud audit logs (CloudTrail and equivalents), identity-provider events, application and database logs. No one of them tells the story; it only exists once they are fused onto a common timeline.
  • There is a decision layer. A compromised server executes instructions. An agent reasons and chooses — which tool to call, what to read, whether to escalate. A forensic account has to reconstruct the decision path, not just the actions, and separate what the agent was instructed to do from what it decided on its own.
  • It happens at machine speed, usually unmonitored. Agents take hundreds of actions in seconds, and most organizations deployed them before they deployed any agent-specific logging. The realistic starting point for an investigation is therefore not a purpose-built audit stream — it is whatever ordinary logs happened to be running.

Agent forensics vs. agent observability

These get conflated because both involve “looking at what an agent did,” but they answer different questions for different people:

 Observability / debuggingAgent forensics (agent DFIR)
QuestionWhy did my agent fail? How do I fix it?What did the agent do, and can I prove it?
WhenDuring development and operationAfter an incident, retroactively
AudienceDevelopers, ML engineersSecurity, IR, legal, the board
Data sourceInstrumentation set up in advanceLogs the organization already has
OutputA trace, a root cause, a code fixAn evidence-grade, defensible account

Observability tooling is invaluable when you have instrumented for it. Forensics is what you need when you have not — and when the answer has to survive questions from counsel, a regulator, or a customer’s security team.

How to investigate an AI agent incident

The shape of an agent investigation mirrors classic DFIR, adapted for the points above — it is the analysis phase of the broader AI-agent incident-response process. In practice it runs roughly in this order:

1. Scope and preserve

Identify the agent and every identity it operated through, and fix the time window. Preserve the relevant logs immediately and with integrity — content-addressed hashing and a tamper-evident record — so the evidence you reason over is the same evidence you can later defend.

2. Collect from the logs you already have

Pull the ordinary trail from each source the agent touched: model-provider logs, cloud audit logs, identity events, application and data-access logs. Agentless collection matters here — requiring a pre-installed sensor means the investigation is dead on arrival for the incidents that matter most.

3. Normalize and resolve identity

Translate every source into a common event shape, then stitch the agent’s many identities — API key, service principal, role, token — into a single actor, so its actions read as one coherent story rather than four disconnected ones.

4. Reconstruct the timeline and the chain

Order events into a fused timeline and correlate them into an attack chain: the sequence of actions, the causal links between them, and the point where ordinary activity became an incident.

5. Find patient zero

Trace the chain back to its origin — the first event that set the incident in motion, whether a prompt injection, a leaked credential, or a poisoned memory entry. Root cause is the difference between cleaning up symptoms and actually closing the hole.

6. Separate fact from inference, and rate confidence

A defensible account never overstates the evidence. Each conclusion should carry its confidence, each link should be labeled as attested by the logs or inferred from them, and genuine ambiguity should be stated plainly rather than smoothed over.

7. Produce a report that holds up

The deliverable is an account an examiner can hand to counsel and the board and defend line by line — with the underlying evidence and chain of custody intact, and, where relevant, the artifacts a regulatory regime expects.

Common AI agent incident types

Most agent investigations trace back to a familiar set of failure modes, several of which map to the OWASP Top 10 for Agentic Applications and the wider LLM security risk lists:

  • Prompt injection — hostile instructions smuggled in through content the agent reads, redirecting its behavior.
  • Credential and secret abuse — an agent’s keys or tokens used to reach data or systems beyond its intended scope.
  • Memory poisoning — corrupted entries planted in an agent’s persistent memory or retrieval store that steer later decisions.
  • Tool and function misuse — legitimate tools invoked toward illegitimate ends, often chaining several calls.
  • Excessive agency — an agent granted more autonomy or permission than the task required, acting consequentially with no human in the loop.
  • Cascading multi-agent failure — one agent’s bad output becoming another’s trusted input, compounding across a delegation chain.
  • Data exfiltration — sensitive data read and moved out, frequently the endpoint the other modes lead to.

What “evidence-grade” means

The phrase does real work. For an agent investigation to be evidence-grade rather than a plausible story, it has to be:

  • Preserved — original logs captured with content addressing and a tamper-evident ledger, so the chain of custody is provable.
  • Reproducible — the same inputs yield the same reconstruction, every time, by anyone.
  • Calibrated — findings carry confidence, and the tool never asserts what the evidence cannot support.
  • Attributable — every claim traces back to the specific events that support it, distinguishing what is attested from what is inferred.

These are the properties that separate forensics from debugging — and the reason the discipline matters the moment an agent incident becomes a question someone outside the engineering team has to answer.

Where Agent Autopsy fits

Agent Autopsy is purpose-built for this work: agentless, vendor-neutral, evidence-grade forensics for AI-agent incidents. It reconstructs what an agent read, called, changed, and decided from logs an organization already has, resolves identities across sources, builds the attack chain, finds patient zero, and produces a report that holds up — every finding confidence-rated, attested-or-inferred, and backed by a tamper-evident chain of custody. See how it works end to end, or how it is validated against a 3,240-case known-truth benchmark.

Frequently asked questions

Can you investigate an AI agent incident with no agent-specific monitoring in place?

Yes — that is the normal case, and the point of a dead-box approach. Agent forensics works from the ordinary logs you already have (model-provider, cloud, identity, application), so an investigation does not depend on a sensor you would have needed to install before the incident.

Is agent forensics just DFIR with a new name?

It is DFIR applied to a new kind of actor. The discipline and standards are the same — preservation, timeline reconstruction, root cause, defensible reporting — but agents introduce non-human-identity sprawl, evidence scattered across providers, and a decision layer that traditional host- and account-centric playbooks do not account for.

How is AI agent forensics different from LLM observability tools?

Observability watches an agent while it runs and helps developers fix it; it depends on instrumentation set up in advance. Forensics reconstructs an incident after the fact to an evidentiary standard, from logs already in hand, for an audience that includes security, legal, and leadership.

What logs do you need to investigate an AI agent?

Whatever the agent touched — typically some combination of model-provider request logs, cloud audit logs such as CloudTrail, identity-provider events, and application or data-access logs. More sources yield a higher-confidence reconstruction, but the method degrades gracefully when fewer are available.