feat: disable VS Code Workspace Trust in the image#521
Merged
Conversation
Ship `security.workspace.trust.enabled: false` in the Machine settings so workspaces (e.g. /workspaces/glueops) always open trusted. Removes the "Do you trust the authors of the files in this folder? Creating a terminal process requires executing code" prompt that blocks terminals/tasks on every codespace launch. Pre-trusting a single folder isn't durable -- VS Code stores the trusted -folder list in SQLite global state that a freshly launched CDE doesn't carry -- so disabling the feature is the reliable declarative option. These CDEs only ever open the user's own GlueOps repos. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
On every codespace launch the workspace opens in Restricted Mode and VS Code blocks the terminal with:
This is VS Code Workspace Trust gating terminals/tasks in an untrusted folder (e.g.
/workspaces/glueops).Fix
Ship
"security.workspace.trust.enabled": falsein the image's Machine settings (Dockerfile L202), which already sets the color theme. This disables Workspace Trust entirely, so every folder opens trusted with no prompt.{"workbench.colorTheme": "VS Code Dark", "security.workspace.trust.enabled": false}Why disable, not pre-trust one folder
VS Code stores the trusted-folder list in SQLite global state (
state.vscdb), not insettings.json, and a freshly launched CDE doesn't carry it — so a specific folder can't be pre-trusted declaratively. Disabling the feature is the only reliable image-level option.Trade-off
Workspace Trust exists to stop a maliciously-crafted repo from auto-executing code on open. Turning it off globally means any folder opened in these CDEs runs fully trusted. Acceptable here since these ephemeral environments only ever open the user's own GlueOps repos.
Independent of #519 (the
codeCLI wrapper); both touch.devcontainer/DockerfileL202 but different lines.🤖 Generated with Claude Code