# Fix VS Code Workspace Trust Not Enabled Blocking Tasks
You try to run a VS Code task (build, test, deploy), but nothing happens. A notification appears:
Running tasks is disabled in Restricted Mode.Or the task output shows:
The task cannot be executed because the workspace is not trusted.VS Code's Workspace Trust feature blocks potentially dangerous operations in untrusted folders.
Understanding Workspace Trust
Workspace Trust determines whether VS Code runs code from the current folder. In Restricted Mode (untrusted workspace):
- Tasks cannot be executed
- Debug sessions cannot be started
- Terminal commands are limited
- Extension features that run code are disabled
- Jupyter notebooks cannot execute cells
This protects you from malicious code in downloaded projects.
Trusting the Current Workspace
Click the "Manage" button in the trust notification, or use the Command Palette:
Workspaces: Manage Workspace TrustThen click "Trust Workspace & Enable All Features". VS Code will remember this decision for the folder.
Configuring Trust Behavior
Control how VS Code handles untrusted workspaces:
{
"security.workspace.trust.enabled": true,
"security.workspace.trust.startupPrompt": "once",
"security.workspace.trust.untrustedFiles": "prompt"
}Options for startupPrompt:
- once -- Prompt once per workspace
- everytime -- Prompt every time you open the workspace
- never -- Never prompt (open in Restricted Mode by default)
Options for untrustedFiles:
- prompt -- Ask what to do when opening a file
- openInNewWindow -- Open in a new window with restricted mode
- promptInNewWindow -- Prompt in a new window
Trusted Folders Configuration
Instead of trusting every workspace, configure specific trusted paths:
{
"security.workspace.trust.untrustedFiles": "prompt",
"security.workspace.trust.emptyWindow": false
}You can also configure trusted parent directories. Any workspace under a trusted parent is automatically trusted:
{
"security.workspace.trust.untrustedFiles": "openInNewWindow"
}Then use the trust management UI to add parent directories:
Workspaces: Manage Workspace Trust > Trusted Folders > Add FolderAdd /home/user/projects/ to trust all projects in that directory.
Task-Specific Trust Issues
Some tasks may fail even in a trusted workspace if the task definition is malformed:
{
"version": "2.0.0",
"tasks": [
{
"label": "build",
"type": "shell",
"command": "npm run build",
"group": "build",
"problemMatcher": [],
"presentation": {
"reveal": "always",
"panel": "new"
}
}
]
}If a task's command or args reference untrusted paths, the task may be blocked. Ensure all paths in the task definition are within the trusted workspace.
Diagnosing Trust Issues
Check the current trust state:
Workspaces: Workspace TrustThis shows whether the current workspace is trusted, which features are restricted, and which parent folders are trusted.
Check which extensions are restricted:
Extensions > Filter: @restrictedExtensions in Restricted Mode cannot execute code. They can only provide static features like syntax highlighting and theme.
Disabling Workspace Trust (Not Recommended)
If you work in an isolated environment and want to disable trust checks entirely:
{
"security.workspace.trust.enabled": false
}Warning: This disables all workspace trust protections. Opening a malicious project could execute arbitrary code on your machine. Only disable in isolated development environments.
Workspace Trust and Multi-Root Workspaces
In a multi-root workspace, trust is evaluated per-folder:
{
"folders": [
{ "path": "/home/user/trusted-project" },
{ "path": "/home/user/downloads/untrusted-download" }
]
}The first folder may be trusted while the second is not. Task execution is allowed only from trusted folders.