Design stable document identifiers for audit logs
28 October 2026
Two unrelated files can both be called Contract.pdf. Record a document identifier that survives a rename and a separate revision identifier for the content involved in each event. Keep the filename as the label a person actually saw.
Filename versus stable identity and revision identity
Alongside the document reference, an audit record needs enough context to explain what happened. NIST identifies the event, time, source, outcome and associated identity NIST SP 800-53 Rev. 5, AU-3 Content Of Audit Records. An interaction identifier can connect related operations across a service OWASP, Logging Cheat Sheet.
| Identifier type | Mutability | Primary scope | Audit log role |
|---|---|---|---|
| Filename | Mutable | User interface and filesystem | Contextual display label at the time of the event. |
| Stable document ID | Immutable | System lifecycle | Primary key (e.g. CA) tracking the document across renames and moves. |
| Revision ID | Immutable | Content state | A version ID identifies the particular revision. A separate digest can be kept for its bytes. |
A matching digest can show that two copies have the same bytes. They may still be two separate business records. Where identifiers are issued per workspace, include the workspace reference as part of the key.
Reconstructing file renames without event collisions
Consider a scenario where two distinct documents are uploaded under the identical name Contract.pdf. Without stable entity identifiers, logging actions against Contract.pdf merges unrelated audit events.
To isolate events correctly, assign each upload a unique, immutable document identifier alongside its initial revision tag. The published reconstruction example links an input revision to an output revision for a different event, a processing job. Apply the same precision to the object of a rename.
In a separate fictional rename, suppose File A receives stable identifier CA (CA/V1) and File B receives CB (CB/V1), with both initially sharing the display name Contract.pdf. Following an administrative review, File A is renamed to Contract_Approved.pdf.
The export should let a reviewer reconstruct all three events.
- The first upload records
Contract.pdfas revisionV1of documentCA. - The second upload records the same filename against revision
V1of documentCB. - The
RENAMEevent for revisionV1of documentCAchanges the recorded label fromContract.pdftoContract_Approved.pdf.
When an auditor queries the history of CA, filtering by Document ID CA retrieves the initial upload and the subsequent rename event without merging events from CB. The rename is reconstructed accurately, and CB retains its independent audit history under Contract.pdf.
If the contents also change, record the new revision and its relationship to the previous one. A filename ending in “Approved” is not evidence that an approval event occurred.
Test the reconstruction from an exported log
Check the exported log before relying on a filename search.
- Check that every document event records an immutable system document ID (such as a UUID) alongside the display filename.
- Verify that file renames generate explicit audit entries containing the stable document ID, previous filename, new filename and actor identity.
- Exclude bearer tokens, API keys, session cookies and raw request headers from audit records and test evidence.
- Run a test in which duplicate filenames undergo independent renames, verifying that query filters on stable document IDs return isolated, unmerged event streams.
Part of the PDF editor audit trails: what should a business log record? guide.
Published by Arke Technologies (Pty) Ltd, Johannesburg. Drafted with NotebookLM. Source checks and editing by Kairos (Codex).
