Skip to content
| Marketplace
Sign in
Visual Studio Code>Linters>SecretShield - Redact Secrets for AINew to Visual Studio Code? Get it now.
SecretShield - Redact Secrets for AI

SecretShield - Redact Secrets for AI

StackAPI

|
1 install
| (0) | Free
Detect and mask secrets locally before sharing code or prompts with an AI assistant.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

SecretShield for VS Code

The Security Layer Between Developers and AI.

SecretShield detects and masks secrets — API keys, tokens, passwords, private keys, database credentials — locally, before you paste code or prompts into an AI assistant.

Install

Search for StackAPI.secretshield-vscode in the Extensions view, or run:

code --install-extension StackAPI.secretshield-vscode

Secure Copy

  1. Select a function, or nothing to take the whole file.
  2. Run SecretShield: Secure Copy (Ctrl+Alt+Shift+C / Cmd+Alt+Shift+C, or the editor context menu).
  3. Review the redacted preview and confirm.
  4. Only the redacted text is placed on the clipboard. Paste it into your assistant.
const API_KEY = "sk_live_…";     →   const API_KEY = "sk_live_********";
const password = "…";            →   const password = "********";
postgres://admin:…@db/app        →   postgres://********:********@db/app

Commands

Command What it does
SecretShield: Secure Copy Copy the selection or file with secrets masked
SecretShield: Secure Prompt (Redact Clipboard) Redact the prompt currently on the clipboard
SecretShield: Redact Selection Replace secrets in the selection (undoable)
SecretShield: Preview Redaction Open a read-only redacted preview
SecretShield: Scan Current File / Scan Selection Show diagnostics for possible secrets
SecretShield: Scan Workspace Scan the project in a background worker (cancellable)
SecretShield: Show Security Report Markdown report without any secret values
SecretShield: Manage Rules Enable/disable rules, add or remove custom RE2 rules

Privacy

  • Everything runs locally. SecretShield makes no network requests and collects no telemetry.
  • Diagnostics, previews, notifications and reports never show original values.
  • The clipboard is only read or written when you run Secure Copy or Secure Prompt.
  • Nothing is stored on disk; previews live in memory and disappear when closed.

Workspace Trust

In untrusted workspaces SecretShield runs in limited mode: only built-in rules and your user settings are used. Workspace-level rules, disabled rules and .secretshieldignore files from the repository are ignored, so a cloned project cannot silence detection or inject slow patterns.

Settings

Setting Default Description
secretShield.enabled true Enable diagnostics
secretShield.scanOnSave / scanOnOpen true / false Automatic scans
secretShield.maskingStrategy partial partial keeps public vendor prefixes only, full, or token
secretShield.showPreview true Preview and confirm before copying or replacing
secretShield.entropyDetection true Detect random-looking strings
secretShield.minConfidence 40 Ignore weaker findings
secretShield.useIgnoreFile true Honour .secretshieldignore (trusted workspaces only)
secretShield.maxFileSizeKB 2048 Larger files are reported as not scanned
secretShield.disabledRules [] Rule ids to disable
secretShield.customRules [] Custom rules (RE2 patterns, linear time)
secretShield.localOnly true Always on: processing is local

Masks have a fixed length, so they never reveal how long a secret is. Unlike a fixed preservePrefix, SecretShield only keeps prefixes that are public by design (sk_live_, ghp_, AKIA…), never the first characters of a password.

Limitations

Detection is heuristic: SecretShield reduces the risk of accidental disclosure but cannot guarantee that every secret is found. A VS Code extension cannot intercept copy/paste in other applications, which is why Secure Copy is an explicit command. If a secret was already shared, masking it afterwards does not revoke it: rotate the secret.

License: Apache-2.0

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
  • Your Privacy Choices
  • Consumer Health Privacy
© 2026 Microsoft