Vaikora › Blog › Product Updates
Reconstructing an AI agent incident: what the audit record must contain to answer each investigator question
When an AI agent takes a destructive action, the first question is not "who deployed it." The first question is "what did it call, with what arguments, and what was the state of the policy at that moment." If your audit record cannot answer all three, the investigation stalls.
This article walks through what a usable audit record looks like, where most implementations fall short, and what a hash-chained, decision-level log actually gives you during an incident.
What investigators actually need from an audit log
A post-incident review for an AI agent action needs to reconstruct a causal chain. That chain has four links:
- The input: what the agent sent (prompt, tool call arguments, context window state)
- The decision: what the enforcement point chose (allow, block, modify, require-approval) and which policy rule fired
- The action: what actually executed downstream (the LLM response, the tool invocation, the file write)
- The policy state: the exact policy in force at the time of the decision, not today's version
Most logging implementations capture the action. Fewer capture the input in enough detail. Almost none capture the policy state at decision time, which is the record that proves whether an enforcement gap existed or whether someone deliberately changed the policy before the action ran.
Where most audit implementations break down
The common pattern is to log at the application layer, after the agent has already called the LLM or tool. That gives you a record of what happened, not a record of what was enforced before it happened.
The practical failure mode: an agent exfiltrates data through a tool call. The log shows the call completed. It does not show whether a policy was evaluated, what that policy contained, or whether it was bypassed. An investigator has output but no enforcement record. That is not an audit trail. That is an application log.
A second failure is mutable log storage. If the same system that runs the agent can also write to or delete the audit log, the log cannot prove its own integrity. Any defense that depends on "the log says X" collapses if an attacker who controlled the agent also controlled the log.
What a decision-level, hash-chained record gives you
An enforcement point that sits inline, between the agent and the LLM or tool call, can write a record for every decision before the action executes. Each record captures: the raw input, the matched policy rule, the decision (allow, block, modify, require-approval), the policy version hash, a timestamp, and the agent identity.
Chaining those records with SHA-256 means any deletion or modification of a prior record breaks the chain at that point. An investigator can verify chain integrity without trusting the system that wrote the records.
Vaikora writes every enforcement decision into a SHA-256 hash-chained, tamper-evident audit log before the downstream action runs. That ordering matters: the record exists even if the action is blocked and produces no other observable output.
A concrete scenario: an agent calls a file-write tool with a path outside its expected working directory. The enforcement point evaluates the call against a path-scoping policy, blocks it, and writes a record containing the full call arguments, the policy rule that fired, and a hash linking to the prior record. The file is never written. The log entry exists. An investigator running the chain verification two weeks later can confirm the block occurred, that the policy in force at that moment contained the path-scoping rule, and that no records were removed between that event and the present.
Connecting the audit record to your SIEM
A tamper-evident log that lives only inside the AI platform creates an operational silo. During an incident, analysts work inside their SIEM. If the enforcement telemetry is not there, the AI agent timeline stays disconnected from the broader attack timeline.
Vaikora integrates natively with Microsoft Sentinel, SentinelOne, CrowdStrike Falcon, and AWS Security Hub. High-severity enforcement decisions surface as incidents in those platforms, with the same record fields available inside the SIEM query environment. That lets a detection engineer correlate an AI agent block event with a lateral movement alert in the same timeline, without manually exporting data from two separate systems.
What to check in your current implementation
Before the next incident, run through these four questions against your existing AI agent audit setup:
- Does the log record the enforcement decision, or only the action result?
- Is the policy version at decision time captured in the record?
- Can the system that runs the agent also modify or delete the log?
- Are enforcement events queryable inside your SIEM alongside other telemetry?
If any answer is "no" or "I don't know," start there. The worst time to discover your audit record cannot reconstruct an incident is during the incident.
See Vaikora enforce policy on your AI
Open-core AI runtime control. Self-host the MIT gateway free, or run the hosted Control Plane.
Get a demo Self-host the gateway
Vaikora