Skip to content

Latest commit

Β 

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

airlock

airlock

Stop pasting your secrets into AI.

A browser extension that redacts API keys, passwords & PII the instant you paste them into ChatGPT, Claude, Gemini & friends. 100% local. Zero network calls. Nothing to configure.

License: MIT Manifest V3 Network calls: 0 Tests: 35


You paste a stack trace into ChatGPT to debug it. Buried in there: an AWS key, a DB password, a customer's email. It's now in someone else's logs forever. You do this a dozen times a day without thinking - that's the danger. It's a reflex, not a decision.

airlock sits on that reflex. The moment you paste into an AI chat box, it swaps every secret for a typed placeholder - [AWS_ACCESS_KEY], [CONNECTION_STRING], [EMAIL] - so the model still sees the shape of your problem, but the secret never leaves your machine. A little toast tells you what it caught.

airlock redacting a paste into an AI chat

Before  ➜  AWS_ACCESS_KEY_ID=AKIAIOSFODNN7EXAMPLE
           DATABASE_URL=postgres://admin:[email protected]:5432/app
           ANTHROPIC_API_KEY=sk-ant-api03-xTf9...

After   ➜  AWS_ACCESS_KEY_ID=[AWS_ACCESS_KEY]
           DATABASE_URL=[CONNECTION_STRING]/app
           ANTHROPIC_API_KEY=[ANTHROPIC_KEY]

           πŸ”’ Blocked 3 secrets before paste
              AWS_ACCESS_KEY, CONNECTION_STRING, ANTHROPIC_KEY   [ Pause 30s ]

Why not just watch the clipboard?

Because a clipboard watcher is blind. It can't tell "pasting into ChatGPT" from "pasting my key into my password manager," so it either mangles every secret you ever copy or you turn it off. And polling has a race - copy-then-paste fast enough and the raw secret slips through.

airlock fires on the paste event itself, only on AI sites. No race. It never touches the secret you paste into your vault, your .env, or your terminal - only the one heading into a chatbot.

Install

From source (works today):

  1. Get the code - git clone https://github.com/KernelSpecter/AirLock-extension.git, or click Code β†’ Download ZIP on the repo and unzip it.
  2. Open chrome://extensions (or edge://extensions)
  3. Turn on Developer mode (top-right)
  4. Click Load unpacked and select the folder that contains manifest.json
  5. Paste an .env into claude.ai and watch it work πŸ”’

Chrome Web Store / Firefox Add-ons listings: coming soon.

What it catches

Detection is specific by default - provider-anchored patterns and real validators, not loose regexes that flag everything.

Category Detects
Cloud & API keys AWS, GCP, Anthropic, OpenAI, Stripe, Slack, SendGrid, Twilio, Google OAuth, npm
Tokens GitHub PATs (classic + fine-grained), JWTs
Credentials Private keys, proto://user:pass@host connection strings
Generic secrets API_KEY = "…" assignments - entropy-gated, so password="changeme" is ignored
PII Emails, credit cards (Luhn-validated)
PII (Aggressive mode) Phone numbers, IPv4 addresses, US SSNs

🀫 Why it won't cry wolf

A guard that fires on your normal typing gets disabled in a day. airlock is tuned for specificity over recall on everything on by default:

  • Provider-anchored patterns - AKIA…, ghp_…, sk-ant-…, matched by real prefixes/lengths, not "any long string."
  • Luhn-checked cards - a 16-digit number only redacts if it's a mathematically valid card, so order IDs and timestamps survive.
  • Entropy-gated generics - the secret = "…" catch-all only fires on genuinely high-entropy values.
  • Noisy stuff is opt-in - phones, IPs and SSNs live behind Aggressive mode in the popup.

A Node test suite (npm test, 35 passing) pins down both recall on real-shaped secrets and silence on ordinary code - plus the content script's paste-interception logic against fake DOM fields.

πŸ” Private by design

airlock makes zero network calls, ever. No telemetry, no cloud, no account, no servers. Everything - detection, redaction - happens in your browser, which is rather the point of a tool whose whole job is to stop data from leaving it. The entire detection engine is one readable file: src/engine.js.

How it works

  1. A content script loads only on AI chat sites and listens for paste.
  2. The pasted text runs through the detection engine; validators (Luhn, Shannon entropy) confirm candidates.
  3. On a hit, the paste is cancelled and the redacted text is inserted instead (framework-safe for React textareas and ProseMirror/Lexical editors alike).
  4. A toast shows what was blocked; the toolbar badge keeps a running count.

🧩 Its command-line sibling

Prefer the terminal, or want this in CI? The companion airlock CLI shares this exact detection spec - pipe files through it, or drop it into a pre-commit hook to keep secrets out of your commits.

Add a detector

Detectors are plain data in src/engine.js:

D("linear_key", "secret", "LINEAR_KEY", "high", /\blin_api_[A-Za-z0-9]{40}\b/gd),

Add a realistic fake to POSITIVES and a look-alike to NEGATIVES in tests/engine.test.js, run npm test, done. PRs adding provider coverage are very welcome - please keep the Python CLI's detectors.py in sync.

Roadmap

  • Chrome Web Store & Firefox Add-ons listings
  • Per-site enable/disable from the popup
  • Custom patterns & allowlist
  • Guard drag-and-drop and file attachments, not just paste
  • Optional local-only "restore original" within the chat box

Contributing

Issues and PRs welcome - especially new provider patterns and false-positive reports (paste the text that tripped it, with the secret itself replaced by Xs).

License

MIT Β© KernelSpecter

About

πŸ”’ Redact API keys, passwords & PII the instant you paste them into ChatGPT, Claude, Gemini & other AIs. 100% local β€” zero network calls.

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages