Workspace Trust

Workspace Trust is a Visual Studio Code feature that limits features capable of executing project-supplied code until the user decides to trust the workspace.

An editor can do more than display a project’s files. It can run tasks, launch debuggers, and load extensions or settings influenced by that project. VS Code’s Restricted Mode disables or limits those capabilities while the workspace is untrusted.

A folder can inherit trust from a parent folder. Check the workspace’s actual trust state; a newly downloaded project does not necessarily produce a fresh prompt.

What trusting a workspace means

Trusting the workspace lets more editor features operate on its contents. It is not a code review. Nor is Restricted Mode a sandbox: VS Code warns that a malicious extension can ignore it and execute code.

This matters when someone supplies a project for a job interview. Microsoft documented fake developer interviews used to deliver malware. The editor’s prompt is one decision; running a dependency installation or starting the project is another. Use the approved assessment environment before running unfamiliar code.

The coding-assessment article follows those decisions. The workflow approval article covers the corresponding problem in CI: what contributed code can reach when automation runs it.

Sources

See it in practice