Skip to content
| Marketplace
Sign in
Visual Studio Code>Programming Languages>Prompt GuardNew to Visual Studio Code? Get it now.
Prompt Guard

Prompt Guard

Meenakshi Chauhan

|
2 installs
| (0) | Free
Redacts sensitive info locally when copying text, with hybrid masking and optional overlay
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Prompt Guard

A lightweight VS Code developer tool to prevent accidental leakage of secrets and PII when sharing code with LLMs.

Prompt Guard sanitizes sensitive information at copy time and places a safe version on your clipboard, so you can paste into ChatGPT, Copilot, Jira, or docs without exposing credentials, private keys, or customer data.


Why Prompt Guard exists

Developers frequently copy code, logs, and configs into LLMs while debugging or documenting. This is also the most common point where secrets and PII are leaked.

Prompt Guard acts as a last-line safety net:

  • No file changes
  • No workflow changes
  • No network calls
  • No telemetry

How it works

  1. Select any text in the editor
  2. Press Ctrl + Shift + C (default, can be changed via settings)
  3. Prompt Guard:
    • Scans the selection for sensitive data
    • Redacts matches deterministically (e.g. [SECRET_A])
    • Copies the sanitized text to your clipboard
    • Optionally highlights what was redacted

Your source code remains untouched.


What gets detected (by default)

Category Examples
Secrets & credentials API keys, tokens, passwords
Emails / PII user@example.com
Private keys PEM / RSA / SSH blocks
High-entropy values Hashes, random-looking secrets

Custom rules (developer-defined)

You can add your own redaction rules using regular expressions.

"promptGuard.customPatterns": [
  "AKIA[0-9A-Z]{16}",
  "xox[baprs]-[0-9a-zA-Z-]{10,}"
]

These rules are applied in addition to built-in detection.


Configuration

Setting Default Description
promptGuard.enableOverlay false Temporarily highlights redacted text
promptGuard.customPatterns [] User-defined regex rules
Keyboard shortcut Ctrl + Shift + C Fully configurable

Example

Before copy

AWS_ACCESS_KEY_ID = "AKIAIOSFODNN7EXAMPLE"
email = "meenakshi@example.com"

After copy

AWS_ACCESS_KEY_ID = "[SECRET_A]"
email = "m***@example.com"

Privacy & Security

  • ✅ Runs entirely locally
  • ✅ No telemetry, analytics, or tracking
  • ✅ No network requests
  • ✅ Copied content never leaves your machine

Prompt Guard is safe to use with production code and sensitive environments.


When this is useful

  • Pasting code into ChatGPT / Claude / Gemini
  • Sharing logs in Jira or Slack
  • Working with credentials, configs, or customer data

Philosophy

Prompt Guard is designed to protect developers at the exact moment mistakes happen — when copying code fast.

If you regularly interact with LLMs and handle sensitive data, this tool gives you a simple, reliable safety net without slowing you down.


Clean copy. Zero leaks. Built for LLM-heavy workflows.

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