How LocalMask supports GDPR compliance for AI-assisted development
LocalMask is a local-first privacy tool that scans source code repositories for secrets (API keys, passwords, tokens, connection strings) and personally identifiable information (PII — emails, names, IP addresses), then replaces each with an opaque reversible placeholder (~[TOKEN_N]~). The masked code can be safely shared with AI coding tools (Cursor, Copilot, Claude, ChatGPT) or published to external repositories.
| Component | Location | Data flow |
|---|---|---|
| Scan engine | User's machine (Python process) | Reads local files only |
| Token vault | ~/.localmask/vault.sqlite | AES-encrypted (Fernet), per-machine key, never transmitted |
| MCP server | Local stdio process | Communicates with IDE over stdin/stdout — no network port |
| Masked output | Local cache + optional git push | Contains only placeholders, never real values |
LocalMask has zero outbound network connections. The scan engine, vault, and MCP server are entirely local processes. No data — masked or unmasked — is ever sent to LocalMask servers, because there are no LocalMask servers. The tool is a local binary.
| Data category | Examples | Processing |
|---|---|---|
| Email addresses | [email protected] | Detected, replaced with ~[EMAIL_0]~ |
| IP addresses | 192.168.1.100 | Detected, replaced with ~[IP_ADDR_0]~ |
| Names (in code comments) | // Author: John Smith | Detected via language packs, replaced |
| Credentials | API keys, passwords, tokens | Detected, replaced with typed placeholders |
| Financial data (Pro) | Account numbers, amounts | Detected, replaced or bucketed |
All personal data remains on the user's local machine. Only the placeholder tokens (which contain no real values) may be transmitted to AI services or published to git repositories.
LocalMask ensures that only the minimum necessary data reaches external AI services. Real PII is replaced with opaque tokens before any transmission occurs. The AI receives ~[EMAIL_0]~, not [email protected].
Privacy is the default behavior, not an opt-in setting. LocalMask's architecture makes it physically impossible for real values to reach the AI — the masking happens before the data enters the MCP transport layer. There is no configuration that bypasses masking.
~/.localmask/.vault_key (file permissions 0600). The key is not password-protected; vault confidentiality depends on OS file permissions and disk encryption.vault.sqlite) and key file are both set to 0600 (owner-only). Readable only by the local user via Unix permissions.GIT_ASKPASS scripts, never stored in URLs or command argumentsThis document constitutes the DPIA for LocalMask. Because the tool processes personal data (PII in source code) and the processing purpose is to prevent that data from reaching third parties, a DPIA is appropriate. The residual risk assessment (Section 5) concludes that the risk to data subjects is near-zero.
At no point do real values leave the user's machine.
LOCALMASK_VAULT_KEY environment variable. All team members sharing a vault must use the same key.localmask export --my-data| Risk | Likelihood | Impact | Mitigation |
|---|---|---|---|
| PII reaches AI service unmasked | Near-zero | High | Masking is applied before data enters the transport layer. No bypass mechanism exists. |
| Vault compromise (local) | Low | Medium | AES-encrypted (Fernet) with a per-machine key file (0600 permissions). The key is not password-protected; security relies on OS access controls and full-disk encryption. An attacker with local file-system access to the user's home directory could decrypt the vault. |
| Vault compromise (Team/Redis) | Low | Medium | All values are AES-encrypted before storage in Redis; lookup keys are HMAC-SHA256 hashed. The encryption key must be provided via environment variable (LOCALMASK_VAULT_KEY). Deployments without an explicit key use a reduced-security default. Compromising the database without the key yields encrypted blobs, not plaintext. |
| Token collision reveals data | Near-zero | Low | Tokens are typed and sequentially numbered. No real value is embedded in the token string. |
| Incomplete detection (PII missed) | Low | Medium | 27+ regex patterns, entropy detection, optional ML model. User can teach custom patterns. Review step catches gaps. |
Low. LocalMask's architecture eliminates the primary risk (PII reaching third parties) by design. The residual risks relate to local machine compromise, which is outside the tool's threat model and mitigated by standard OS-level controls.
| Right | How LocalMask supports it |
|---|---|
| Right of access (Art. 15) | User has full local access to the vault. localmask status lists all scans and detections. |
| Right to erasure (Art. 17) | localmask cleanup deletes vault, scans, and masked cache. Irreversible. |
| Right to data portability (Art. 20) | localmask export --my-data exports user's own token mappings (Team tier). |
| Right to restriction (Art. 18) | User controls which files are scanned via .localmaskignore. |
None. LocalMask does not transmit data to any sub-processor, cloud service, or third party. The tool runs entirely on the user's machine. The only external communication that may occur is:
LocalMask's zero-network, local-first architecture provides data protection by design and by default as required by GDPR Article 25. Personal data processed by the tool never leaves the user's machine. The residual risk to data subjects is assessed as low.
Organizations using AI coding tools can deploy LocalMask as a technical measure under GDPR Article 32 to prevent inadvertent PII exposure to third-party AI services.
LocalMask is a detection and masking tool that assists in identifying secrets and PII in source code. While it uses 350+ detection patterns, entropy analysis, and optional AI models, no automated tool guarantees complete detection. False negatives (missed secrets) and false positives (over-detection) are possible.
The user is responsible for:
localmask teach or the review UI when the tool misses a secretLocalMask provides the complete toolchain for this purpose: detection (scan engine with 350+ patterns + ML), masking (automatic replacement with typed placeholders), review (interactive UI to inspect every detection), audit trail (who scanned what, when, and what was found), and authorization (approval gate — nothing is published or shared until explicitly authorized). The tool is an aid to the user's own due diligence, not a replacement for it.
Last updated: August 2026 · Version 1.2 · Applies to LocalMask 0.9.x (Free, Pro, and Team editions)