Introduction

Visual Studio Code introduced Workspace Trust as a security feature to protect users from potentially malicious code execution when opening unfamiliar workspaces. When a workspace is not trusted, VSCode restricts certain features like debugging, task execution, extension activation, and terminal operations. While this feature enhances security, it can be frustrating when legitimate workspaces are marked as untrusted, preventing normal development workflows. Understanding how to manage workspace trust settings, configure automatic trust rules, and override restrictions when necessary is essential for productive development.

Symptoms

When VSCode workspace trust is restricting your workspace, you will observe:

  • Banner at top of window: "Restricted Mode: Some features are disabled because this workspace is not trusted"
  • Debugging disabled - Run and Debug button shows "Run in Restricted Mode"
  • Tasks not running - Task Explorer shows disabled status
  • Extensions not activating - Some extensions show "(Disabled in Restricted Mode)"
  • Terminal prompts for confirmation before running commands
  • Settings sync limited - Certain settings cannot be applied
  • Workspace settings not editable - "Settings are read-only in untrusted workspaces"

Specific UI indicators: - Yellow/orange shield icon in status bar - "Restricted Mode" label in title bar - Extensions panel showing "Workspace Trust" filter - Context menu items grayed out

VSCode may show dialogs like: `` Do you trust the authors of the files in this folder? [Yes, I trust the authors] [No, I don't trust the authors] [Learn More]

Common Causes

  1. 1.New workspace opened - First time opening a folder triggers trust prompt
  2. 2.Workspace trust declined - User previously clicked "No" on trust prompt
  3. 3.Parent folder untrusted - Workspace inherits untrusted status from parent
  4. 4.Git repository source unknown - Cloned from unfamiliar remote repository
  5. 5.Workspace trust setting disabled - Security setting prevents automatic trust
  6. 6.Extension trust policy - Extensions require trusted workspace to activate
  7. 7.Multi-root workspace with mixed trust - Some folders trusted, others not
  8. 8.Remote workspace trust - SSH/WSL container workspace requires separate trust
  9. 9.Trust metadata corrupted - VSCode internal trust storage issue
  10. 10.Portable mode installation - Portable VSCode has different trust defaults

Step-by-Step Fix

Step 1: Check Current Workspace Trust Status

Verify the current trust status and restrictions:

```bash # Open VSCode Command Palette (Ctrl+Shift+P / Cmd+Shift+P) # Run: "Workspace: Show Trust"

# Or check via CLI code --status | grep -i trust ```

  1. 1.In VSCode, check trust status:
  2. 2.Look at the status bar for the shield icon (yellow = restricted)
  3. 3.Click the shield icon to open Workspace Trust management
  4. 4.Check the "Manage Workspace Trust" panel for folder status

View restricted features: ``` # In Command Palette, run: "Workspace: Manage Workspace Trust"

# The panel shows: - Trusted folders list - Untrusted folders list - Current workspace trust status ```

Step 2: Trust the Workspace Directly

Grant trust to the current workspace:

  1. 1.Method 1: Via Banner Dialog
  2. 2.Click "Yes, I trust the authors" in the banner
  3. 3.Confirm the action if prompted
  4. 4.Workspace features will immediately be enabled

Method 2: Via Command Palette ``bash # Open Command Palette: Ctrl+Shift+P # Run command: "Workspace: Trust This Workspace"

  1. 1.Method 3: Via Status Bar
  2. 2.Click the shield icon in the status bar
  3. 3.In the trust management panel, click "Trust Folder"
  4. 4.Confirm the trust decision

Method 4: Via Settings ``json // In settings.json { "security.workspace.trust.enabled": false }

Step 3: Configure Automatic Trust Rules

Set up automatic trust for specific folders or repositories:

bash
# Open VSCode settings (Ctrl+,)
# Search for "workspace trust"

Configure trusted folders in settings.json: ``json { "security.workspace.trust.enabled": true, "security.workspace.trust.untrustedFiles": "open", "security.trusted.allowWorkspacesInTrustedFolders": [ "/home/user/projects", "/home/user/work", "C:\\Development" ] }

  1. 1.Trust specific parent folders via UI:
  2. 2.Open "Manage Workspace Trust" panel
  3. 3.Click "Add Trusted Folder"
  4. 4.Select parent folder containing your projects
  5. 5.All subfolders will automatically inherit trust

Step 4: Disable Workspace Trust Feature

If you prefer to disable the feature entirely (less secure but more convenient):

  1. 1.Method 1: Via Settings UI
  2. 2.Open Settings (Ctrl+,)
  3. 3.Search "security.workspace.trust.enabled"
  4. 4.Uncheck the checkbox to disable
  5. 5.Restart VSCode if prompted

Method 2: Via settings.json ``json { "security.workspace.trust.enabled": false }

Method 3: Via Command Line ```bash # Start VSCode with trust disabled code --disable-workspace-trust /path/to/workspace

# Or set environment variable VSCODE_DISABLE_WORKSPACE_TRUST=1 code ```

Step 5: Manage Extension Trust Requirements

Handle extensions that require trusted workspace:

  1. 1.Check extension trust requirements:
  2. 2.Open Extensions panel (Ctrl+Shift+X)
  3. 3.Filter by "@installed"
  4. 4.Look for "(Disabled in Restricted Mode)" labels

Enable specific extensions in restricted mode: ``json // In settings.json { "extensions.supportUntrustedWorkspaces": { "ms-python.python": { "limited": { "enabled": true, "description": "Allow Python extension in untrusted workspace" } }, "dbaeumer.vscode-eslint": { "limited": { "enabled": true } } } }

  1. 1.Per-extension configuration:
  2. 2.Click on the disabled extension
  3. 3.Look for "Enable in Restricted Mode" button
  4. 4.Click to enable with limited functionality

Step 6: Configure Multi-Root Workspace Trust

For multi-root workspaces with mixed trust status:

bash
# Create a multi-root workspace file
code --add /path/to/folder1 --add /path/to/folder2
# Save as .code-workspace file

Configure in .code-workspace file: ``json { "folders": [ { "path": "/home/user/trusted-project" }, { "path": "/home/user/untrusted-project" } ], "settings": { "security.workspace.trust.untrustedFiles": "open" }, "extensions": { "recommendations": ["ms-python.python"] } }

  1. 1.Trust individual folders in multi-root workspace:
  2. 2.Open Workspace Trust management
  3. 3.Each folder will be listed separately
  4. 4.Click "Trust" for specific folders

Step 7: Handle Remote Workspace Trust

For SSH, WSL, or container workspaces:

VSCode Remote - SSH: ```bash # SSH workspace trust is separate from local # When connecting to SSH host, you'll see trust prompt

  1. 1.# Trust SSH workspace:
  2. 2.Connect to SSH host
  3. 3.Open folder on remote
  4. 4.Click "Yes, I trust the authors" when prompted
  5. 5.`

VSCode Remote - Containers: ```bash # Dev Containers have special trust handling # Container workspace trust is managed per container

# Configure in devcontainer.json: { "customizations": { "vscode": { "settings": { "security.workspace.trust.enabled": true } } } } ```

VSCode Remote - WSL: ```bash # WSL workspaces inherit from Windows trust settings # Open WSL folder via: code /mnt/c/path/to/folder # Or: code --remote wsl+Ubuntu /home/user/project

# Trust prompt will appear for WSL paths ```

Step 8: Reset Workspace Trust Storage

If trust metadata is corrupted:

```bash # Find VSCode trust storage location # Linux: ~/.config/Code/User/globalStorage/vscode.workspace-trust/ # macOS: ~/Library/Application Support/Code/User/globalStorage/vscode.workspace-trust/ # Windows: %APPDATA%\Code\User\globalStorage\vscode.workspace-trust\

# Reset trust storage rm -rf ~/.config/Code/User/globalStorage/vscode.workspace-trust/*

# Restart VSCode code ```

The trust prompt will reappear for all workspaces after reset.

Verification

After configuring workspace trust, verify the settings:

```bash # Check trust status in VSCode # Command Palette: "Workspace: Show Trust"

# Expected: "This workspace is trusted" message ```

  1. 1.Verify features are enabled:
  2. 2.Debugging: Press F5, debug panel should be active
  3. 3.Tasks: Run task from Task Explorer (Ctrl+Shift+P > "Tasks: Run Task")
  4. 4.Terminal: Open terminal (Ctrl+`), should open without prompt
  5. 5.Extensions: Check Extensions panel, all extensions should be active

Test restricted features: ```bash # Try running a task # In .vscode/tasks.json: { "version": "2.0.0", "tasks": [{ "label": "test-task", "type": "shell", "command": "echo 'Workspace is trusted'" }] }

# Run: Ctrl+Shift+P > "Tasks: Run Task" > "test-task" # Expected: Task runs without restriction prompt ```

Prevention

To prevent workspace trust issues in the future:

  1. 1.Configure trusted parent folders:
  2. 2.```json
  3. 3.{
  4. 4."security.trusted.allowWorkspacesInTrustedFolders": [
  5. 5."/home/user/dev",
  6. 6."/home/user/work"
  7. 7.]
  8. 8.}
  9. 9.`
  10. 10.Use git trust detection:
  11. 11.```json
  12. 12.{
  13. 13."security.workspace.trust.emptyWindow": "untrusted",
  14. 14."git.trustWorkspaceFromGit": true
  15. 15.}
  16. 16.`
  17. 17.Create workspace trust policy:
  18. 18.```json
  19. 19.{
  20. 20."security.workspace.trust.untrustedFiles": "open",
  21. 21."security.workspace.trust.banner": "never",
  22. 22."security.workspace.trust.startupPrompt": "onlyInTrustedWorkspaces"
  23. 23.}
  24. 24.`
  25. 25.Document trust decisions:
  26. 26.- Keep a list of trusted folders in team documentation
  27. 27.- Include trust settings in workspace recommendations
  28. 28.- Add to .vscode/settings.json in shared projects
  29. 29.Configure per-project trust settings:
  30. 30.```json
  31. 31.// In project's .vscode/settings.json
  32. 32.{
  33. 33."security.workspace.trust.enabled": true,
  34. 34."extensions.supportUntrustedWorkspaces": {
  35. 35."*": {
  36. 36."limited": {
  37. 37."enabled": true
  38. 38.}
  39. 39.}
  40. 40.}
  41. 41.}
  42. 42.`
  43. 43.Use portable mode for controlled environments:
  44. 44.```bash
  45. 45.# Portable mode has different trust defaults
  46. 46.# Create data folder next to VSCode executable
  47. 47.mkdir Code/data
  48. 48.# Trust settings stored in data/user-data/
  49. 49.`
  50. 50.Set up team-wide trust configuration:
  51. 51.```json
  52. 52.// Shared settings for team
  53. 53.{
  54. 54."security.workspace.trust.enabled": true,
  55. 55."security.trusted.allowWorkspacesInTrustedFolders": [
  56. 56."${workspaceFolder}"
  57. 57.]
  58. 58.}
  59. 59.`
  • [VS Code Auto Save Not Working](fix-vscode-auto-save)
  • [VS Code Bracket Colorization Not Working](fix-vscode-bracket-colorization)
  • [Fix Fix Vscode Copilot Not Working Issue in VS Code](fix-vscode-copilot-not-working)
  • [VS Code Debugger Not Attaching - Complete Troubleshooting Guide](fix-vscode-debugger-not-attaching)
  • [Fix VS Code Debugging Not Stopping at Breakpoints: Breakpoints Ignored](fix-vscode-debugging-breakpoints-not-working)

<script type="application/ld+json"> { "@context": "https://schema.org", "@type": "TechArticle", "headline": "VSCode Workspace Trust Issue", "description": "Fix VSCode workspace trust restrictions. Enable debugging, extensions, and terminal access in untrusted workspaces.", "url": "https://www.fixwikihub.com/fix-vscode-workspace-trust-issue", "publisher": { "@type": "Organization", "name": "FixWikiHub", "url": "https://www.fixwikihub.com" }, "author": { "@type": "Person", "name": "FixWikiHub Editorial Team" }, "datePublished": "2025-12-12T22:09:49.892Z", "dateModified": "2025-12-12T22:09:49.892Z" } </script>