Skip to content

Sandbox blocks canvas extension from writing its private state #348764

Done

Description

Canvas extensions cannot save their private state when sandboxing is enabled. Observed with Chat progress: writing under <copilot-home>/extension-data/copilot-chat-progress/ fails with EPERM.

Steps to reproduce

  1. Load a canvas extension that saves private state.
  2. Enable sandboxing and trigger a state update.

Expected: The extension can write its own private state without access to other extensions' data.

Actual: Saving fails with a permission error.

Environment, error, and related fix
  • VS Code: 1.147.0-insider (95906867e0763b595ee0c8814ba93fea96798d3e)
  • OS: macOS 26.7.3, arm64
  • Feature: Agent Host SDK canvas extensions

Home directory and generated filename redacted:

[Chat progress canvas] EPERM: operation not permitted, open
'<copilot-home>/extension-data/copilot-chat-progress/<generated-name>.json.<uuid>.tmp'

On this older build, application read access was granted manually so the extension could start. #348433 fixes that application-read problem (#346105), but does not add write access to extension-owned private storage. This failure has not yet been retested on a build containing that fix.

🤖 Written by GitHub Copilot on behalf of Joaquín Ruales (@jruales).

Activity

  1. added
    bug
    on Nov 17, 2026
  2. added
    canvases
    on Nov 17, 2026
  3. ulugbekna commented on Nov 23, 2026

    @ulugbekna
    Contributor

    Reopening: the fix in #348961 works only when the extension-data folder already exists. On a fresh Copilot home, the first save still fails with EPERM.

    What works now

    When <COPILOT_HOME>/extension-data/ already exists, a sandboxed canvas extension can save its private state. It still can't write to or list the rest of the Copilot home, which is the intended boundary.

    What still fails

    On a fresh install, nothing creates <COPILOT_HOME>/extension-data/ beforehand. The sandbox grants write access only inside that folder, so it can't be created: that would need write access to its parent, the Copilot home, which is withheld on purpose. The extension's first save fails with:

    EPERM: operation not permitted, mkdir '<COPILOT_HOME>/extension-data'
    

    Users who already have the folder from earlier unsandboxed runs won't see this. New users who start with sandboxing on will.

    Results

    A canvas-style extension saved its state the same way Chat progress does (write a .tmp file, then rename it). I confirmed the extension process was sandboxed in each run.

    Setup Save own state Write elsewhere in Copilot home List Copilot home
    Before the fix, folder exists ❌ EPERM (the original bug) ❌ blocked ❌ blocked
    After the fix, folder exists ✅ saved ❌ blocked (expected) ❌ blocked (expected)
    After the fix, fresh Copilot home ❌ EPERM on mkdir extension-data ❌ blocked ❌ blocked

    Suggested fix

    Create <COPILOT_HOME>/extension-data/ before launching a sandboxed session that receives this grant. The sandbox policy doesn't need to change.

    How this was tested
    • macOS arm64, Copilot SDK 2.0.1 runtime, main at a commit that includes agentHost: grant sandbox write access to Canvas data #348961 (also in Insiders 0d15d4d).
    • The sandbox config came from the production buildSandboxConfigForSdk, with and without the new extension-data grant. Extensions were launched through the same bootstrap the agent host uses.
    • Each run used a new temporary Copilot home under the user's home directory, not the temp directory, because the sandbox makes the temp directory writable and that would hide the bug.
    • Not retested by clicking through the VS Code UI.

    🤖 Written by GitHub Copilot on behalf of Ulugbek Abdullaev (@ulugbekna).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bugcanvases

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions