Vaikora › Blog › Product Updates
What your AI agent audit log needs to contain before an incident happens, not after
Audit logs for AI agents fail investigations not because they are missing, but because they record the wrong things. A log that captures model output but not the policy decision that preceded it cannot tell you whether the agent acted within its authorized scope. That gap becomes a problem the moment something goes wrong.
What a useful record actually contains
An AI agent audit entry needs to answer six questions:
- What action was requested, in full (prompt, tool name, parameters)?
- What policy was evaluated against that request?
- What decision was returned (allow, block, modify, require-approval) and why?
- What was the outcome (did execution proceed, what did the tool return)?
- Who or what authorized the agent session that produced the request?
- When did each of these happen, and in what order?
A log that captures only the model response answers none of those questions reliably. You can see what the agent said, but not what it tried to do, what was stopped, or whether the policy that should have applied actually ran.
The ordering problem
Sequence matters as much as content. If you cannot prove that the policy decision happened before the action executed, the log does not support an investigation. It becomes a list of events with no causal chain.
Consider a concrete scenario: an AI agent calls a tool that reads customer records from a database. The log shows the read happened. It does not show that a policy evaluated the call first, that the policy matched a HIPAA preset, or that the call was flagged for approval before it ran. If the same agent later exfiltrates those records, your log tells you what was read but not whether any control ran at the right moment.
The correct approach is to record the policy decision as a first-class event, not a side-note attached to the action result. The decision entry comes before the execution entry. The two are linked by a shared action ID. That ordering is verifiable.
Tamper evidence and what it actually requires
Signing each log entry is not enough. An attacker who compromises the logging pipeline can delete an entry and re-sign the remaining chain. What makes a log tamper-evident is a chained structure: each entry includes the hash of the previous entry, so removing or altering any record breaks the chain at that point and every record after it.
Vaikora writes every policy decision to a SHA-256 hash-chained audit log. Each entry includes the decision (allow, block, modify, require-approval), the input that produced it, the policy matched, and the timestamp. Because the chain is ordered and each link depends on the previous one, you can verify that no entry was deleted or rewritten after the fact. That matters in an incident response context where the agent vendor, the customer, and potentially a regulator all need to agree on what happened.
What to check in your current setup
If you are evaluating or already running an AI agent deployment, verify three things in your audit configuration:
- Decision before execution: Does the log contain an explicit policy decision event that is timestamped before the tool call or model action it governs? If the log only has action results, you are missing the enforcement record.
- Linked entries: Are the policy decision and the action result tied to the same action ID, so you can reconstruct the full sequence without manual correlation?
- Chain integrity: Can you verify that the log has not been modified after the fact? A flat append log with no integrity mechanism cannot answer that question.
The P50 enforcement latency for a Vaikora policy decision is 8ms, with P99 at 45ms. At that speed, writing a full audit entry per decision adds no meaningful latency to the agent execution path. There is no operational reason to skip it.
Where log completeness fails in practice
The common failure mode is building audit around what is easy to capture rather than what an investigation needs. Model API providers return responses. Those responses are easy to log. Policy decisions are internal to the enforcement layer, and if that layer does not write them out explicitly, they are gone.
The second failure mode is aggregating decisions into summaries. "Agent session: 42 actions, 3 blocked" tells you something happened. It does not tell you which actions were blocked, what the blocking policy was, or whether the allow decisions were correct.
What to do next
Pull a sample of raw audit entries from your current AI agent deployment and check whether each one contains the policy decision (not just the result), the specific policy rule or preset that matched, and a timestamp you can compare against the action timestamp. If any of those fields are absent, the log cannot support an investigation into that action.
If you are designing the logging layer from scratch, treat the policy decision event as the primary record and the action result as the secondary one. Build the chain from there.
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