← All projects
CASE 02

LocalMask — PII and secrets masked before they reach an LLM

Most companies block AI coding assistants because code can’t leave. LocalMask removes the reason for the block.

Public · PyPI · VS Code · JetBrainslocalmaskpro.com ↗GitHub ↗PyPI ↗JetBrains ↗

Walkthrough on a synthetic repo, about 1.5 minutes (Hebrew captions).

The problem

Developers paste code, configs and query results into AI assistants. Those contain customer data, credentials and internal hostnames. Security teams answer by banning the tools, and developers lose a large productivity gain.

What I built

A local-first masking engine: detection runs on the developer’s machine, every finding becomes a stable token kept in an encrypted local vault, and the AI only ever sees tokens. When the answer comes back, the real values are restored locally. The same engine runs as a CLI, an MCP server, a VS Code extension, a JetBrains plugin and Git hooks.

Architecture
Code / textfile, selection, query result
→
Detectregex + entropy → context → DistilBERT
→
Tokenizestable tokens, encrypted local vault
→
Any LLMsees tokens only
→
Rehydratereal values restored locally

Detection is layered so each stage covers the previous one’s blind spot: patterns for known formats, entropy for secrets, context and a small local model for names and free text, then organisation rules.

Outcome
350+ patterns9 language packs, incl. check-digit validated IDs
5 surfacesCLI, MCP server, VS Code, JetBrains, Git hooks / CI
Local-firstreal values never leave the machine
Stack
Pythonregex + entropyDistilBERT (CPU)OllamaMCPSQLiteVS Code extensionJetBrains pluginGitHub ActionsCloudflare