Audit, Detection, and Incident Response › Why audit trails for agents are hard

Michael BrenndoerferDecember 2, 20263 min read
Language AI HandbookAll chapters
Part 61 of 67Agentic AI and Protocol Security
Chapter 471Audit, Detection, and Incident Response › Why audit trails for agents are hard
Reading section 2 of 10 · Why audit trails for agents are hard · 3 minSection 2 of 10 · 3 min

Section 2 of 10 · 3 min read

Reading settings

Definitions

Choose how many terms have tooltips.

Article links

Make inline references clickable

Notes & comments

An agent’s tool call can reflect earlier retrieval, an intermediate summary, and the policy in force at execution. The decision and the completed effect can appear in separate records.

A model’s explanation is evidence of what it reported. Investigators also need observations from the surrounding application, including which inputs were supplied, what output was returned, and what the gateway did.

This produces four concrete difficulties that shape everything in this chapter. We treat each in turn below.

The action-to-cause gap. A tool invocation may follow a retrieval several steps earlier. Record stage-level provenance so a responder can find the relevant retrieval result, summary, and subsequent decision even when the final prompt omits the original document.

Versioned references and dependency identifiers can preserve that lineage. When investigating a specific incident requires source content, collect only the approved content under the protected retention policy. A log of the final prompt alone leaves preceding stages unobserved.

Nondeterminism and reproducibility. A replay of the same input may produce a different output. Under temperature sampling, or even greedy decoding across model versions, a replay of the recorded input may not reproduce the recorded action. This means audit records must capture not just inputs but the decoding configuration and model version if you ever want to reason about "would this happen again." We discussed decoding configuration in Nucleus Sampling and model versioning matters everywhere in Evaluation Harnesses and Reproducibility.

A replay can diverge because sampling drew a different result, the recorded input was incomplete, or a version or runtime setting changed. Compare resolved conditions before attributing the divergence. A replay gives one observation that a responder can compare with contemporaneous records.

The volume and privacy tension. A prompt can include private documents or personal data. Storing prompts verbatim creates an additional sensitive data store. Record the minimum set of approved metadata needed for routine investigation, and specify when separately protected content may be collected.

A metadata tier can carry two pieces of evidence about a request without recording its text: which policy version ran and what decision it returned. Keep even those IDs and decisions behind access controls. For investigations that need content, define a separate collection policy that specifies which data may be captured, who may read it, and when to delete it.

Adversary access. The threat we worry about most is an adversary who has already compromised a component of the system. If that adversary can edit or delete audit logs, the entire detection layer is defeated, and worse, it gives you false confidence during response. Send the records to a sink whose write, deletion, and read privileges are independent of the agent's credentials.

The "off-box" part deserves emphasis because it is the part most likely to erode under operational pressure. If the audit sink is reachable with the same credentials the agent uses for its normal work, then an adversary who compromises the agent can rewrite the audit trail using those same credentials. The sink must sit behind a separate authentication boundary, ideally one the agent has no path to at all, reached only through a one-way export that the agent cannot read back. This is an instance of the general least-privilege principle applied to the audit system itself: the audit system is a system with its own trust boundary, and its credentials must be as carefully scoped as any other.

Each of these difficulties gets its own treatment below.

Comments

Add to the conversation

A question, a correction, or an example from your own work.

No comments yet. Be the first to share your thoughts!

Newsletter

Stay up to date

Get new articles, book updates, and notes on AI and technology.

Unsubscribe at any time. Privacy policy