The Region selector (top toolbar) swaps which country/region regex ruleset is layered on top of the always-on Global baseline (email, IP addresses, credit card numbers, generic dates). Only one region is active at a time to avoid cross-country format collisions (e.g. a bare 9-digit number shouldn't simultaneously be treated as a US SSN and something else). The Persona selector swaps the Hard Block keyword set between Personal privacy terms and Business confidentiality terms.
Nothing here is saved. TokenShield destroys all state on reload by design, so your Region/Persona choice resets every time you open the file. If you always work in one region or persona, open TokenShield.html in a text editor, search for DEFAULT_REGION and DEFAULT_PERSONA near the top of the <script> block, and change the value — that becomes your new startup default.
Batch-import your own keywords, names, or project codenames. Download the template and fill it out using the "Keyword,Category" format. Category is optional — it defaults to CUSTOM if left blank. The system generates matching tags automatically (e.g. NAME_1, CUSTOM_1).
Note: keyword values cannot contain commas — this will break CSV parsing. If a term itself contains a comma, use "Build Dictionary Online" instead.
Ready-to-copy system prompts for local models (Ollama, LM Studio, etc.). Paste one of these ahead of your masked text so the model's own instructions also stay privacy-aware — reinforcing that nothing, including your prompt phrasing, needs to leave this machine.
For personal documents — reminds the model that names/contacts are tokenized and must stay untouched.
For business documents — frames the content as confidential/trade-secret material.
ollama run qwen2.5:3b
OLLAMA_ORIGINS set to * so Ollama allows this local TokenShield page to connect.* allows any web page to call your local model. This only affects your own user account and doesn't require administrator rights, but it does carry some risk of abuse by other malicious pages.Setup steps (one-time; persists across reboots after that)
Quit Ollama first
Find the Ollama icon in your system tray (bottom-right, near the clock), right-click it, and choose "Quit Ollama" to fully close it.
Open your OS's "Environment Variables" dialog
Windows: click Start, search "Edit environment variables for your account", and open it. Or press Win + R, type sysdm.cpl, press Enter, then "Advanced" → "Environment Variables".
macOS/Linux: set OLLAMA_ORIGINS=* in your shell profile (e.g. ~/.zshrc) or launch Ollama with the variable set for the session.
Add a new entry under "User variables"
Click "New..." under the upper half (your personal account variables) and enter:
OLLAMA_ORIGINS
*
Click OK, then OK again to close the dialog.
Restart Ollama
Reopen the Ollama app from the Start menu, wait for the tray icon to appear, then come back here and click "Test Connection" to confirm.
How do I undo this later?
Repeat step 2, find the OLLAMA_ORIGINS entry under "User variables", select it, click "Delete", and restart Ollama.
How do I stop Ollama from auto-starting?
On Windows: open Task Manager (right-click the taskbar) → "Startup apps" tab → find Ollama → set to "Disabled" so it won't launch in the background at boot.
Connection & Model Settings
※ Make sure you've pulled this model via Ollama. Developers can edit these default options directly in the source (TokenShield.html).
TokenShield ships with a set of regex rules to detect sensitive personal and business data. The table below shows the rules currently active for your selected Region (plus the always-on Global baseline) — switch Region in the top toolbar to see a different set.
Not sure this file is actually safe? Ask an AI.
TokenShield is a single HTML file — no server, no background network calls. You don't need to read code yourself: paste the entire TokenShield.html source into any AI (ChatGPT, Claude, etc.) and ask it directly: "Does this page send any user input anywhere?" Let the AI verify it for you, instead of just taking the developer's word for it.
How do I add my own PII rules and Hard Block keywords?
You don't need to hand-edit the HTML source — use the "Manage Custom Protection Rules" button in the toolbar instead:
tokenshield.config.js next to TokenShield.html — this only takes effect when the page is opened as a local file.| Data Category | Replacement Tag | Example | Regular Expression |
|---|
If the source text contains any of the following terms (from the currently selected Persona), TokenShield locks the copy function to prevent accidental exposure:
TokenShield detected text that may contain extremely sensitive information. To protect the people involved, copy/export has been temporarily locked.
If you've confirmed this information is safe to release, or believe this is a false positive, you can force-unlock it.
Type directly into the table below, or copy two columns from Excel and paste into any cell — the table expands automatically.
Empty rows are ignored when you apply.
| # | Keyword (required) | Category (optional, e.g. NAME) | Delete |
|---|
Single-column CSV, one keyword per row. This only manages your custom layer — the built-in Personal/Business keyword lists aren't editable here (see PII Rule Guide).
| Keyword | Delete |
|---|
This feature only takes effect when you download this page as a local HTML file and open it directly. You're currently browsing it via a URL — "Export as Auto-load File" still downloads the config file, but it will only auto-apply once you also download this page and keep the config file next to it.