Evidence of decisions and effects

AI Agent Audit Trail

Design an audit trail that connects requests, sources, approvals, tool attempts and verified business outcomes. Includes an event contract and a contract-amendment reconstruction exercise.

When a disputed action reaches an auditor, a transcript saying “done” is weak evidence. The reviewer needs to know which request was authorised, which source version was used, what a person approved, what the tool attempted and what the destination system actually recorded.

An agent audit trail should preserve that chain without collecting every piece of conversation content indefinitely. This guide is for service owners, assurance teams and engineers defining reviewable business evidence. It uses an original contract-amendment example to distinguish a request, an attempted action and a verified effect.

Start with the question the reviewer must answer

Imagine an assistant that prepares an approved contract amendment for publication in an internal repository. The business later finds the wrong version visible. The useful questions are specific: Did the reviewer approve amendment version 3 or version 4? Did the publication request name the right repository record? Was a newer document uploaded while approval was pending? Did the service retry after a timeout?

A broad dump of prompts may contain clues but still fail to answer these questions. A well-designed event chain identifies the document, approval, action and result directly. Define the audit questions before choosing the logging product. Different services need different evidence: a knowledge answer may need source citations, while a record-changing action needs authority and effect records.

Distinguish conversation, trace and business evidence

A conversation records what participants said. A technical trace helps explain how a request moved through components. A business audit event records a consequential state change or decision. These views can be linked, but they are not interchangeable.

OpenTelemetry’s trace documentation describes spans, trace context and links for connecting operations across services. Such identifiers can connect diagnostic evidence to an audit case. They do not by themselves establish that a contract was validly approved or that a publication succeeded. That meaning must come from the application’s event contract and authoritative system observations.

Do not require access to hidden model reasoning. Reviewable evidence consists of the permitted inputs or references, source versions, generated proposal, policy evaluation, human decision and observed effect. A model’s later explanation of why it acted can be a new generated response, not a reliable substitute for records captured at the time.

A minimum event contract

Suggested fields for a consequential agent event
Field groupWhat it answersExample design choice
Event and case identityWhich event belongs to which business request?Unique event ID, stable case ID and linked attempt ID
Time and orderingWhen did it occur and when was it recorded?Event time, ingestion time, time zone and causal predecessor
Actor and authorityWho requested, proposed, approved or executed?Authenticated actor reference, role and decision reference
Resource and source versionWhich object and evidence were involved?Contract ID, amendment version and controlled evidence reference
Release and policy versionWhich implementation and rules applied?Model/configuration release, tool version and policy revision
Proposed and attempted actionWhat change was allowed and what was sent?Normalised operation, target and protected payload fingerprint
Observed outcomeWhat actually happened?Destination record/version, verification result or explicitly unknown state
Evidence handlingWho can inspect the supporting material and for how long?Access class, retention category and evidence-store reference

This is a suggested application design, not a universal legal schema. Do not populate every field with personal data when a stable restricted reference is sufficient. Keep schema versions so later reviewers can interpret older events correctly. If an event field changes meaning, version the contract rather than silently reusing its name.

Reconstruct an amendment without guessing

In the illustrative sequence below, the assistant may publish only an explicitly approved amendment through a registered repository tool. The identifiers are fictional. The business has decided that a changed document version requires renewed approval.

  1. Request recorded: case C-1042 asks to publish amendment A-91 version 3 to contract R-28.
  2. Proposal prepared: the assistant references the approved source and proposes a specific target and payload.
  3. Approval captured: an authorised reviewer approves that exact version and target under policy P-7.
  4. Precondition checked: the repository now contains a newer source version, so the service rejects the stale proposal and records why.
  5. Revised proposal reviewed: version 4 receives a new approval with its own evidence reference.
  6. Publication attempted: the registered tool sends the approved request with a stable operation identifier.
  7. Effect verified: the repository returns publication revision 12, and a read-back confirms the expected document is visible.

The record should let a reviewer distinguish a correctly blocked stale request from a failed service and a completed publication. If the tool times out, record an unknown outcome and reconcile it. Do not convert a missing response into a success event, or overwrite the original attempt when a later check finds the publication.

This sequence also clarifies what to test. Change the document after approval, resend an operation identifier, delay the repository response and remove the reviewer’s authority before execution. Verify the destination state and the event chain. The oversight model describes how approval binds to a particular action, while the evaluation guide helps turn these cases into release evidence.

Do not confuse replay with reproduction

An audit replay reconstructs recorded events. It does not necessarily reproduce the same model output by sending the prompt again. Models, tools, data and permissions can change; even a retained configuration may not make a probabilistic service identical. Preserve the actual relevant output or a controlled evidence reference when it is needed for review.

Re-executing a tool call is especially different from inspecting it. A reviewer should not have to publish the amendment again to understand the first publication. Build a read-only investigation view and clearly separate any authorised recovery operation. Retain the relationship between original, retry, reconciliation and compensating events.

Time ordering needs care in distributed systems. Record event time and ingestion time, and use causal links rather than assuming every clock is perfectly aligned. A delayed log arrival should not make it appear that approval occurred after execution if the underlying evidence proves a different order. Equally, do not use a convenient display order to conceal a genuinely missing approval.

Protect the audit evidence from the system it reviews

Restrict who may write, read, export and administer the audit store. The running agent should not be able to erase its own history. Consider append-only records, protected storage policies and independently managed integrity checks appropriate to the assurance requirement. A hash can help detect a changed payload when its reference is trusted; it does not prove that the original payload was truthful or that the action was authorised.

Record corrections as additional events that explain the relationship to the original. Deleting or editing an inconvenient event destroys context. At the same time, evidence protection must coexist with applicable data-retention and deletion requirements. Design that interaction with the responsible privacy and records teams, rather than treating “immutable” as permission to retain everything forever.

Test logging failures. What happens if the collector is unavailable, the queue is full or a write fails? Define which actions may continue with a durable local buffer and which must pause because the required evidence cannot be recorded. A high-consequence service should not silently proceed without the evidence on which its approval depends.

Minimise sensitive content at collection

The OWASP Logging Cheat Sheet warns against directly logging secrets and unnecessary sensitive information, and recommends testing logging failures. Apply that guidance before collection. Removing a credential from a dashboard does not remove it from the underlying log store, replicas or exports.

Separate an operational event from its restricted supporting content. The event may identify a case, operation and outcome; an authorised investigator can access a controlled document version when needed. Avoid logging full access tokens, passwords, raw attachments or every model context by default. Check errors too: an exception message can inadvertently reproduce a request payload.

For Saudi personal data, align purposes, access, retention and rights handling with the PDPL review. If traces or evidence leave the approved environment, include them in the residency register. Auditability does not exempt a data flow from those reviews.

Give different reviewers the view they need

An operations analyst may need failed-case counts and tool status. A security responder may need authority decisions and destination details. A business reviewer may need the approved document, proposed change and final result. A privacy reviewer may need access and retention evidence. Grant those views deliberately rather than giving every role full transcripts.

Measure whether investigations are possible. Select a closed case and ask an authorised person who did not build the agent to answer five questions: what was requested, what was allowed, what was approved, what happened and which evidence supports each answer. Record missing links and the time required. This exercise is more informative than celebrating a large volume of logs.

Maintain the trail as the service changes

New tools need event definitions and outcome verification before release. New source types need version references. A revised approval process needs an updated decision record. The governance policy should make these dependencies part of change approval, and operational monitoring should alert on gaps, unknown outcomes and broken correlations.

Open for AI’s agent development can be scoped to produce the evidence your workflow requires. Bring one action an auditor may need to reconstruct and define the event chain before deciding how much content to retain.

LET’S WORK TOGETHER

Ready to build what’s next?

Tell us about your project or the platform you want to explore, and we’ll come back to confirm a suitable time.