AI agent audit logs: what to record, field by field

The short answer

An agent audit log must let someone who was not there reconstruct one case: what came in, which model and step versions handled it, what every tool call sent and returned, what a person saw, and who approved and when. Record identifiers, hashes and versions for everything, keep the log in your own environment, make it append-only, and retain it as long as the business record it explains.

In this guide

  • Audit log versus engineering trace
  • The field list, in six groups
  • How long to keep it, and how big it gets
  • How examiners and internal audit actually use it

Is an audit log the same as a trace?

No, and treating them as the same is the most common mistake.

Engineering traceAudit log
Built forEngineers debuggingAudit, compliance, examiners
UnitA request or spanA business case
CoverageOften sampledEvery case, every consequential event
Answers"Why was it slow or wrong?""Who decided what, on what evidence, under which version?"

Tracing standards show the gap. OpenTelemetry's generative AI conventions, still marked as in development, define attributes such as the response model and response ID, but treat message content, system instructions and tool definitions as opt-in, and content capture defaults to off (OpenTelemetry GenAI semantic conventions). That default is sensible for privacy. It also means a stock trace may not contain what the model read or wrote. Define explicitly what your audit record must capture.

Which fields should the log hold?

One event per step, all tied to a case ID. Six groups.

1. Case and run identity

FieldWhy it is there
case_idThe business key: claim number, loan ID, onboarding ID
run_id, step_id, sequenceOrder of events within the case, with no gaps
workflow_id, workflow_versionWhich version of the process handled this case

2. Inputs

FieldWhy it is there
document_id, source, received_atWhich file, from which mailbox or system, and when
sha256 of each documentProves the file reviewed later is the file the agent read
masked_version_id, masking_rules_versionWhat the model was allowed to see

Store hashes and pointers, not copies. The document stays in the claim or loan file under its own retention rule.

3. Model calls

FieldWhy it is there
provider, model, model_versionThe exact snapshot. An alias like "latest" is not a version
step_definition_versionThe prompt, instructions and schema for this step, as a versioned artefact
input_ref, input_hashWhat was sent, by reference to stored masked content
output, output_hashThe structured result the next step used
validation_resultSchema and rule checks passed or failed

4. Tool calls and deterministic steps

FieldWhy it is there
tool_name, tool_versionWhat was called
argumentsThe exact payload, with sensitive values masked
result, status, errorWhat came back
idempotency_keyShows a retry did not pay twice
rule_id, rule_version, rule_inputs, rule_outputFor coded steps: which rule fired, on what values

5. Approvals

FieldWhy it is there
approver_id, approver_roleA named person from your identity provider, never a shared login
presented_payload_hashWhat the approver was shown
decision, reason, decided_atApprove, reject, send back or escalate, with the reason and time
executed_payload_hashMust equal the presented hash. If it differs, something changed after approval

See approval gate design patterns for why the two hashes matter.

6. Changes and integrity

FieldWhy it is there
change_id, changed_by, approved_by, test_results_refEvery workflow, rule, prompt or model change, with its approval and test evidence
timestamp in UTC from a synchronised clockOrdering across systems
prev_event_hashEach event carries the hash of the one before, so deletions and edits show

What does one record look like?

Example: a model-call event from an auto claim. All identifiers are invented.

{
  "case_id": "CLM-2026-004471",
  "run_id": "r-91c2", "step_id": "extract_estimate", "sequence": 7,
  "workflow_version": "auto-pd-v14",
  "timestamp": "2026-11-18T14:02:11Z",
  "actor": "agent:extraction",
  "model": {"provider": "self-hosted", "name": "extract-8b", "version": "2026-10-03"},
  "step_definition_version": "extract_estimate@v6",
  "inputs": [{"document_id": "doc-5521", "sha256": "9f2c...e1a0", "masked_version_id": "m-5521-2"}],
  "output": {"estimate_total": 9240.00, "currency": "USD", "shop_id": "S-0193"},
  "validation_result": "pass",
  "prev_event_hash": "b7d4...03fe"
}

Nothing in it is personal data. The log points to the claim system for that.

How long should you keep it, and how big does it get?

Keep the log for as long as you keep the business record it explains. When your records schedule sets a retention period for a claim or credit file, apply that same retention period to its agent log. Your records team sets the number. The log should not expire before the file does.

To limit the conflict with data minimisation, keep debug traces on a short clock and log masked values, hashes and references, so the long-lived record is not a second copy of customer data. See zero data retention explained.

Size is rarely the obstacle. A fictional sizing: 2,000 cases a day, 30 events per case, 2 KB per event.

  • Per day: 2,000 × 30 × 2 KB = 120,000 KB, or 120 MB
  • Per year at 250 working days: 120 MB × 250 = 30 GB
  • Over seven years: 30 GB × 7 = 210 GB

That fits on a single disk. The expensive design is the one that copies every PDF into the log.

How do examiners and internal audit use it?

Under the NAIC model bulletin on insurers' use of AI, an insurer in an investigation or market conduct action can expect questions about its AI systems, including documentation of validation, testing and auditing, data provenance and lineage, an inventory of AI systems, and due diligence and contracts for third-party systems. The bulletin also says its goal is not to prescribe specific documentation requirements (NAIC Model Bulletin, Section 4). It tells you the questions. The log is how you answer them.

In practice the log is used three ways.

  1. Case walkthrough. Pick one case and replay it event by event. Does every payment trace back to evidence and an approval?
  2. Sample testing. Pull 25 cases. For each, check that the approval timestamp comes before the system write, and that the presented and executed hashes match. A control that holds on 25 of 25 is evidence. One that holds on 23 is a finding with two case numbers attached.
  3. Change testing. List every workflow and model version that ran during the quarter, along with who approved each change and its supporting test results.

Where it goes wrong

  • "We have the chat transcript." A transcript shows what the model said it did. The tool-call record shows what happened.
  • The vendor holds the only copy. If the contract ends, so does your evidence. Export or host it yourself.
  • No record of what the approver saw. You can show that someone clicked approve, and not what was on the screen.

How Context Labs fits in

Context Labs (thecontextlabs.com) is an AI workforce platform for insurance, banking and private equity. Every action is logged and every role controlled, and you define which users and agents can retrieve information, invoke tools or take action. Expert corrections are tested, reviewed and approved before the next run, and each change is saved with its reasoning and approval. Context deploys in your private cloud or on-premise, so data stays in your environment. Ask us for our security documentation and we will walk your security team through the architecture.

FAQ

What should an AI agent audit log include?

At minimum: the case ID, each input document with a hash, the model and its exact version, the version of each prompt or step definition, every tool call with arguments and results, each output and its validation result, the approver's identity and decision, and synchronised timestamps.

How long should AI audit logs be retained?

As long as the business record they explain. If your records schedule keeps a claim or loan file for a set number of years, keep the agent log for that case for the same period. Short-lived debug traces can expire sooner, provided the audit events are stored separately.

Do we need to log full prompts and outputs?

You need to be able to reconstruct them. Storing a reference and a hash to masked content, plus the versioned step definition, usually achieves that without placing customer data in the log. Store structured outputs in full, because later steps and approvers relied on them.

Should the audit log contain personal data?

As little as possible. Log masked values, hashes and pointers to the system of record. That keeps the log useful for years without creating a second store of customer data to secure, minimise and eventually delete. Where a value is essential, such as a payment amount, log it deliberately.

Can we rely on the model provider's logs?

No. A provider's logs, where they exist, cover model requests only and are kept on the provider's terms. They do not show your tool calls, your approvals, or the version of your workflow. The audit record has to be produced by the system that runs the case, and held where you control it.

Sources

Frontier Intelligence in your hands.

Book a demo