You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Sandbox blocks canvas extension from writing its private state #348764
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
Load a canvas extension that saves private state.
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.
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.
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.
Activity
ulugbekna commentedon Nov 23, 2026
Reopening: the fix in #348961 works only when the
extension-datafolder already exists. On a fresh Copilot home, the first save still fails withEPERM.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: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
.tmpfile, then rename it). I confirmed the extension process was sandboxed in each run.EPERM(the original bug)EPERMonmkdir extension-dataSuggested 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
0d15d4d).buildSandboxConfigForSdk, with and without the new extension-data grant. Extensions were launched through the same bootstrap the agent host uses.🤖 Written by GitHub Copilot on behalf of Ulugbek Abdullaev (@ulugbekna).