File Scrubbing: The Art of Digital Redaction for Secure Document Handling
File scrubbing removes PII, PHI, card data, secrets, and hidden metadata from files. Learn how to scrub files by hand, by API, and automatically across apps.

File scrubbing is the permanent removal of sensitive content from a file before it is shared, stored long term, or processed by another system. The scrubbed value is deleted and replaced with a mark, a label like [REDACTED], or a masked value like XXXX-4242. Anyone who opens the scrubbed copy sees the replacement, and there is nothing underneath it.
People use a few names for the same job. Data redaction usually means removing values from documents. Data masking usually means swapping real values for realistic fake ones so the data stays usable. Data sanitization often means wiping a whole drive. File scrubbing sits in the middle: you keep the file and its useful content, and you take out the parts that should never have been there.
What gets scrubbed depends on your policy, but it usually includes:

Most leaks from "clean" files come from the parts nobody looked at. A single file can hold sensitive data in four layers:
A spreadsheet with the SSN column hidden still holds every SSN. A Word file with tracked changes turned off still holds the deleted paragraph. Scrubbing has to clear all four layers, or it hasn't scrubbed anything.
Three things changed how much data sits inside files and who reads it.
Files multiply. One customer upload to a support ticket becomes a download on an agent's laptop, a forward in email, a share in Slack, and a copy in a cloud folder. Every copy needs scrubbing, not just the first one.
AI reads everything. Employees upload files to ChatGPT, Claude, and Gemini to summarize them. AI agents connected over MCP open files on their own, from Google Drive, SharePoint, and ticketing tools. Whatever the model reads goes to the provider. This is the core of shadow AI risk and the reason AI data governance now includes files, not just prompts.
Regulators expect less data, not just locked data. GDPR, HIPAA, and PCI DSS all push data minimization: if a file doesn't need a value to do its job, the value shouldn't be in it. A scrubbed file is out of scope. An encrypted one is still in scope.
For a single file that needs a person to judge every line, such as a legal disclosure or a records request, manual scrubbing still makes sense. Follow these steps:
This works for a handful of files a week. It breaks for an inbox, a ticket queue, or a shared drive with ten years of exports, because nobody opens every file.
The Strac Redaction API scrubs files in code, so you can build scrubbing into an upload form, a document pipeline, or your own app. It takes three calls: upload the file, redact it, and download the scrubbed copy.
curl -X POST 'https://api.test.tokenidvault.com/documents' \
-H 'X-API-Key: <api_key>' \
-F 'file=@bank-statement.pdf'
curl -X POST 'https://api.test.tokenidvault.com/redact' \
-H 'X-API-Key: <api_key>' \
-H 'Content-Type: application/json' \
-d '{"document_id": "<document_id>"}'
curl -X GET 'https://api.test.tokenidvault.com/redacted-documents/<document_id>' \
-H 'X-API-Key: <api_key>' > scrubbed-bank-statement.pdf
What the API handles in 2026:
[REDACTED], mask it, remove it entirely, or swap it for a link to the original in the Strac document vault so an authorized person can still get it back.For keeping originals usable in other systems, see tokenization vs encryption. Full request and response details are in the Strac API docs.
AI agents now open files without asking a person first: a W-2 in a shared folder, an invoice attached to a ticket, a spreadsheet pulled through an MCP connector. The file goes into the prompt, and the prompt goes to the model provider.
Strac ships an open source MCP server for this. Add it to Claude Code, Claude Desktop, Cursor, or VS Code, and the agent gets two file tools. detect_file scans a file and reports what sensitive data it holds without changing it. redact_file writes a scrubbed copy next to the original, never edits the source, and refuses to overwrite it.
That tool scrubs when the agent asks. Strac MCP integrations scrub whether the agent asks or not. When an agent pulls a Drive file, a Salesforce record, or a Zendesk attachment through MCP, Strac removes the sensitive data before the agent receives it. Asking an agent to scrub is a request. Scrubbing at the connector is a control. Read more in MCP DLP and AI DLP.

The API is for files you control. Most sensitive files arrive in apps you didn't build. Strac connects to those apps through their APIs, scrubs files as they arrive, and scans the ones already sitting there.

Strac runs the same detectors on the API, the MCP server, and every connected app, so a file is judged by one policy wherever it shows up.
See DLP remediation for how each action works. SaaS integrations connect in under 10 minutes with no agent and no code.

👉 Related reading:
A file holds more than the words on the page. Real file scrubbing removes sensitive data from the content, the images, and the metadata, and in 2026 it has to happen in tickets, inboxes, drives, laptops, and AI tools, not just in an editor. Every other control fails eventually, so the data layer is the backstop: scrub the file the moment it lands, and a leaked copy holds nothing worth stealing.
Book a demo to see Strac scrub files across your stack.
Close, but not identical. Redaction usually means removing visible values from a document. File scrubbing covers that plus the parts you can't see, such as metadata, comments, hidden rows, and text inside images. A file can be redacted on the page and still leak through its metadata.
No. Deleting a file removes one copy. The same file may still sit in email threads, Slack channels, backups, and laptops. Scrubbing removes the sensitive data from the copies that need to stay, and DSPM finds the copies you forgot about.
No. Strac removes only the sensitive values and leaves the rest of the file readable. Agents still see the statement period, the transaction list, and the form answers they need, and support teams can delay scrubbing until a ticket is solved.
Not everything. Handwriting, very low quality scans, and data types you never defined can slip past any tool. That is why legal disclosures still get a human review, and why scrubbing at every entry point matters: what does get caught never spreads.
Strac checks file uploads in the browser and scrubs or blocks sensitive data before the file reaches the AI tool, and does the same for agents through MCP. See AI DLP and shadow AI for the full picture.
.avif)
.avif)
.avif)
.avif)
.avif)

.gif)

