What chain of custody means for a tester
Chain of custody is a term from forensic practice: a documented, unbroken record of possession and handling for an item of evidence, from creation to presentation. NIST SP 800-86 frames the record as the answer to four questions at every step: who handled the item, when, what was done to it, and how its integrity was preserved. Test evidence needs the same treatment when a result can be contested, whether the item is a screenshot, a log, a packet capture, a dataset, a detector report or a C2PA validator's output. The record has two layers: a hash that proves the bytes are unchanged, and a log that proves who held them.
Why a test result needs one
Two disputes recur. A vendor says a benchmark test set was altered after the run; the record shows the same dataset hash before the run and in the report. A platform team says the fixture behind a broken-manifest finding was corrupted in transit; the record shows its hash at creation, upload and validation. The surrounding document is the subject of the guide to records a hostile reader can check; this guide covers the chain those records depend on.
For every item, at every step: who, when, what was done, and a hash proving the bytes are the same. Miss one step and the item is an anecdote.
The six elements
Hash at creation. Compute a SHA-256 digest as soon as the producing tool writes the item, before any copy, upload or rename. A hash computed an hour later proves only that nothing changed after that hour. Custody log. Append one entry per event: item identifier, hash, handler, action, and a timestamp from a clock synchronised to a common source. NIST SP 800-92 treats synchronisation as a precondition for log evidence: logs with unrelated clocks cannot be ordered. Read-only storage. Keep the original where overwrites and deletions are rejected, such as a locked object store, and re-check the hash on every read.
Named handlers. Every event names a person or a specific automated identity; an entry saying the QA account exported the file does not say who did. Documented transformations. A cropped screenshot, a filtered log or a redacted export is a new item with its own hash, its own log entry and a link to the parent's hash, and the parent is kept. Signed or time-stamped report. The report lists every hash it relies on and is signed with a named key or time-stamped with an RFC 3161 token, which binds its hash to a time asserted by a third party.
| Evidence type | What to hash | What to record | Weakest point |
|---|---|---|---|
| Screenshot | File as written by the capture tool | Build, screen, handler, UTC time | Cropped copy replaces the original |
| Application or server log | Rotated file or export | Host, source, time range, clock offset | Pulled later from a pruned store |
| Packet capture | The pcap or pcapng file | Interface, filter, host, start and stop | Filters applied afterwards, passed off as raw |
| Exported dataset | Archive plus per-file hashes | Source, query, row count, schema version | Reordering that changes bytes silently |
| Detector report | Raw output before formatting | Detector and model version, threshold | Summary kept, raw output discarded |
| C2PA validation output | Validator's machine-readable output | Validator version, trust list, asset hash | Validating a re-encoded copy |
How to set up a chain of custody for test evidence
Decide what counts as evidence
Before the run, list the items whose integrity might be questioned: fixtures, raw outputs, screenshots, captures, exports. Put the list in the plan, following the template for a test plan that survives review.
Synchronise the clocks
Point every producing machine at one time source, record each offset at the start of the run, and log in UTC. A five-minute drift between hosts turns a clear sequence into a dispute.
Hash at creation, automatically
Wrap the capture and export tools so the digest is computed in the step that writes the file. A post-run script proves only the folder's state when it ran.
Write the custody log as an append-only stream
Each entry: item identifier, SHA-256, handler identity, action, UTC time, parent hash if any. Store it where entries cannot be edited, and hash the log after each session.
Store originals read-only and derive from copies
Upload originals to a write-once location whose reader verifies the hash before returning bytes. When a copy is cropped or filtered, record the tool, parameters, new hash and parent hash.
Sign or time-stamp the report
List every cited hash in the report, then obtain an RFC 3161 token for the report's own hash or sign it with a named key, and store the token with the report.
Worked example: one release, 312 evidence items
A team testing a document ingestion service with an AI text detector and a signed image pipeline counted its evidence items from one release and how many kept an unbroken chain. The counts are invented but realistic.
Of 312 items, 281 kept an unbroken chain (90.1%, 95% interval 86.2% to 93.0%). Twenty-two of 140 screenshots had been cropped before attachment to defect reports and the originals overwritten, so the creation hash matched no surviving file. Five of 14 packet captures came from a laptop whose clock was 11 minutes behind the log server; they were intact but could not be placed in sequence. Four detector reports had been reformatted and the raw output deleted.
The fix for screenshots was a capture tool that writes the original to the read-only store and hands the tester a working copy; for captures, a clock check before every run. The 31 broken items stayed in the report, labelled unsupported, since removing them would itself be an undocumented change.
Pitfalls that break the chain
- Hashing after the fact. A digest computed at archiving proves the state at archiving. Everything before it is unrecorded, and that is the window a challenger asks about.
- Overwriting the original. Cropping, redacting or filtering in place destroys the item the creation hash refers to. Derived items need their own hash and a surviving parent.
- Shared accounts and unnamed automation. An entry naming a team account or a generic bot does not answer who. Give each job its own identity and each person their own login.
- Trusting the summary. A dashboard, a spreadsheet or a formatted PDF is a transformation of the raw output. If the raw file was discarded, the summary rests on nothing.
What to record and how to report it
The report cites items rather than describing them from memory: for each, the identifier, the SHA-256, the creator, the UTC creation time and the storage location, plus the parent hash and transformation for derived items. Attach the custody log, or its hash, and the report's RFC 3161 token or signature. For a provenance check, include the fields listed in a verification session that names its validator. ISO/IEC/IEEE 29119-3 gives this material a place in the test completion report, and the share of items with an intact chain, with denominator and interval, belongs with the metrics a test manager tracks each release.
State the gaps rather than curating them away. The hub for authenticity and detector testing covers the measurements these records protect, and the guide to pushing signed images through every CMS stage shows a fixture run where the custody chain is the whole test.
Common questions
What is a chain of custody for test evidence?
A documented, unbroken record of who held each item of test evidence, when, and what was done to it, backed by a hash computed at creation and re-checked at every step. A reader who distrusts the tester can confirm the item is the bytes the test produced.
Is a SHA-256 hash enough on its own?
No. A hash proves that a set of bytes is unchanged since it was computed, and nothing about when they were created or by whom. It needs the custody log for possession, a synchronised timestamp for sequence, and a third-party time-stamp token on the report.
Do I need a chain of custody for every test run?
Only for runs whose results might be contested: acceptance of a supplier's delivery, a published detector benchmark, a finding against a provenance pipeline, or anything an auditor or a court may see. Decide in the plan; a chain cannot be built later.
What does an RFC 3161 time-stamp actually prove?
A time-stamp authority signs the hash of your document together with the time it received that hash. The token proves the document existed in that exact form at that time, according to a third party, without revealing it. It says nothing about whether the content is correct.
Can automation produce the custody chain?
Most of it. Capture and export tools can hash at creation, the pipeline can append to the custody log under its own identity, storage can enforce write-once, and a job can request time-stamp tokens. Naming the human handler and recording deliberate transformations stay manual.
A chain of custody turns a folder of screenshots, logs and exports into evidence that a supplier, an auditor or a court can check without trusting the person who ran the test. Hash at creation, log every handler, store originals read-only, and time-stamp the report.
Sources
- NIST SP 800-86, Guide to Integrating Forensic Techniques into Incident Response
- RFC 3161, Internet X.509 Public Key Infrastructure Time-Stamp Protocol (IETF)
- ISO/IEC/IEEE 29119-3:2021, Software testing, Part 3: Test documentation
- NIST SP 800-92, Guide to Computer Security Log Management
Further reading named in the text
- Kent, Chevalier, Grance and Dang, Guide to Integrating Forensic Techniques into Incident Response, NIST SP 800-86 (2006)
- Kent and Souppaya, Guide to Computer Security Log Management, NIST SP 800-92 (2006)
This guide is part of the testing AI systems hub. It is best read alongside evidence-grade test records for authenticity systems and testing a content provenance pipeline, which cover the neighbouring questions.