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

ThreatLens

ThreatLens

|
10 installs
| (6) | Free
A code security extension that brings Gitleaks, OSV-Scanner, and Semgrep findings into VS Code.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

ThreatLens for VS Code

Find hardcoded secrets, vulnerable dependencies and insecure code patterns in one scan. ThreatLens runs Gitleaks, OSV-Scanner and Semgrep together, merges duplicate findings, and shows the results in the Problems panel and a sidebar.

Requirements

The extension drives the ThreatLens command-line tool, which needs Python 3.10+:

pip install git+https://github.com/QuantumWizardz/UCS503P_202627_ThreatLens.git@cli-v0.1.0
# or: pipx install git+https://github.com/QuantumWizardz/UCS503P_202627_ThreatLens.git@cli-v0.1.0

Then run ThreatLens: Install Scanners from the Command Palette (or threatlens install-tools in a terminal). It downloads Gitleaks and OSV-Scanner into ~/.threatlens/bin and checks their SHA-256 checksums. Semgrep comes with the pip package.

The CLI is not on PyPI yet, so this installs the tagged release cli-v0.1.0 from GitHub. Use a virtualenv or pipx if your system Python refuses pip install ("externally managed").

Run ThreatLens: Check Setup at any time to see what was found.

Features

  • One-click workspace scan. Use the shield in the status bar or ThreatLens: Scan Workspace.
  • Problems panel. Each finding is underlined on its exact line.
  • Sidebar. Findings are grouped by severity (CRITICAL … INFO); click one to jump to the code.
  • Quick fixes. The lightbulb explains the risk and copies the recommended fix.
  • Scan any GitHub repository or branch without cloning it yourself (ThreatLens: Scan Remote GitHub Repository). Private repositories use your VS Code GitHub sign-in.
  • Honest results. If a scanner fails, the status bar says Incomplete, never Clean.

Commands

Command What it does
ThreatLens: Scan Workspace Scan the first workspace folder
ThreatLens: Scan Remote GitHub Repository Pick a repo and branch, scan a temporary clone
ThreatLens: Install Scanners Download Gitleaks + OSV-Scanner (checksum-verified)
ThreatLens: Check Setup Show the CLI version and which scanners were found
ThreatLens: Clear Findings Remove all ThreatLens diagnostics
ThreatLens: Show Output Logs Open the ThreatLens output channel

Settings

Setting Default
threatlens.executablePath (blank) Path to the threatlens command. Blank = find it automatically
threatlens.pythonPath (blank) A Python with ThreatLens installed; runs python -m threatlens
threatlens.autoScanOnSave false Rescan after saving. Saves are batched and only one scan runs at a time

When both paths are blank, the extension looks in this order:

  1. a virtualenv in the workspace that has ThreatLens installed (trusted workspaces only)
  2. your PATH
  3. the usual pip and pipx install folders

Privacy and security

  • Local scans run entirely on your machine. Semgrep's auto ruleset is downloaded from the Semgrep registry.
  • GitHub scans clone into ~/.threatlens/tmp_repos and the clone is always deleted afterwards. Your token is passed through an environment variable and is never written to disk.
  • In untrusted workspaces the extension never runs anything from inside the workspace, and it ignores workspace-level executablePath / pythonPath settings.

Links

  • Source code and full documentation
  • Report an issue
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
  • Your Privacy Choices
  • Consumer Health Privacy
© 2026 Microsoft