Welcome to the CodeMask documentation! This guide will help you get started with masking sensitive code and text before sending it to AI models.
CodeMask is a local-first desktop application that helps you protect sensitive information in your code and text before sharing it with AI models like ChatGPT, Claude, or other LLMs.
The easiest way to get started is to download the pre-built executable for your platform:
.exe installer from the Download page.dmg package (Intel or Apple Silicon) from the Download page.deb package or AppImage from the Download pageVisit the Download page to get the latest version (v1.0.0) or check GitHub Releases for all available versions.
If you prefer to build from source or want to contribute to the project:
git clone https://github.com/codemasklab/codemask-oss.git
cd codemask-oss
npm install
npm run build
npm start
Code mode uses AST (Abstract Syntax Tree) parsing to understand your Python code structure and mask identifiers intelligently.
Click the "Mask All" button to automatically mask all identifiers in your Python code:
snake_case, the masked token will also be snake_case. Same for PascalCase, camelCase, etc.
For more control, you can manually select specific identifiers to mask:
api_key)Before:
def authenticate(user, password):
api_key = "sk-1234567890abcdef"
return verify_credentials(user, password, api_key)
After Masking:
def v6g9j2r41m5qk(v7h0k3s42n6rl, v8i1l4t53o7sm):
v9j2m5u64p8tn = "sk-1234567890abcdef"
return v0k3n6v75q9uo(v7h0k3s42n6rl, v8i1l4t53o7sm, v9j2m5u64p8tn)
Text mode is for free-form text masking. It's perfect for masking sensitive information in documents, emails, or any text content.
Select words or phrases in the input editor to mask them. Selected items appear in the "Selected Items" section.
CodeMask can detect and preserve the format of certain identifier types:
Before:
Contact John Doe at john.doe@example.com or call 555-123-4567
After Masking:
Contact v6g9j2r41m5qk at v7h0k3s42n6rl@masked.com or call 555-987-6543
After receiving a response from an AI assistant, you can unmask the content to restore original identifiers:
Mapping groups help you organize different masking sessions. Each group maintains its own set of mappings.
You can clear mappings for a specific group or all groups:
Ctrl+N (Windows/Linux) / Cmd+N (macOS) - New FileCtrl+O / Cmd+O - Open FileCtrl+S / Cmd+S - SaveCtrl+Shift+S / Cmd+Shift+S - Save AsCtrl+Z / Cmd+Z - UndoCtrl+Y / Cmd+Shift+Z - RedoCtrl+Shift+U / Cmd+Shift+U - Clear InputCtrl+Shift+O / Cmd+Shift+O - Clear OutputCtrl+Tab / Cmd+Tab - Next TabCtrl+Shift+Tab / Cmd+Shift+Tab - Previous TabCtrl+Shift+M / Cmd+Shift+M - Select Mapping GroupIf you get an error about the mapping file, CodeMask will create a new one automatically. However, you won't be able to unmask content from previous sessions.
On macOS and Linux, CodeMask uses the OS keychain to store encryption keys. If you see keychain access prompts, allow access for CodeMask to function properly.
If you encounter build errors, ensure you have:
If you encounter issues:
Contributing: CodeMask is open source! We welcome contributions. See the Contributing Guide for more information.