Skip to content
| Marketplace
Sign in
Visual Studio Code>Linters>LeakLensNew to Visual Studio Code? Get it now.
LeakLens

LeakLens

Aditya Shinde

|
1 install
| (0) | Free
Detect exposed API keys and secrets before they reach your repository
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

LeakLens 🔍

Find exposed API keys before hackers do — right inside VS Code.

LeakLens scans your code in real-time for hardcoded secrets and API keys, highlights them inline, blocks commits via a Git hook, and keeps a live sidebar panel of all detected leaks.


Features

🚨 Inline Highlights

As you type, LeakLens underlines detected secrets with color-coded warnings:

  • 🔴 Critical — Anthropic, OpenAI, Google, AWS keys
  • 🟠 High — GitHub tokens
  • 🟡 Medium — Generic hardcoded passwords/secrets

Hover over any highlight to see details and a direct link to revoke the key.

🛡️ Pre-commit Git Hook

Run LeakLens: Install Pre-commit Git Hook to block any commit that contains a detected secret. The hook scans only staged files and prints exactly which file and provider was detected.

📋 Sidebar Panel

A dedicated activity bar panel shows all detected secrets across your workspace, grouped by file. Click any item to jump directly to the offending line.

📁 Auto .gitignore

Run LeakLens: Add .env to .gitignore to automatically append .env, *.pem, *.key, secrets.json, and other sensitive file patterns to your .gitignore.

🔍 Full Workspace Scan

Run LeakLens: Scan Entire Workspace to scan all source files at once and get a full report.


Supported Providers

Provider Pattern
Anthropic sk-ant-api*
OpenAI sk-proj-*, sk-or-v1-*, sk-*
Google AI AIzaSy*
AWS AKIA*, aws_secret_access_key
GitHub ghp_*, gho_*, ghs_*, ghu_*
Generic api_key = "...", secret = "..."

Commands

Command Description
LeakLens: Scan Entire Workspace Scan all files in the project
LeakLens: Install Pre-commit Git Hook Block commits with secrets
LeakLens: Add .env to .gitignore Protect sensitive files

Settings

Setting Default Description
leaklens.enableOnSave true Scan on every file save
leaklens.enableInlineHighlights true Show inline decorations
leaklens.excludePatterns [node_modules, dist...] Glob patterns to skip

Best Practices

  1. Never hardcode secrets — always use .env files
  2. Add .env to .gitignore before your first commit
  3. Install the Git hook on every new project
  4. Rotate any key that LeakLens flags immediately

Made with ❤️ for developer security awareness.

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2026 Microsoft