Featured Privacy Research AI Workflows

Why I Built a Local-First Data Anonymizer for AI Workflows

On the quiet privacy risks of uploading research data to AI tools β€” and a practical solution that keeps your data entirely on your device.

May 2026 Β· 8 min read Β· 100% LOCAL β€” NO DATA SENT

There is a moment that most researchers working with AI tools have probably experienced: you have a dataset open, you want a quick analysis or a code snippet that handles your specific column structure, and the fastest path forward is to paste the data directly into the chat.

It works. It's useful. And it carries a risk that is easy to overlook.


The Problem With Uploading Real Data to AI Systems

When you upload a file or paste data into an AI tool, that data enters a system you do not control. Depending on the platform, the service's data handling policies, and your account type, your data may be:

For many use cases, this is an acceptable trade-off. For researchers working with unpublished experimental results, proprietary datasets, patient-adjacent data, sample identifiers tied to ongoing studies, or commercially sensitive measurements β€” it is not.

The risk is not hypothetical or paranoid. It is simply a consequence of how most cloud AI systems are architected: your data goes to a server, and what happens after that is governed by a terms-of-service document that most people do not read carefully.

What Researchers Actually Need

The most common use of AI tools in research workflows is not to share the data β€” it's to get help working with the data. You want to:

None of these tasks actually require the AI to see your real values. A dataset with fake sample IDs, anonymized group labels, and plausible-but-synthetic numeric measurements is almost always sufficient. The AI doesn't know or care whether SAMPLE_001 used to be ACC_2024_Cohort_B_strain_47.

The problem is that anonymizing data properly, consistently, and quickly has always required extra tooling β€” or trusting cloud services with the original data to do it. Neither option felt right.


Building DataMask

DataMask started as a straightforward idea: a single HTML file that anonymizes data entirely in the browser, with no backend, no upload, and no retained state.

The key design constraint was that the tool had to be useful before you trust any external service. That meant everything β€” column detection, numeric transformations, cryptographic hashing, text label substitution β€” had to run inside the browser's JavaScript engine. The data never touches a server.

Three anonymization tiers cover different threat models:

ModeMethodReversibility
Lite Noise, shuffle, replace, or scale & shift Reversible with effort
Strong Normalize β†’ sigmoid distortion β†’ cross-column mixing Hard to reverse Β· preserves rank
Vault SHA-256 per-cell seed β†’ PRNG synthetic values Cryptographically irreversible

Text columns β€” sample names, strain identifiers, experimental group labels, metadata β€” are handled separately. DataMask replaces each unique text value with a consistent label (SAMPLE_001, SAMPLE_002, …) in order of first appearance. The same original value always maps to the same label, so relational structure is preserved without leaking anything real. And the mapping is exportable, so nothing is lost.

Why Client-Side Matters

Running entirely in the browser is not just a technical choice β€” it's an architectural statement about where trust should live.

When a tool processes your data locally, you can verify exactly what it does. The source code is in the page. There is no API call to audit, no server log to request, no data retention policy to read carefully. The data is processed and stays on your machine.

Note

A cloud anonymization service that handles your data in order to anonymize it is, by definition, a service that has seen your original data. The privacy guarantee depends entirely on how much you trust that service's infrastructure, employees, and policies. A local tool removes that dependency entirely.

The Practical Upside

In practice, this approach works well for the most common AI-assisted research workflows:

Getting analysis code written. Paste an anonymized version of your dataset into the chat. The AI can see your column structure, data types, and approximate value ranges. It can generate working code. You then run that code on your real data, locally, without it ever going anywhere.

Debugging data processing scripts. Share a synthetic version of your problematic dataset. The AI can help you trace the issue without seeing proprietary identifiers or real measurement values.

Exploring statistical approaches. Anonymized data with preserved distributional shape (DataMask's Vault mode, with shape-preservation enabled) gives the AI enough information to give meaningful statistical guidance without exposing your actual results.

Sharing with collaborators. Anonymized data can be shared with external collaborators, submitted to early review processes, or attached to working drafts without concern about premature disclosure.


What DataMask Is Not

DataMask is not a formal data de-identification tool compliant with HIPAA, GDPR, or other regulatory frameworks. It does not perform entity recognition on free text, does not scrub metadata from file formats, and does not provide certified anonymization guarantees.

It is a practical utility for researchers who want a fast, local, trustworthy way to prepare datasets for use in AI-assisted workflows β€” and who understand that the goal is to share the structure of the data, not the data itself.

If you are working with data that requires regulatory-grade anonymization, you should use tools built and certified for that purpose.

DataMask is open source under the MIT license. The full source is a single readable HTML file.

The Tool

Try DataMask

A single HTML file. No installation, no account, no data sent anywhere. Open it in your browser and start anonymizing.

πŸ“‚

Upload any format

.xlsx, .xls, .csv, .txt β€” or paste directly from clipboard

πŸ”΅

Three protection tiers

Lite, Strong, or Vault β€” from fast obfuscation to cryptographic irreversibility

🏷️

Text label substitution

Sample IDs, strain names, group labels β†’ SAMPLE_001, SAMPLE_002, …

πŸ“‹

Five export formats

Download as XLSX, CSV, TSV, TXT, or JSON β€” with a custom filename

100% local β€” all processing happens in your browser. Nothing is transmitted.
Workflow

How to Use DataMask

Four steps. No installation. Your data never leaves the browser.

01

Upload Your Data

Drag and drop a file onto the upload zone, click to browse, or paste CSV/TSV directly from the clipboard. Supports .xlsx, .xls, .csv, and .txt formats. Multi-sheet Excel files let you select the active sheet.

02

Select Columns

Column types are auto-detected β€” numeric or text. Check the columns you want to anonymize. You can select any mix of numeric and text columns. A preview of your data is shown before you commit.

03

Choose Protection Mode

Pick the tier that matches your threat model. Lite is fast and reversible. Strong uses sigmoid distortion and is hard to reverse without a reference β€” but because the transform is monotonic it preserves rank order, so it stays re-identifiable by rank. Vault uses SHA-256 and is cryptographically irreversible. Vault mode requires HTTPS or localhost.

04

Download

Export the anonymized data as .xlsx, .csv, .tsv, .txt, or .json. A filename prompt appears before every download. Optionally export the original→label mapping as CSV or JSON for full traceability.

Good to know
  • Text columns (sample names, strain IDs, group labels) are replaced with consistent SAMPLE_001, SAMPLE_002, … tokens β€” the same original value always maps to the same label across all rows.
  • Use the Re-anonymize button on the results screen to apply additional rounds of obfuscation for extra protection.
  • Copy the anonymized output directly to clipboard as CSV β€” no download required when pasting into a chat.
  • No data is stored between sessions. Closing or refreshing the tab wipes everything.
Get in Touch

Issues & Improvements

Found a bug? Have a feature idea? Want to share how you're using DataMask? I'd genuinely like to hear from you.

πŸ›

Report a bug

Something isn't working as expected? Open a GitHub issue with the details.

πŸ’‘

Request a feature

Have an idea for a new anonymization mode, export format, or workflow improvement?

Send a message

Prefer not to use GitHub? Send a message directly β€” it'll open in your email client.

β„Ή  This opens your default email client with the message pre-filled. No data is sent through this page.