Local text masking

Mask sensitive values before your agent reads.

MaskKeep replaces supported IDs, IBANs, cards, API keys, emails and phone numbers with tokens while keeping the surrounding text readable.

Sample input (English labels)

# All values are fake or public documentation/test values.
Sample support ticket
Egyptian national ID 30001010100000
Saudi iqama 2000000006
IBAN SA0380000000608010167519
Test card 4111111111111111
Paymob key egy_sk_test_FAKEFAKEFAKEFAKE1234
Email fictional.customer@example.com
Mobile 010 0000 0000

Masked output (same command, English labels)

$ python3 -I skills/maskkeep/scripts/maskkeep.py mask ticket.txt# All values are fake or public documentation/test values.
Sample support ticket
Egyptian national ID [REDACTED_EG_NID_01]
Saudi iqama [REDACTED_SA_ID_01]
IBAN [REDACTED_IBAN_01]
Test card [REDACTED_CARD_01]
Paymob key [REDACTED_SECRET_01]
Email [REDACTED_EMAIL_01]
Mobile [REDACTED_PHONE_01]
Recorded output from a fictional support ticket. MaskKeep also reads Arabic labels and Arabic-Indic digits: the Arabic page shows that sample.
1
standard-library script
7
detector types
0
runtime dependencies

Feel the problem in 2 minutes

Stamp it before it leaks. Play Redaction Relay: black out the sensitive tokens before they reach the model.

Simulated training exercise, not a real scan result.

From local file to masked copy

Start with a file path

Pass the path to MaskKeep before the agent opens the original.

Mask known formats

Local rules match supported formats, including Arabic-Indic digits, and replace selected values with stable tokens within the run.

Read the masked copy

Give the agent that copy and report the masked types and skipped low-confidence matches.

Supported agent setups

The README records local checks against vendor documentation for these setups. Live registry installs remain unverified.

Claude CodeCodexGemini CLIOpenCodeGitHub Copilotskills CLI

The README also describes untested setups for Claude.ai, ChatGPT, Gemini web/app and Google Antigravity.

Install

Build the local bundles from the project root.

python3 -I tools/build.py --dist
/plugin marketplace add QidarSarhan/maskkeep
/plugin install maskkeep@maskkeep

Unzip maskkeep-skill.zip for skill-only setup.

~/.claude/skills/  ·  .claude/skills/

Evidence

DOCUMENTED

Recorded demo

The terminal shows the output of the same command on a fictional ticket with English labels. The recorded demo saved in docs/demo/maskkeep-output.txt uses the Arabic-labelled ticket.

PARTIAL

Engine tests on Linux

The README records 36 passing engine tests across five Python versions on Linux and 96 tests in a discovery run. Python 3.10, Windows and macOS were outside the recorded run.

UNVERIFIED

Live integrations

Live registry installation, hook operation and agent adherence remain untested.

Coverage and limits

A clean scan gives no privacy or legal compliance guarantee. Precision and recall are unmeasured.

Detection, access and restoration
  • Rules can miss unknown formats and flag ordinary values. Names, addresses, arbitrary free text, images and OCR are unsupported. Use a UTF-8 text export for a PDF or office document.
  • The default skips low-confidence matches. Guard checks medium and high confidence and can return clean for Saudi IDs without context. Egyptian and Saudi ID checks use heuristics.
  • Masking before reading relies on the agent following instructions. Text pasted into chat is already exposed. For Claude Code, a direct PreToolUse guard exit of 1 does not block a read. The supplied wrapper maps findings and errors to exit 2, with live integration untested.
  • An optional restore map contains plaintext originals. Keep it outside the project and away from agent access, and restore only as a human on your machine. Without a map there is no restoration.
  • Password assignments, opaque Bearer tokens and unprefixed AWS secret access keys are among the documented misses. Meeza and mada coverage is unverified.
Get Involved

Join Our Community

Whether you are submitting pull requests, or helping others debug, your participation powers this project.

Mask it before your agent reads it.

Mission

To give every builder small, honest tools that check before an agent builds on a mistake.

Vision

A builder community, Arabic-first and global in reach, where checking before executing is a daily habit.

Documented before announced · Local by default · Arabic is native, not translated · Limits stated openly · Open source