Skip to content

Privacy and preparation

Attachment redaction dataset quality: 7 layers a text rule never reads

By SourceX Editorial · Reviewed by Noah Loul ·

10 sections

Short answer

A redaction rule validated on extracted text has not been validated on attachments. Files hold content in layers a text pass never reads: document properties, comments and notes, revisions and hidden content, embedded files, images, thumbnails and location tags. In 311 parsed documents from Apache Tika's public test corpus, 78 percent carried at least one such layer. Test each layer with planted values and sign off each one before delivery.

Redaction

Attachment redaction dataset

This page covers attachment redaction dataset quality: 7 layers a text rule never reads.Illustrative

Key takeaways

  • A rule that finds every identifier in body text has been tested on one stream; attachments add up to seven more layers it never reads.
  • In Apache Tika's public test documents, 242 of 311 parsed documents (78 percent) carried at least one layer outside the body text, and 121 carried two or more.
  • Embedded files appeared in 66 of 311 documents; each is a full container that needs the whole check again, recursively.
  • A plant-and-recover test, one invented value per layer per file type, turns attachment redaction into a pass or fail record.
  • Excluding attachments loses task evidence and a secure transfer changes nothing inside a file; neither replaces per-layer validation.

Why does a redaction rule that passes on text fail in attachments?

Because the rule only ever sees the text an extractor hands it, and a file keeps content in places extraction skips or returns separately. A pattern that catches every email address in a ticket body has been tested on one stream. An attached Word file adds author fields, comments, tracked deletions, embedded spreadsheets, pictures and a saved thumbnail of its first page, and none of those reaches the rule unless a step extracts it on purpose.

Standards bodies treat redaction of files as a discipline of its own. ISO/IEC 27038, the international specification for digital redaction, covers the characteristics of redaction techniques for digital documents, requirements for redaction software and methods of testing that redaction was securely completed; it excludes databases. NIST's report on de-identifying personal information (NISTIR 8053, 2015) notes that a photograph can identify someone through a label visible in the image, through metadata in the file such as a location or an embedded name, and through biometric features. Neither document is law. Read together, they point the same way: the check has to cover the file, not only its words.

This page turns that into decisions a privacy or security reviewer can sign for attachment redaction and dataset quality: for each layer that occurs in the files in scope, which test shows the rule worked, what record proves it, and what removing the layer costs the buyer's task. Ranking attachment types by risk and keeping one identity consistent across systems are covered on existing pages linked below.

Seven layers outside the body text

A layer is defined here by where content sits, not by what it contains, so the same seven apply to any file type. Each is a place a body-text pass never looks:

At a glance

Seven layers outside the body text

  • Person-name properties: author, last-modified-by and manager fields in Office document properties, the Author entry or XMP creator in a PDF, and the Artist or XPAuthor tag in a photo.
  • Comments, notes and annotations: Word and Excel comments, PowerPoint comments and speaker notes, PDF markup such as notes, highlights and drawn boxes, and comment or description fields in images.
  • Revisions and hidden content: tracked insertions and deletions, hidden text, hidden sheets and slides, PDF optional content, and incremental updates that keep an earlier version inside the file.
  • Embedded files and objects: a workbook inside a slide deck, a PDF inside a Word file, a message attached to a message, a file attached to a PDF.
  • Embedded images: pictures inside documents, image objects in PDFs and image parts of an email, all of them pixels rather than characters.
  • Thumbnails and previews: small copies of a first page or a photo saved when the file was written, which a later edit or a redaction tool may leave untouched.
  • Location tags: GPS fields in photo metadata.

How often do files carry those layers? A census of 347 public test files

Most of the seven are common, even in files nobody created to test privacy. We counted them in Apache Tika's public test documents, the corpus the Apache project keeps to exercise its text-extraction library, at commit edbfbf3 of 27 October 2026. The 371 in-scope paths hold 347 distinct files by content hash, and our read-only script parsed 335. Of the 311 parsed documents (Office, legacy Office and Outlook, PDF and email), 242 or 78 percent carried at least one of the seven layers, and 121 or 39 percent carried two or more.

Person-name properties were the most frequent layer, populated in 208 of the 281 documents where the script could read them, or 74 percent. Embedded files or objects appeared in 66 of 311 documents (21 percent), and every one of those is a second container that needs the whole check again. Twelve of the 60 PDFs had been saved with at least one incremental update. Among 24 parsed images, 8 had a populated comment or description field and 4 carried GPS tags.

These are test fixtures, picked by developers to exercise unusual features, so the rates overstate what a typical business archive holds and are not a prevalence estimate. What the census does show is that every layer in the matrix turns up in files that ordinary software wrote, and that most documents carry more than the text a redaction rule reads. The script kept only true or false flags per file; no field value was printed or saved.

How often do files carry those layers? A census of 347 public test files
File family (distinct; parsed)At least one layerTwo or more layersMost frequent layersEmbedded files or objects
Office: docx, xlsx, pptx and variants (141; 133)113 (85%)66 (50%)Person-name properties 106 of 133; thumbnails 39 of 13325 of 133 (19%)
Legacy Office and Outlook: doc, xls, ppt, msg (112; 109)89 (82%)37 (34%)Person-name properties 84 of 95; thumbnails 23 of 9528 of 109 (26%)
PDF (60; 60)35 (58%)16 (27%)Person-name properties 18 of 53; images 14 of 60; incremental updates 12 of 608 of 60 (13%)
Email: eml (9; 9)5 (56%)2 (22%)Attachments 5 of 9; image parts 2 of 95 of 9 (56%)
Images: jpg, png, tif (25; 24)9 (38%)4 (17%)Comment or description fields 8 of 24; GPS tags 4 of 24Not applicable
All documents, images excluded (322; 311)242 (78%)121 (39%)Person-name properties 208 of 281; thumbnails 65 of 28866 of 311 (21%)
A file drawn as a stack of layers: body text on top as the only layer the rule reads, then six bars giving the share of measured test documents with each other layer (person-name properties 74%, thumbnails 23%, embedded files 21%, embedded images 21%, revisions or hidden content 10%, comments or notes 8%), beside a panel stating 78% of 311 parsed documents.
Layers outside the body text in Apache Tika's public test documents at commit edbfbf3; each share uses that layer's measured denominator. Test fixtures, not a prevalence estimate.

The privacy-utility review matrix, one row per layer

Each layer needs its own test, its own record and an explicit view of what removing it costs the task the data is licensed for. The matrix is written for the reviewer who signs off a delivery. The utility column gives typical cases and should be replaced with the actual task's needs before sign-off.

The privacy-utility review matrix, one row per layer
LayerWhy a text rule misses itTest that settles itRecord to keepUtility cost if removed
Person-name propertiesStored in a separate properties part, not in the bodyCanary value in each property field; re-read properties after processingFields cleared or replaced, by file typeLow; keep a role label if authorship matters
Comments, notes and annotationsKept in separate parts or annotation objectsCanary comment, speaker note and PDF note over textComments removed or kept, counted per fileMedium; comments can hold the decision rationale
Revisions and hidden contentDeleted, hidden or superseded text is absent from the visible textCanary in a tracked deletion, a hidden sheet and an earlier PDF revisionHistory accepted or file rewritten; update chain removedLow to medium; history can show how a decision changed
Embedded files and objectsA second container with its own layersCanary inside a file embedded two levels deep; recurse to the last containerDeepest level reached; each inner file handled by typeHigh; the inner file can hold the answer
Embedded imagesPixels, not charactersCanary rendered as an image; OCR every output image and pagePixels redacted, image replaced or excludedHigh for screenshots and scans; low for logos
Thumbnails and previewsSaved at write time; a redaction tool may leave it untouchedCanary on the first page; read the thumbnail after processingThumbnail stripped or regeneratedNone
Location tagsNumeric metadata fields, not textCanary coordinates in a test photoGPS fields removed or coarsenedLow unless location is part of the task

The plant-and-recover test: proving each layer came out clean

The test that settles whether a rule works in attachments is to plant known, invented values in each layer and see which ones come out the other end. It replaces argument about tool settings with a record of which layer, which file type and which pipeline step let something through.

Use values that cannot be confused with real data: a made-up name with a test prefix, an email address at a reserved example domain, a coordinate pair in open water. Never seed a real customer's details. Put one canary in one layer of one file, so that a survivor points to exactly one gap.

Run the steps in this order for every file type in the delivery scope:

  • Build a canary pack: for each file type, copies with one invented value placed in exactly one layer, including a value drawn as an image, a value in a file embedded two levels deep and a value in an earlier PDF revision.
  • Run the pack through the same pipeline, tools, versions and settings used for the real records, format conversion and packaging included.
  • Re-open every output with a different tool from the one that redacted it, and extract each layer on its own: properties, comments and notes, revisions, every embedded file recursively, OCR of each image and rendered page, and thumbnails.
  • Search each extracted layer for every canary and record survivors by layer, file type and pipeline step; a layer passes only with zero survivors.
  • Check utility in the same run: the chart is still legible, the embedded workbook still opens, and the comment thread that carried a decision is still present if it is in scope.
  • Repeat after any change to the pipeline, the tools or the file types in scope, and once more on the packaged delivery itself.

Nested files and PDF revisions: where one pass is never enough

Two layers defeat single-pass processing by construction. An embedded file is a complete container with its own seven layers, so a rule applied to the outer document's text never reaches the inner document's properties or pictures. In the census, files inside files appeared in Word, PowerPoint, Excel, legacy Office, Outlook, PDF and email fixtures alike. The working rule is to recurse until no container remains and to record the deepest level reached, so a reviewer can see that the bottom was found rather than assumed.

PDFs add history. An incremental update appends changes to the end of a PDF rather than rewriting it, so objects from the earlier version can remain in the file even when a viewer shows only the latest page. The census script counted end-of-file markers and found more than linearization explains in 12 of 60 PDFs. A black box drawn over text is a further trap: it is an annotation lying on top of the page, and the text beneath stays in the file unless the page content itself is rewritten.

Images need two checks rather than one: OCR for text a person can read in the pixels, and a metadata read for fields nobody sees on screen. NISTIR 8053's three photo risks map onto those two checks plus a visual review for faces and other biometric features, which neither OCR nor a metadata reader will catch.

Would excluding attachments or securing the transfer settle it?

Neither settles it, and each has a cost. Dropping every attachment removes the layers along with content a buyer's task may depend on: the screenshot that shows the error, the signed quote, the spreadsheet behind a decision. A secure transfer protects files in transit and changes nothing inside them, so a populated author field arrives intact over an encrypted channel.

Regulators also count what is kept behind. In the EU, the EDPB's Guidelines 01/2025 on pseudonymisation, adopted for public consultation in January 2025, say that pseudonymised data which can still be attributed to a person remains personal data, and that original data a controller keeps alongside it forms part of the additional information that must be kept separately. For attachment work, that puts the unredacted originals and any table of replaced values under separate controls from the prepared files.

In the UK, the ICO's anonymisation guidance asks organisations to assess identifiability with the motivated intruder test, which considers the practical steps and means a determined person could reasonably use to identify someone. A clean body text sitting next to a populated author field or a GPS tag hands that person a first step. This is general information about the guidance in each jurisdiction, not legal advice.

Final-delivery checklist for an attachment set

Before an attachment set is released, give each item a named reviewer and a dated record:

Checklist · 8 items

  1. Every file type in scope has a passing plant-and-recover run for every layer that applies to it, on the current pipeline version.
  2. Embedded files were opened recursively until no container remained, and the deepest level reached is recorded.
  3. No output file keeps an earlier revision: tracked changes accepted or removed, PDF update chains rewritten, version history dropped.
  4. Thumbnails and previews were stripped or regenerated after redaction, not before.
  5. Images kept in scope were redacted in the pixels, and a person reviewed a stated number of them.
  6. Person-name properties and location tags are empty or replaced in every kept file.
  7. Unredacted originals and any replacement tables sit apart from the delivery, under their own access rules.
  8. The delivery note lists, layer by layer, what was removed, what was kept and the reason for each.

0 of 8 ticked. Tick each item as you go.

Decision rule, census counting rules and limits

Decision rule: an attachment set is ready only when every layer that occurs in its file types has a passing plant-and-recover run on the current pipeline, the utility check has passed, and the delivery note records each layer's outcome. A layer that cannot be tested for a file type means that file type is excluded or reviewed by a person file by file.

Census scope: every file under a folder named test-documents in github.com/apache/tika at commit edbfbf34b0e74a0f35313533f6503b12d3383970 whose extension, ignoring case, is docx, docm, dotx, dotm, xlsx, xlsm, xltx, xltm, pptx, pptm, ppsx, ppsm, potx, potm, doc, xls, ppt, msg, pdf, eml, jpg, jpeg, png, tif or tiff. Duplicates were removed by SHA-256, keeping the first path in sorted order. A layer counts only where the script parses it. Person-name properties are non-empty creator, lastModifiedBy or Manager fields in Office files; non-empty Author or LastAuthor strings in a legacy SummaryInformation stream; a non-empty literal or hex Author string, or XMP creator or Author element text, in a PDF, with encrypted PDFs not measured; and EXIF Artist or XPAuthor, a PNG Author text chunk or XMP creator text in images. Stream names in legacy Office and Outlook compound files are matched without regard to case, as the compound file format specifies.

Comments are Office comment parts holding a comment element, threaded comments, PowerPoint comment parts, notes slides with text, the PDF markup annotation subtypes Text, FreeText, Line, Square, Circle, Polygon, PolyLine, Highlight, Underline, Squiggly, StrikeOut, Stamp, Caret, Ink, Sound and Redact, and non-empty JPEG COM, EXIF ImageDescription or UserComment, PNG Comment, Description or Title text, or XMP description. Revisions are w:ins, w:del or w:vanish in a Word body, a hidden or very hidden sheet, a slide whose show attribute is off, PDF optional content, or more than one end-of-file marker in a PDF (more than two when /Linearized appears in its first 2,048 bytes). Embedded files are Office embeddings parts, a Word ObjectPool storage with children, Excel entries whose names start with MBD, PowerPoint ExOleObjStg records, Outlook attachment storages, PDF embedded-file entries or file-attachment annotations, and email parts that are attachments, carry a filename or are attached messages. Images are Office media parts in raster formats, a non-empty PowerPoint Pictures stream, PDF image objects and email image parts. Thumbnails are Office thumbnail parts, a SummaryInformation thumbnail, PDF Thumb entries and JPEG thumbnail images in EXIF. GPS counts any GPS tag other than the version tag.

Not measured: comments and revisions in legacy doc, xls and ppt files; images in doc, xls and msg files; thumbnails in TIFF and PNG; PDF streams other than object streams and metadata streams, which were not decompressed, so text in page content streams was not read; and RTF, OpenDocument and archive formats. Unmeasured cells are left out of that layer's denominator, which is why denominators differ by layer. Eleven documents and one image did not parse (encrypted packages, a truncated file, and formats the script does not read, such as BigTIFF and .doc or .xls files that are not compound files) and are excluded. Percentages are rounded half up from integer counts. The script, bin/xs0854_layer_census_v2.py, and its per-file output sit in scratch folder W10-main-003; it reads the files as bytes and runs no code from the repository. The next evidence worth having is the same flag counts on a sample of your own archive.

Where layer testing meets a SourceX deal

In a SourceX deal the supplier sets the boundary, and SourceX describes its own processing in general terms, so layer testing is most useful before scope is fixed. The trust page says "The supplier decides which systems, records and date ranges are in scope," and the process page says that after SourceX gives the go-ahead, the data is "extracted, transferred and de-identified through approved processing routes."

Two more statements set expectations. The legal framework page says of de-identification, "The method used is recorded for each dataset." The trust page adds that "No method is perfect: the supplier agreement records that re-identification may still be possible and that SourceX is not liable for it." Neither page describes attachment-level tests, so a supplier that wants attachments in scope should be ready to say which layers its files carry and which file types it would rather leave out.

A practical first step is a census of your own archive like the one above, kept to counts and flags. The company assessment needs no data upload, and an assessment is neither an offer nor a promise of payment.

Frequently asked questions

Does stripping metadata fix attachment redaction?

No. Metadata is one of seven layers; comments, tracked or hidden revisions, embedded files, images and thumbnails each hold content a metadata cleaner may not touch. In the census above, embedded files alone appeared in about one document in five.

How can you test whether redaction worked inside a PDF?

Plant invented values in the visible text, an annotation, an embedded file and an earlier revision of a test PDF, run it through your pipeline, then re-open the output with a different tool and search every layer, including OCR of each rendered page. Any surviving value marks a failed layer.

Should a licensed dataset simply exclude all attachments?

Only when the attachments add nothing the task needs. Screenshots, signed quotes and attached spreadsheets often carry the evidence a record is valued for, so a per-layer test usually keeps more utility than a blanket exclusion, at the cost of more review.

What is a canary test for redaction?

A canary test places a known, invented value where a real identifier could sit, runs the redaction process, and checks whether the value survives. One canary per layer per file type turns a general assurance into a pass or fail record for each place content can hide.

Is removing names from attachments enough to make them anonymous?

Not necessarily. In the UK the ICO asks whether a motivated intruder could reasonably identify someone, and in the EU the EDPB treats pseudonymised data that can still be attributed to a person as personal data. A location tag, a thumbnail or a reviewer comment can keep identification possible after the names are gone.

Sources

  • Apache Tika's public test documents at commit edbfbf34 (27 October 2026): 371 in-scope Office, legacy Office, Outlook, PDF, email and image files, counted for this article by a read-only script. Source
  • ISO/IEC 27038:2014 specifies characteristics of techniques for digital redaction of digital documents, requirements for redaction software and methods of testing that digital redaction has been securely completed; it does not cover databases. Source
  • NISTIR 8053 (2015) notes that photographs can identify a person through a visible label, through metadata in the file format such as a location or an embedded name, and through biometric features. Source
  • ICO guidance (UK GDPR): organisations should assess identifiability with the motivated intruder test, considering the practical steps and means a determined person could reasonably use to identify individuals. Source
  • EDPB Guidelines 01/2025 on pseudonymisation (adopted for public consultation, January 2025): pseudonymised data that can be attributed to a person remains personal data, and original data kept by the controller is part of the additional information that must be kept separately. Source
  • SourceX's trust page: the supplier decides which systems, records and date ranges are in scope; after the go-ahead the data is extracted, transferred and de-identified through approved processing routes; no method is perfect and the supplier agreement records that re-identification may still be possible. Source
  • SourceX's legal framework page: SourceX de-identifies the data through approved processing routes before it is used or shared, and the method used is recorded for each dataset. Source
  • SourceX's how-it-works page: once SourceX gives the go-ahead, the data is extracted, transferred and de-identified through approved processing routes. Source

See if your company qualifies

A short company assessment. No data uploads are needed.

See if your company qualifies