Repository navigation
Canvases: Gate project canvas extensions on workspace trust - #342372
Merged
Merged
Conversation
Co-authored-by: Copilot App <[email protected]> Copilot-Session: b480cb8d-9ac1-41ba-a19a-2687b95e08d8
Contributor
Author
|
Copilot review |
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Unresolved trust-boundary issues, remote trust handling, and integration fixture compatibility need correction.
4 open issues
What changed in this PR
This PR adds workspace-trust enforcement to Agent Host project canvas extension launches, leaving user and plugin sources unchanged.
Changes:
- Deny project extension launches when trust is missing or ungranted.
- Preserve launches when Workspace Trust is disabled.
- Add tests covering trust states and launch admission.
| File | Description |
|---|---|
| src/vs/platform/agentHost/test/node/copilotAgent.test.ts | Adds trust and admission regression coverage. |
| src/vs/platform/agentHost/node/copilot/copilotAgent.ts | Checks workspace trust before launching project extensions. |
Review effort: Balanced
Co-authored-by: Copilot App <[email protected]> Copilot-Session: b480cb8d-9ac1-41ba-a19a-2687b95e08d8
Co-authored-by: jruales <[email protected]>
Contributor
Co-authored-by: Copilot App <[email protected]> Copilot-Session: b480cb8d-9ac1-41ba-a19a-2687b95e08d8
Co-authored-by: Copilot App <[email protected]> Copilot-Session: b480cb8d-9ac1-41ba-a19a-2687b95e08d8
Co-authored-by: Copilot App <[email protected]> Copilot-Session: b480cb8d-9ac1-41ba-a19a-2687b95e08d8
Co-authored-by: Copilot App <[email protected]> Copilot-Session: b480cb8d-9ac1-41ba-a19a-2687b95e08d8
Co-authored-by: Copilot App <[email protected]> Copilot-Session: b480cb8d-9ac1-41ba-a19a-2687b95e08d8
Co-authored-by: Copilot App <[email protected]> Copilot-Session: b480cb8d-9ac1-41ba-a19a-2687b95e08d8
Co-authored-by: Copilot App <[email protected]> Copilot-Session: b480cb8d-9ac1-41ba-a19a-2687b95e08d8
Co-authored-by: Copilot App <[email protected]> Copilot-Session: b480cb8d-9ac1-41ba-a19a-2687b95e08d8
Co-authored-by: Copilot App <[email protected]> Copilot-Session: b480cb8d-9ac1-41ba-a19a-2687b95e08d8
Joaquín Ruales (jruales)
marked this pull request as ready for review
October 19, 2026 18:50
Dmitriy Vasyura (dmitrivMS)
approved these changes
Oct 19, 2026
Joaquín Ruales (jruales)
added a commit
that referenced
this pull request
Oct 20, 2026
…342684) <!-- Thank you for submitting a Pull Request. Please: * Read our Pull Request guidelines: https://github.com/microsoft/vscode/wiki/How-to-Contribute#pull-requests * Associate an issue with the Pull Request. * Ensure that the code is up-to-date with the `main` branch. * Include a description of the proposed changes and how to test them. --> Reverts #342372 in full, restoring the project canvas extension launch and workspace trust behavior that existed before that change. Validation: - `npm run build-fast -- --client-only` — passed - `npm run typecheck-client` — passed - changed-TypeScript ESLint — passed - `./scripts/test.sh --run src/vs/platform/agentHost/test/node/copilotAgent.test.ts --run src/vs/platform/agentHost/test/electron-browser/agentHostProtocolClient.test.ts --run src/vs/workbench/services/workspaces/test/common/workspaceTrust.test.ts --run src/vs/platform/agentHost/test/node/agentHostSessionStateOwnershipGuard.test.ts` — 1,158 passing, 1 pending - `./scripts/test-integration.sh --run src/vs/platform/agentHost/test/node/providerIntegration/copilotMockLlm.integrationTest.ts` — 7 passing *🤖 Written by GitHub Copilot on behalf of @jruales.*
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.


Project Copilot extensions can execute code to contribute canvases, but their launch path previously checked only that the extension was located under an active working directory. This allowed project extensions to launch while the workspace was untrusted.
This change gates project extension launches on the Agent Host workspace trust configuration. Project extension paths, admitted roots, and trusted roots are canonicalized to the same filesystem identity; trust, containment, and admission are revalidated after asynchronous resolution. Missing trust configuration and untrusted workspaces fail closed, while Workspace Trust disablement and explicit remote or cloud-sandbox connection-authority trust preserve expected launches. Structurally validated VS Code isolated worktrees inherit project-extension launch trust from a currently trusted base repository, with revocation rechecked at launch and a canonical directory/repository grant persisted across first send, eager peers, moves, rollback, and runtime resume/restart. User and plugin extension sources are unchanged.
The project-extension authorization logic is isolated in
CopilotProjectExtensionLaunchPolicy, uses a singular domain-named trust grant, and has focused policy tests. Related project/trust metadata is persisted atomically through the existing session metadata path.Validation:
npm run build-fast -- --client-only— passednpm run typecheck-client— passednpm run valid-layers-check— passed./scripts/test.sh --run src/vs/platform/agentHost/test/node/copilotProjectExtensionLaunchPolicy.test.ts --run src/vs/platform/agentHost/test/node/copilotAgent.test.ts --run src/vs/platform/agentHost/test/node/agentHostSessionStateOwnershipGuard.test.ts— 837 passing, 1 pending./scripts/test.sh --run src/vs/platform/agentHost/test/electron-browser/agentHostProtocolClient.test.ts --run src/vs/platform/agentHost/test/electron-browser/sshRemoteAgentHostService.test.ts --run src/vs/platform/agentHost/test/electron-browser/wslRemoteAgentHostService.test.ts --grep "workspace trust|SSHRemoteAgentHostService lifecycle|WSLRemoteAgentHostService"— 29 passing./scripts/test.sh --run src/vs/workbench/contrib/chat/test/browser/agentSessions/agentHostChatContribution.test.ts— 704 passing./scripts/test-integration.sh --run src/vs/platform/agentHost/test/node/providerIntegration/copilotMockLlm.integrationTest.ts --grep "loads a project extension through the client-resolved SDK before the model opens its canvas and projects extension-started turns"— 1 passing🤖 Written by GitHub Copilot on behalf of Joaquín Ruales (@jruales).