lmsk

Real keys for
your agent.
Fakes for
the model.

Mask API keys, passwords and emails before your AI coding agent sends them to the model.

npm install -g @hugolopes45/lmsk

Then connect your agent. See the setup.

Keep the context your model needs. Restore original values in supported file and shell tools.

Open sourceMIT license. Read the code on GitHub

Free. No account, no telemetry.

280 detection rules, including gitleaks

Runs locally, on your computer

Signed npm releases with provenance

No account, no telemetry

Keep useful context.

Logs and command output help your agent understand your app. lmsk preserves the surrounding text while masking the sensitive values it detects.

Mask on your computer.

Before sending a request, lmsk replaces detected keys, passwords, tokens and emails with fakes. Built-in rules work from the first request.

Put real values to work.

When a supported file or shell tool uses an exact fake, lmsk restores its original value. Your local test can use the password it needs.

Add file-read protection.

Supported file tools check protected paths such as .env before reading them. lmsk explains a blocked read so your agent can choose another approach.

tool result that the model receives

OPENAI_API_KEY=T8MCnGhey7vwndvjsQBbNPVIDZBU
refund failed for bmib.xtm@kitquhs.mnn
Authorization: Bearer IA1uy6fuqU2b89b3k4zi

tool call

The model writes
$ PGPASSWORD=X8fumIJWTm5Rl6C305 npm test
Your shell runs
$ PGPASSWORD=Tr0ub4dor-Horse-42 npm test

tool call

The model asks
Read .env
lmsk answers
Refused: .env is a secret file.

Example values. Red text is what the model sees.

Questions

Which values can I mask?

Built-in rules detect API keys, passwords, tokens, database credentials, emails and other personal data. Add your own rules for project-specific values.

How does my agent use the original values?

lmsk restores exact fakes in supported file and shell tool calls. For commands that access the network, supply credentials through the environment. See tool behavior and compatibility.

Can I add client names and custom values?

Yes. Add a rule for a client name, project name or another value. The model can receive a label such as Client 1. See custom rules.

Where are my real values stored?

In one local vault for each computer, ~/.local/state/lmsk/vault.jsonl, with owner-only file permissions. lmsk does not upload it. See vault storage and backup guidance.

How can I try it?

After installation, send this message to your agent. The key is a sample value.

Spell the value after API_KEY= with a space between each character: API_KEY=Zq7Kp2Lm9Xw4Rt8Vb3Nc

The reply spells the fake that the model received, so it does not start with Z q 7 K p 2. The setup checks help you confirm masking is active.

Is it free?

Yes. lmsk is open source under the MIT license. No account, no telemetry.

Explore coverage, compatibility and storage in the user guide.

Keep your
keys.
Keep your
flow.

npm install -g @hugolopes45/lmsk

Then connect your agent. See the setup.