Privacy and preparation
Dataset processing audit log privacy: prove the step, not the person
By SourceX Editorial · Reviewed by Noah Loul ·
10 sections
Short answer
A dataset processing audit log should prove which rule version ran on which batch, by whom, with what counts and output hashes, without holding the values it changed. Keep counts, versions, batch IDs and file hashes; send original-to-replacement pairs, file paths and record keys to a separate key store; log no raw error text. Then plant invented canary values and search every log sink before release.
Redaction
Dataset processing audit log
Key takeaways
- A processing log proves which rule version ran on which batch, by whom, with what counts and output hashes; it never needs the values it changed.
- Original-to-replacement pairs are the additional information that keeps pseudonymised data personal under ICO and EDPB guidance, so they belong in a separate key store.
- In three open-source de-identification tools, 38 of 143 log calls with a runtime value can carry record-linked content, 30 of them through file paths or exception text.
- Thirty of those 38 are warnings, errors, exits or prints, so lowering the log level does not remove them.
- A canary sweep with zero hits outside the key store, recorded as its own audit entry, settles whether the log can ship.
What should a dataset processing audit log prove, and what must it leave out?
A dataset processing audit log should prove that each approved step ran on the right batch, with the right rule version, under a named operator, and with a counted result. It should not hold the values those steps read or wrote: originals, original-to-replacement pairs, or record text copied into notes and error messages. If the log can tell someone what a customer's account number was, it has become a second copy of the dataset, usually guarded less carefully than the first.
That makes the log a minimization decision. The ICO, explaining the UK GDPR's data minimisation principle, breaks it into three tests: personal data must be adequate, meaning sufficient to fulfil the stated purpose; relevant, meaning rationally linked to it; and limited to what is necessary. For a processing log the purpose is proof of processing, so a field earns its place only when an auditor, a licensee's diligence reviewer or your own incident team needs it to show what happened.
U.S. health rules leave the same choice with the organization. HHS's technical safeguards paper on the HIPAA Security Rule, which binds covered entities and business associates, says the rule does not identify the data audit controls must gather or how often audit reports should be reviewed; the entity works that out from its risk analysis. No regulator hands over a field list, so that list is the decision this page settles; which events a licensing transaction should record is a separate question, covered on the audit log requirements page.
How does a processing log turn into personal data?
A processing log turns into personal data as soon as it holds anything that links an output back to a person, and a de-identification log is assembled from exactly those links. A line that records the name a rule found and the PERSON_0417 it wrote in its place is, read beside the output file, a lookup table.
Regulators treat that table as the thing to protect. The ICO's pseudonymisation guidance, written for the UK GDPR, says pseudonymised data is personal data in the hands of someone who holds the additional information, and that the additional information must be kept separated from the pseudonymised data using appropriate technical and organisational measures. The EDPB's Guidelines 01/2025 on pseudonymisation, released for public consultation in January 2025 under the EU GDPR, describe that additional information as including tables matching pseudonyms with the identifying attributes they replace, as well as cryptographic keys; a footnote extends the separation duty to original data kept in its pre-pseudonymisation form.
Hashing does not neutralize the line. HIPAA's re-identification provision, 45 CFR 164.514(c), allows a covered entity to assign a code for later re-identification only if the code is not derived from or related to information about the individual, and it bars disclosing the mechanism for re-identification. A hash of a name or an account number is derived from that information, so a log full of hashed identifiers works as a re-identification aid rather than a neutral record key.
NIST's draft revision of its log management guide, SP 800-92 Rev. 1 (initial public draft, October 2023), asks organizations to determine whether a log source might intentionally or inadvertently capture sensitive data, including personal information, passwords, private keys and access tokens, and to plan how disclosures recorded in logs will be handled. Its 2006 guide already asked that privacy staff be consulted when logs hold personal identifiers. Inadvertently is the word to plan around.
What do de-identification tools actually write to their logs?
In three maintained open-source de-identification tools we read, about a quarter of the log and console messages that include a runtime value can carry something linked to an input record, and most of that arrives through file names and error text rather than deliberate logging of record values.
We parsed the package source of pydicom/deid, blairconrad/dicognito and DataFog/datafog-python at commits pinned on 2026-10-28 and found 186 print, warning and logging calls, 143 of which put a runtime value into the message. Each of the 143 was labeled by what that value can contain. Of the 143, 38 (26.6 percent) can carry record-linked content: 14 include an input file path, folder name or image URL, 16 include the text of a caught exception, 4 include a replacement value and 4 include a record value (a value read from an input record). The remaining 105 carry configuration, counts, types or version strings.
The record-value and replacement-value calls show how ordinary the route is. In deid, the warning raised when a date jitter cannot be applied prints the field object, whose printed form includes the DICOM element and therefore its original value, because pydicom prints an element with its value. In DataFog, two print statements write the first word of the input text, although they sit in a module that only the project's tests import. dicognito prints a summary of anonymized accession numbers, patient IDs and patient names unless it runs with its quiet flag; if an operator tells it to keep an element such as the patient name, that summary row shows the kept original.
The bigger lesson sits in the 30 path and exception-text calls: file names often carry the identifiers a pipeline exists to remove, and exception text is written by whichever library failed. DataFog's own guardrail module says so in a code comment: engine exception messages can embed the text being scanned, so interpolating the exception string would leak matched PII into tracebacks and logs. That module logs only the exception type, while 16 other calls in the same package interpolate exception text (one counted under file paths). Python itself shows the pattern: in Python 3.13, int('ACCT-7781') fails with the message invalid literal for int() with base 10: 'ACCT-7781', so any log that records the error records the value.
Quieting the log level does not remove the problem: 30 of the 38 are warnings, errors, exits or plain prints, the messages a pipeline keeps when debug and info output are switched off. Per-tool counts are in the table below, and the methods note at the end states every counting rule.
| Tool and commit | Calls with a runtime value | Record or replacement values | File paths or names | Exception text |
|---|---|---|---|---|
| pydicom/deid, df5450f1 | 78 of 99 | 4 (1 record, 3 replacement) | 10 | 0 |
| blairconrad/dicognito, f0ffc4ca | 11 of 12 | 2 (1 record, 1 replacement) | 2 | 1 |
| DataFog/datafog-python, cf81370d | 54 of 75 | 2 (record) | 2 | 15 |
| All three tools | 143 of 186 | 8 | 14 | 16 |
The field routing table: log it, transform it, lock it away or drop it
Route every candidate field to one of four places: the processing log as written, the log in a transformed form, a separate key store under restricted access, or nowhere. The test for each field is the ICO's three-part minimization test applied to proof of processing: does an auditor need it, is it linked to that need, and is there a smaller form that proves the same thing?
Two rules decide most rows. Anything that pairs an output with an original goes to the key store or nowhere, because that pairing is the additional information the ICO and the EDPB say must be kept apart. Anything written by code you do not control, such as exception text and third-party summaries, is assumed to carry content until a canary sweep shows it does not. The routing table below lists the fields that come up in almost every preparation pipeline and the safer form to write instead.
| Candidate field | What it proves | Routing decision | Safer form to log |
|---|---|---|---|
| Rule ID and rule version | Which logic ran on the batch | Keep in the processing log | As written, plus the hash of the configuration file |
| Replacement counts by field and entity type | That the rule fired and how often | Keep in the processing log | Counts per batch, never per person |
| Output file hash and batch ID | Which exact files the step produced | Keep in the processing log | SHA-256 of each output file with a batch ID |
| Source file path or name | Where an input came from | Transform before logging | Batch-local sequence number; the path stays in the key store |
| Source record key | Which record a correction or deletion touched | Key store only | Per-batch row number, mapped to the key in the key store |
| Original value or original-to-replacement pair | Nothing the log needs to show | Never in the log; pairs only in the key store when reversal is approved | Entity type and count |
| Hash of an original value | Linkage of one person across batches | Key store only, under a secret key and access control | Random token issued by the key store |
| Exception message or reviewer free text | Why a step failed or was overridden | Never verbatim | Exception class, rule ID, row number and a coded reason |
How do you prove the log is clean before release? The canary sweep
Prove it with a canary sweep: plant invented values in a test copy of a batch, run the real pipeline, then search every place a message can land. A clean result means zero hits outside the key store, and the sweep is recorded as an audit entry of its own.
The sweep tests behavior rather than intentions, which matters because leaks come from code paths nobody meant to log from. Run it on the final configuration and repeat it whenever a tool version or log setting changes. The steps:
- Build a canary set of invented values for each identifier type the pipeline handles: names made up for the test, account numbers in a format your systems accept but never issue, and dates no record holds. Keep the set in the key store.
- Plant canaries in three places: inside record fields and free text, inside one file name and one folder name, and inside a deliberately malformed field, such as letters in a numeric column, so that an error path fires.
- Run the full pipeline twice on that copy: once at the production log level and once at the most verbose level any operator is permitted to use.
- Collect every sink: application logs, tool stdout and stderr, job runner and CI logs, error trackers, notebook outputs, crash dumps and temporary folders.
- Search each sink for every canary in exact, lowercase and partial forms, and for its hash if the pipeline hashes values anywhere.
- Pass only at zero hits outside the key store. Any hit gets a code or configuration fix, a new run and a new sweep; deleting the sink alone does not count as a fix.
- Record the sweep as an audit entry: canary set ID, pipeline and configuration hash, sinks searched, hits found and the reviewer, with no canary values written into the entry.
Is a log with no names safe? The objection worth taking seriously
No: a log with no names can still be personal data, and a log stripped of everything proves nothing. Both halves of the objection are partly right, and the answer to each is placement rather than deletion.
A minimized log still links: a row number, a timestamp and the fact that a medical-term rule fired on that row tell anyone who also holds the key store or the source extract something about a person. Under the ICO's guidance, that log remains personal data for whoever holds the additional information, so it keeps the access controls of the data it describes. HHS's January 2017 cybersecurity newsletter on audit controls, written for HIPAA covered entities and business associates, makes the operational point: access to audit trails should be strictly restricted and provided only to authorized personnel.
The opposite objection says auditors need record-level evidence, and for a correction or deletion request they sometimes do. That detail belongs in the key store, reachable through the batch ID and row number the log carries, under the separation the EDPB guidelines describe and the key custody decision. The log proves that a step happened; the key store, opened only on approval, proves to whom.
Release checklist for the processing log that ships with a dataset
Release a dataset only when its processing log passes every item below. Each item is checkable by someone who did not build the pipeline, which is the point of an audit record.
Checklist · 8 items
- Every field in the log appears in the routing table with a decision, and nothing on the never list is present.
- The canary sweep passed at both log levels on the final pipeline configuration, and its audit entry exists.
- File names in the delivered package and in the log are batch-local sequence numbers, not source names.
- Exception handlers log class names and coded reasons; a search of the pipeline code for interpolated exception text came back empty, or each hit was fixed.
- Third-party tools run with summary and verbose output switched off, unless that output goes only to the key store.
- The key store holding pairs, paths and record keys sits in a separate location with separate administrators from the log.
- Log access is limited to named roles, and the log's retention is set on its own rather than inherited from general application logs.
- The log can still answer the audit questions: which rule versions ran, on which batches, by whom, with what counts and with which output hashes.
0 of 8 ticked. Tick each item as you go.
Decision, limits and the next evidence to collect
Decision: release a processing log only when it passes the routing table and a canary sweep, and send everything that links an output to a person to a separate key store or out of the record altogether. That keeps the evidence of processing while removing the second dataset.
The measurement has limits. It covers three tools, two built for medical images and one for text, read at one commit each without running them, so a label means a message can carry such a value when that code path fires. Raised exception messages and dependency code were not traced, apart from how pydicom prints an element. Business-record pipelines use other tools, so the counts show a pattern to test for, not a rate for your stack.
This page is general information, not legal advice; which law applies depends on the records, the people they describe and where processing happens, so counsel and a privacy specialist should review the specific pipeline. The next evidence to collect is your own: sweep results across two release cycles, a count of interpolated exception strings in your pipeline code, and a list of which sinks keep data longest.
Where processing evidence sits in a SourceX license
When records are licensed through SourceX, the preparation step is SourceX's: its trust page says that once SourceX gives the go-ahead, the data is "extracted, transferred and de-identified through approved processing routes", and the legal framework page states that the method used is recorded for each dataset. The trust page also lists a full audit trail in which every status change is recorded with who made it and when. Records of that kind prove processing without the record values.
What stays with a supplier is the export work done before anything is handed over, and those logs live in the supplier's own systems. Hold them to the same routing table: counts, versions, batch IDs and hashes in the log, with file paths and record keys in a separate store. The first step with SourceX is a short company assessment with no data upload; it shows whether the company fits, and it is not an offer.
Methods note: how the 143 log calls were counted and labeled
Repositories: pydicom/deid at df5450f1 (latest commit 2026-10-24), blairconrad/dicognito at f0ffc4ca (2026-10-12) and DataFog/datafog-python at cf81370d (2026-10-05), shallow-cloned from their default branches on 2026-10-28. They are the three of six candidate Python de-identification tools we cloned whose latest default-branch commit, by committer date, falls in 2026; LeapBeyond/scrubadub, BCHSI/philter-ucsf and nedap/deidentify last changed in 2023 and were not counted. pydicom/pydicom at 6f92f30c was read only for how a data element prints. No tool was run.
Unit: one call in package source to print, warnings.warn, or a debug, info, warning, warn, error, exception, critical, log, exit, exis, custom, flag or verbose method (verbose1 to verbose3 included) on an object named logger, logging, log, bot, LOGGER, _logger or LOG, including self.logger, found with Python's ast parser after stripping any byte-order mark. Files under folders named tests, test, docs, doc, examples, example, tools, scripts, script, benchmarks, benchmark, notebooks, notebook, build or generate_dataset, and files named test_*.py, *_test.py, setup.py, conftest.py or run_tests.py, were excluded. A call carries a runtime value when any positional argument, or any keyword argument other than file, end, sep, flush, exc_info and stacklevel, is not a plain string or number literal; for warnings.warn only the message argument is read.
Labels come from reading each call and the code that sets its variables, taking the first that applies in this order: record value (a value read from an input record before replacement, so dicognito's burned-in annotation warning counts here because it prints the record's BurnedInAnnotation flag beside the file name), replacement value (written in place of an original, or kept from it), input location (path, file or folder name, or URL of an input), exception text (the string of a caught exception), and other (configuration, recipe lines, counts, types, tag numbers, model names, versions, and output locations the operator chooses). A message counts as surviving a quieter log level when it is a warning or higher, a warnings.warn call, deid's exit, exis or flag, or a print. Percentages use exact counts, rounded once to one decimal; the per-call labels and scripts are kept for recount.
Frequently asked questions
Should a de-identification log record the original values it replaced?
No. A log that pairs originals with replacements is the additional information that keeps pseudonymised data personal under ICO and EDPB guidance, so it needs the protection of the dataset itself. Log the rule ID, the entity type and the count, and keep any pairs you are approved to retain in a separate key store.
Is a hashed identifier safe to keep in a processing log?
Not as a neutral key. A hash is derived from the identifier, and HIPAA's re-identification provision allows only codes that are not derived from information about the individual. Use a random token issued by the key store, and keep any keyed hash inside that store.
Can debug logging stay on during a de-identification run?
Only when the run passes a canary sweep at that level. In the three tools counted here, 30 of 38 messages that can carry record-linked content are warnings, errors, exits or prints, so quieting the log helps less than fixing what the messages contain.
Who should be able to read the processing log?
Named roles that answer audits and incidents, not everyone with access to application logs. HHS guidance for HIPAA entities says access to audit trails should be strictly restricted, and a minimized log can still be personal data for anyone who also holds the key store.
What makes a processing log good enough for a licensee's diligence?
It answers four questions without revealing a person: which rule versions ran, on which batches, by whom, and with what counts and output hashes. A recorded canary sweep shows the log was tested rather than assumed clean.
Sources
- The ICO's UK GDPR guidance says pseudonymised data is personal data for anyone holding the additional information, which must be kept separately under appropriate technical and organisational measures. Source
- EDPB Guidelines 01/2025 on pseudonymisation (consultation version, January 2025) describe additional information as including tables matching pseudonyms to replaced attributes and cryptographic keys, and extend separation to retained original data. Source
- The ICO explains the UK GDPR data minimisation principle as three tests: adequate, relevant and limited to what is necessary for the stated purpose. Source
- HHS's HIPAA Security Rule technical safeguards paper quotes the audit controls standard and says the rule does not identify which data audit controls must gather or how often reports are reviewed. Source
- HHS's January 2017 cybersecurity newsletter on audit controls says access to audit trails should be strictly restricted to authorized personnel. Source
- 45 CFR 164.514(c) allows a re-identification code only if it is not derived from or related to information about the individual, and bars disclosing the re-identification mechanism. Source
- NIST SP 800-92 Rev. 1 initial public draft (October 2023) asks whether log sources might intentionally or inadvertently capture sensitive data such as personal information, passwords, private keys and access tokens, and how such disclosures are handled. Source
- NIST SP 800-92 (2006) says logs might intentionally or inadvertently capture sensitive information and that privacy staff should be consulted when logs contain personal identifiers. Source
- pydicom/deid at commit df5450f1: 99 output calls in package source, 78 with a runtime value; the jitter-failure warning in deid/dicom/parser.py line 631 prints the field object including its DICOM element. Source
- blairconrad/dicognito at commit f0ffc4ca: 12 output calls, 11 with a runtime value; its summary prints accession number, patient ID and patient name after anonymization unless run with the quiet flag. Source
- DataFog/datafog-python at commit cf81370d: 75 output calls, 54 with a runtime value; its LiteLLM guardrail logs only exception types because engine exception messages can embed scanned text. Source
- pydicom's DataElement string form includes the element's value representation of its value. Source
- SourceX's trust page: after the go-ahead, data is extracted, transferred and de-identified through approved processing routes; every status change is recorded with who made it and when. Source
- SourceX's legal framework page says the de-identification method used is recorded for each dataset. Source
See if your company qualifies
A short company assessment. No data uploads are needed.