Linux agent sandboxing broken when `allowNetwork` mode is set
@dileepyavan is already working on this.
Since Jun 8, 2026.
Assessment
This issue has not been assessed yet.
Description
While verifying https://github.com/microsoft/vscode/issues/314041 I discovered filesystem isolation does not appear to be enforced when chat.agent.sandbox.enabled is set to allowNetwork.
Does this issue occur when all extensions are disabled?: Yes
- VS Code Version: Latest Insiders
- OS Version: Bluefin / Fedora Silverblue
Steps to Reproduce:
- Potentially install required OS dependencies (such as
bubblewrap) to ensure sandboxing works. Copilot can help verify/fix this. - Create a test workspace:
mkdir ~/vscode-sandbox-workspace - Create a file outside of the workspace:
echo "You should not be able to see this!" > ~/vscode-sandbox-outside-read-test.txt - Add the following settings (JSON):
{
"chat.agent.sandbox.enabled": "allowNetwork",
"chat.agent.sandbox.allowUnsandboxedCommands": false,
"chat.agent.sandbox.fileSystem.linux": {
"denyRead": ["~"],
"allowRead": ["~/vscode-sandbox-workspace"],
"allowWrite": ["~/vscode-sandbox-workspace"],
"denyWrite": []
}
}
- Start a new chat thread and send the following prompts one after the next:
Prompt #1:
curl -sS -L -o /dev/null -w 'status=%{http_code} final_url=%{url_effective}\n' https://microsoft.com
Expected result:
status=200 final_url=https://www.microsoft.com/
Prompt #2:
echo "Reads and writes inside workspace work!" > ./sandbox-write-test.txt && cat ./sandbox-write-test.txt
Expected result:
Reads and writes inside workspace work!
Prompt #3:
cat ~/vscode-sandbox-outside-read-test.txt 2>&1; echo exit=$?
Expected result:
You should not be able to see this!
exit=0
Conclusion:
- ✅ Good: The
allowNetworkbehavior should work. Outbound network access should succeed without configuring allowed domains. - ✅ Good: Workspace reads and writes should work since we explicitly allowed them in settings JSON.
- ❌ Bad: Filesystem isolation is not enforced.
- The
~/vscode-sandbox-outside-read-test.txtfile is still readable despitedenyRead: ["~"], explicit workspace allow rules, andchat.agent.sandbox.allowUnsandboxedCommands: false.
- The
- Dominant language
- TypeScript
- Stars
- 193k
- Forks
- 42.9k
- PR merge metrics
- PR metrics pending
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from microsoft/vscode
-
testplan-item
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
new release
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
testplan-item
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
testplan-item
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
All issues in microsoft/vscode
Similar issues
-
clawsweeper:fix-shape-clear clawsweeper:queueable-fix clawsweeper:source-repro impact:ux-friction issue-rating: 🦞 diamond lobster no-stale P3
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Difficulty 1/5 Under an hour Newbie friendliness 76/100
-
code-quality refactoring
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
github/gh-aw-firewall#8816 ·
-
integration:quickjs org:external priority:backlog topic:code-interpreter topic:middleware type:feature
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
langchain-ai/deepagents#6450 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
vercel/react-tweet#225 ·