Skip to content

Canvases: Gate project canvas extensions on workspace trust - #342372

Merged
Joaquín Ruales (jruales) merged 23 commits into
mainfrom
jruales-canvas-workspace-trust
Oct 19, 2026
Merged

Joaquín Ruales (jruales) merged 23 commits into
mainfrom
jruales-canvas-workspace-trust

Conversation

@jruales

@jruales Joaquín Ruales (jruales) commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

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 — passed
  • npm run typecheck-client — passed
  • changed-file ESLint — passed
  • npm 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).

Co-authored-by: Copilot App <[email protected]>

Copilot-Session: b480cb8d-9ac1-41ba-a19a-2687b95e08d8
Copilot AI balanced review requested due to automatic review settings October 18, 2026 07:38
@jruales

Copy link
Copy Markdown
Contributor Author

Copilot review

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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

Copilot AI commented Oct 18, 2026

Copy link
Copy Markdown
Contributor

Copilot review

Addressed in f4dc2fe: canonicalized and revalidated project-extension trust/admission, mirrored effective remote-authority trust, and updated the integration fixture to restore trust state. Focused unit and integration tests pass.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Trusted empty remote windows can incorrectly grant authority-wide trust and bypass project execution gates.

1 open issue
4 resolved since last review

Review effort: Balanced

Co-authored-by: Copilot App <[email protected]>

Copilot-Session: b480cb8d-9ac1-41ba-a19a-2687b95e08d8

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Registered cloud-sandbox authority trust is not forwarded, blocking project canvases in otherwise trusted sandboxes.

1 open issue
1 resolved since last review

Review effort: Balanced

Co-authored-by: Copilot App <[email protected]>

Copilot-Session: b480cb8d-9ac1-41ba-a19a-2687b95e08d8

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Security-sensitive filesystem authorization and cross-host trust propagation warrant final human review.

No open issues 🎉

1 resolved since last review

Review effort: Balanced

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

New isolated worktrees load project extensions before inherited trust is available, blocking initial canvas loading from trusted repositories.

1 open issue

Review effort: Balanced

Co-authored-by: Copilot App <[email protected]>

Copilot-Session: b480cb8d-9ac1-41ba-a19a-2687b95e08d8

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

The code-execution trust boundary needs human security review, including correction and validation of canonical worktree inheritance.

1 open issue
1 resolved since last review

Review effort: Balanced

Co-authored-by: Copilot App <[email protected]>

Copilot-Session: b480cb8d-9ac1-41ba-a19a-2687b95e08d8
@jruales
Joaquín Ruales (jruales) requested a balanced review from Copilot October 18, 2026 09:14
Co-authored-by: Copilot App <[email protected]>

Copilot-Session: b480cb8d-9ac1-41ba-a19a-2687b95e08d8

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

A trust-grant rebinding vulnerability and a project-resolution regression remain unresolved.

2 open issues

Review effort: Balanced

Co-authored-by: Copilot App <[email protected]>

Copilot-Session: b480cb8d-9ac1-41ba-a19a-2687b95e08d8

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Security-sensitive trust inheritance and persistence across session lifecycles warrant final human validation.

2 open issues

Review effort: Balanced

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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Security-sensitive launch authorization and persisted worktree trust across session lifecycles warrant final human review.

No open issues 🎉

2 resolved since last review

Review effort: Balanced

@jruales
Joaquín Ruales (jruales) marked this pull request as ready for review October 19, 2026 18:50
@jruales
Joaquín Ruales (jruales) merged commit ba66f14 into main Oct 19, 2026
49 checks passed
@jruales
Joaquín Ruales (jruales) deleted the jruales-canvas-workspace-trust branch October 19, 2026 19:18
@jruales Joaquín Ruales (jruales) added the ~release-cherry-pick Trigger: cherry-pick this PR to the latest release branch label Oct 19, 2026
@vs-code-engineering vs-code-engineering Bot added this to the 1.143.0 milestone Oct 19, 2026
@vs-code-engineering vs-code-engineering Bot added release-cherry-pick Automated cherry-pick between release and main branches and removed ~release-cherry-pick Trigger: cherry-pick this PR to the latest release branch labels Oct 19, 2026
@jruales Joaquín Ruales (jruales) removed the release-cherry-pick Automated cherry-pick between release and main branches label Oct 20, 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.*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants