Skip to content
| Marketplace
Sign in
Visual Studio Code>Machine Learning>LLM Safe WorkspaceNew to Visual Studio Code? Get it now.
LLM Safe Workspace

LLM Safe Workspace

Preview

magnus skudal tjoem

|
1 install
| (0) | Free
| Sponsor
Create container-safe redacted workspaces for LLM agents
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

LLM Safe Workspace

CI License: MIT VS Code

A VS Code extension that creates redacted, container-safe workspaces for LLM agents and provides a host-only hydrate/run workflow for secrets and proprietary logic.

Table of Contents

  • Features
  • Why This Approach
  • Installation
  • Quick Start
  • Configuration
  • Commands
  • Hydrate and Run
  • Syncing Changes
  • Requirements
  • Troubleshooting
  • Contributing
  • License

Features

  • Automatic secret redaction - Detects and masks 20+ types of secrets (API keys, JWTs, private keys, connection strings)
  • Container isolation - Generates Dev Container configuration so LLMs only see redacted files
  • Customizable rules - Configure redaction patterns, sensitive keywords, and file inclusion/exclusion via YAML
  • Bidirectional sync - Sync changes between safe workspace and original repo
  • Hydrate/run workflow - Restore secrets temporarily for test runs without exposing them to LLMs

Why This Approach

If your LLM can run terminal commands, any mounted file path is reachable. This extension avoids that risk by:

  • Creating a redacted workspace for LLM use
  • Generating a Dev Container setup so the LLM only sees the redacted files
  • Keeping real secrets/logic outside the workspace, hydrated only for runs

Installation

From VSIX (Recommended)

  1. Download the latest .vsix from Releases
  2. In VS Code: Extensions > ... > Install from VSIX

From Source

git clone https://github.com/MandruStack/LLM_safe_vs_extension.git
cd LLM_safe_vs_extension
npm install
npm run build
npx @vscode/vsce package
code --install-extension llm-safe-workspace-*.vsix

Quick Start

  1. Install the extension
  2. Open the repository you want to protect
  3. Run "LLM Safe: Open Settings UI" and review the defaults
  4. Run "LLM Safe: Create Redacted Workspace (Container Safe)"
  5. The extension creates <source>_safe in the repo (or your configured redacted_workspace_dir)
  6. The extension opens the safe folder in a Dev Container automatically
  7. Use Claude Code/Codex inside the container

Configuration

Run "LLM Safe: Open Settings UI" to configure:

Setting Description
hidden File patterns to completely exclude from safe workspace
redactions Rules for detecting and masking secrets
include_patterns File patterns to scan for redaction
sensitive_keywords Keywords that trigger redaction (e.g., password, token)
disabled_redactions Rule names to disable
max_file_size_kb Skip files larger than this (0 = no limit)
redacted_workspace_dir Output directory name (auto = <source>_safe)
container_extensions VS Code extensions to install in container
source_root Subfolder to redact (. = entire repo)

Default Protections

  • Hidden files: .env, .npmrc, .pypirc, .git-credentials, SSH keys, certificates, and common secret stores
  • Built-in rules: Private keys, JWTs, AWS keys, GitHub/GitLab tokens, Slack/Discord webhooks, OpenAI/Anthropic API keys, connection strings, and more
  • Sensitive keywords: key, secret, token, password, credential, webhook (case-insensitive)

Commands

Command Description
LLM Safe: Create Redacted Workspace Generate container-safe copy with secrets masked
LLM Safe: Open Settings UI Configure redaction rules and patterns
LLM Safe: Scan Redaction Preview Preview what will be redacted before generating
LLM Safe: Edit .llm-safe.yaml Open config file in editor
LLM Safe: Scaffold Hydrate & Run Generate runner scripts for secret restoration

Hydrate and Run

The safe workspace includes a scaffolding_extension/ folder with runner scripts:

# Run a command with secrets temporarily restored
node scaffolding_extension/llm-safe-run.js -- npm test

The script will:

  1. Copy the redacted workspace to a temp directory
  2. Run your hydrate commands (e.g., sops, age)
  3. Overlay decrypted files into the temp workspace
  4. Run your command
  5. Delete the temp workspace

Edit scaffolding_extension/llm-safe-run.json to configure hydration.

Syncing Changes

Use the sync scripts to transfer changes between workspaces:

# Apply safe workspace edits back to original repo
node scaffolding_extension/llm-safe-sync.js --to-source

# Refresh safe workspace from original repo
node scaffolding_extension/llm-safe-sync.js --to-safe

Options:

  • --dry-run - Preview changes without applying
  • --delete - Remove files missing on the other side
  • --allow-redacted - Force sync even if redacted placeholders exist

Requirements

Requirement Purpose
VS Code 1.85+ Extension host
Docker Desktop Container isolation
Dev Containers extension Required for container workflow

Note: Without Docker, you can still create the redacted folder, but isolation is weaker.

Troubleshooting

Docker Not Running

Error: "Docker Desktop is not running"

Solution: Start Docker Desktop before running the extension.

Extension Not Found in Container

Some extensions (like Claude Code) may not be available for Linux ARM.

Solution: Remove unavailable extensions from container_extensions in your config.

Redactions Not Appearing

  1. Check include_patterns covers your file types
  2. Run "Scan Redaction Preview" to verify detection
  3. Check disabled_redactions list

Container Fails to Open

  1. Ensure Dev Containers extension is installed
  2. Try "Reopen in Container" manually from the Command Palette
  3. Check Docker has sufficient resources allocated

First Container Open is Slow

This is normal. VS Code Server and extensions need to download. Subsequent opens are faster.

Extension Development Host Limitations

When running via F5 (Extension Development Host), the container opens in a separate window without your dev extension. To test the full container flow, package and install the extension normally.

Sharing with Others

This workflow is shareable:

  1. Commit the redacted workspace (safe to share)
  2. Commit .llm-safe.yaml and scaffolding_extension/
  3. Share decryption keys out-of-band

Each collaborator can hydrate locally without exposing secrets to LLMs.

Security Notes

  • Do not mount your host home directory into the container
  • Keep secrets and proprietary logic outside the workspace
  • Use overlays to hydrate only for test runs
  • The redacted workspace is intended to be your LLM-facing repo

Contributing

See CONTRIBUTING.md for development setup and guidelines.

Support

If you find this extension useful, consider supporting its development:

Ko-fi

License

MIT - see LICENSE

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