Open source Β· MIT Β· Single Go binary

Digital forensics for AI agents

AI coding agents run shell commands, spawn subagents, call MCP servers and push code. When one goes rogue, the evidence is on the endpoint. AgentDFIR collects it, seals it, and shows you what actually happened β€” Claude Code, Codex CLI, Cursor, Gemini CLI, Copilot.

Zero runtime dependencies Β· Never executes suspect binaries Β· Never follows symlinks

Evidence vs. claims

A model saying β€œI ran it” is not proof it ran

AI-generated text is never automatically treated as evidence of execution. Every action in every timeline carries an explicit corroboration state β€” so model narrative can never masquerade as confirmed host activity.

StateMeaning
REQUESTEDA human asked for it
REPORTEDThe model said it happened β€” narrative, not proof
OBSERVEDA tool-call record exists in the transcript
CORROBORATEDIndependent endpoint or network evidence confirms it
CONTRADICTEDEndpoint evidence shows it did not occur
UNKNOWNInsufficient evidence β€” stated honestly

Built for hostile hosts

Forensically sound by construction

Every design decision assumes the host is compromised and the evidence is adversarial.

Sealed evidence packages

Every acquisition produces a sealed .adfir package: content-addressed storage, SHA-256 manifest, and a seal covering the entire evidence zone.

Hash-chained custody

Collection and chain-of-custody logs are hash-chained β€” editing, deleting or forging a single record breaks the chain for everything after it.

Tamper-evident verification

One flipped byte anywhere in the sealed zone fails verify β€” and it names the exact artifact that was modified.

Hostile-evidence hardened

Suspect binaries are never executed. Symlinks are never followed. ANSI escapes and invisible Unicode are neutralized β€” your terminal is part of the attack surface.

Agent graph & timeline

Sessions, agents, subagents, tool calls and MCP servers reconstructed into one evidence-linked timeline. Every entry traces to a file, line and hash.

Adversary emulation

agentdfir simulate generates synthetic rogue-agent incidents β€” orphan agents, cross-session messaging β€” to validate detections and train responders.

Open format

The .adfir evidence package

Self-describing and independently parseable β€” any forensic tool can read it without AgentDFIR. Raw evidence is sealed once and never touched; analysis output is a regenerable overlay.

  • Lossless. Nothing redacted or rewritten at collection time.
  • Hash-while-copy. Hashes describe exactly the preserved bytes, with torn-read detection for files a live agent is still writing.
  • Every failure recorded. Access denied, size bounds, irregular files β€” nothing silently dropped.
  • Deploys with your stack. KAPE Target/Module and Velociraptor artifact ship in-repo.

Quick start

From suspect host to sealed findings in five commands

# Discover installed AI tooling β€” never executes suspect binaries
agentdfir detect

# Forensic acquisition: lossless, sealed, hash-chained
agentdfir collect --product claude --operator "Your Name" --case-id CASE-2026-042

# Tamper-evident verification
agentdfir verify CASE-2026-042.adfir

# Unified, evidence-linked timeline + rule-based detections
agentdfir timeline CASE-2026-042.adfir
agentdfir triage   CASE-2026-042.adfir

Reference

AI agent forensics, answered

What is AI agent forensics?

AI agent forensics is the discipline of collecting, preserving and analyzing the evidence agentic AI tools leave on endpoints β€” session transcripts, subagent records, MCP configurations, hooks and tool-call logs β€” so an incident responder can reconstruct who instructed which agent to perform what action, through which tool and identity, and what evidence proves it.

Where does Claude Code store session logs?

Claude Code stores session transcripts as JSONL under ~/.claude/projects/<project>/<session-id>.jsonl, with prompt history in ~/.claude/history.jsonl, settings, hooks, skills, plugins, task state and file-history checkpoints under ~/.claude/, and global configuration (including MCP servers) in ~/.claude.json. AgentDFIR acquires all of them into one sealed package β€” including subagent and orphan-agent transcripts.

Is a model's own account of its actions evidence?

No. "I executed curl example.com" in model output is a claim β€” AgentDFIR marks it REPORTED. Only a tool-call record in the transcript upgrades it to OBSERVED, and only independent endpoint or network evidence makes it CORROBORATED. That distinction is the foundation of trustworthy AI-agent forensics.

What does AgentDFIR detect today?

Orphan agents (transcripts with no verified parent invocation), cross-agent messaging and unexpected resume interactions, destructive shell commands, shell-execution inventory, and transcript integrity gaps (truncated or malformed regions that reduce confidence in surrounding evidence). Detections are deterministic rules β€” no LLM in the analysis path.

Free. Open. Auditable in an afternoon.

MIT-licensed, zero runtime dependencies, single static binary. Built in the open for the DFIR community.

Technical reference

Documentation & open schemas

Machine-readable schemas and artifact references β€” cite them directly.

Install

Portable raw binaries for USB / air-gap, install.sh, Homebrew tap, go install. SHA256 and Sigstore verification, and why unsigned downloads prompt on macOS and Windows.

Claude Code Forensic Artifacts

Every on-disk location, the JSONL session schema, interpretation and collection commands.

Case Explorer

agentdfir serve: agent tree, density-scrubber timeline, the raw transcript line behind every event, findings and topology β€” in your browser, loopback only, zero external resources.

Containers & CI

collect --docker snapshots a container read-only; --archive ingests CI artifacts, support bundles and vendor exports β€” same sealed package, same analysis.

Instruction Provenance

For every line of CLAUDE.md, AGENTS.md or .cursorrules: which session, agent and tool wrote it β€” and whether it entered as a human request or as tool output.

Real-time Detection

monitor --detect turns the read-only tail into a sensor: exfil sequences, honeytokens, self-modification and more pushed to webhook, syslog or file within seconds.

Endpoint Corroboration

auditd, Sysmon and EDR exports as the second witness: which tool calls the OS confirms, which it contradicts, and what the agent did off the record.

MCP Supply-Chain Audit

Every MCP server across every agent on a host: unpinned packages, plaintext transports, auto-approve, poisoned tool descriptions, baseline drift, gateway-log corroboration. Read-only.

MCP Forensics

Investigating MCP server config and tool activity, baselines and tool-poisoning evidence.

Product Packs

Add any new AI agent product with one signed JSON file: detection, collector manifest and parser field map β€” no Go.

SIEM Interop

OCSF 1.3 events and findings, SARIF 2.1 for code scanning, Sigma export of rule packs β€” portable to EDR process telemetry.

DFIR Interop

Import KAPE / Velociraptor / CyLR trees into one sealed package; export Timesketch JSONL and l2tcsv timelines.

.adfir Package Spec

The open evidence-package format: two zones, content addressing, hash chaining, verification.

Event JSON Schema

The unified agent forensic event schema (JSON Schema 2020-12).

Finding JSON Schema

Detection finding schema with evidence references and corroboration state.

Compliance Mappings

ISO/IEC 27037, NIST AI RMF, GDPR, EU AI Act β€” capabilities that supply supporting evidence.