An audit trail for an AI-assisted change should name the actor, the input and the approval. A chat transcript rarely holds all three: it may show who typed, but model version, inputs and approval usually live elsewhere.
The change ships fine, but nobody can reconstruct who prompted, which model version answered, and who approved. W3C PROV-DM offers a small vocabulary: entities, activities, responsible agents. An activity uses input entities and generates outputs; an association names the responsible agent. The limit matters — provenance records lineage, not correctness.
Constraints first
Three constraints shape the design. Records are append-only. They are not written by the process they audit. They outlive model rotation.
So put provenance outside the assistant: the assistant emits an event, a separate writer stores it.
{"change_id":"chg-8841","activity":"patch.authz", "used":["repo:abc123","prompt:v3"],"agent":"svc-ci", "prompted_by":"user:117","approved_by":"reviewer:42", "at":"2026-11-30T10:12:04Z"} Illustrative, not executed. change_id is the stable per-change key: mint it once, reuse it on every retry, and the writer can spot duplicates. The key alone does not make the write idempotent; HTTP idempotency concerns the intended effect on the server, and repeated responses may differ (RFC 9110 §9.2.2). Deduplication is the writer's job.
If the writer is down, block the merge rather than skip evidence. An unknown model version is recorded as unknown, not omitted.
Choose the detail level deliberately. Kubernetes API audit can record metadata — user, time, resource, verb — or add request and response bodies at a higher level; metadata alone cannot reconstruct an omitted payload (Kubernetes auditing).
Test
Pick one merged change and reconstruct it from its record alone, without the chat UI. Observe whether you can name the prompting user, the prompt or model version, the code revision, the approving agent, and the order of events from the at values. If any is missing, the gap is structural: add the field at emit time and reconstruct a second change. If two people disagree about who approved, the record holds opinions rather than identifiers; store IDs.
What to change next
Start with the approval association, not the full lineage graph. It is one identifier: cheapest to verify, and it names who is accountable.
This article was created with AI assistance.

