feat(sandbox): add configurable writable paths option - #11995
Conversation
Add experimental.sandbox_writable_paths config option that allows users to specify additional filesystem paths the sandbox permits writes to. These paths are merged with the default writable paths when the sandbox is active. CLI: new config field + policy integration VS Code: list input UI in the Sandboxing settings tab
Code Review SummaryStatus: 4 Issues Found | Recommendation: Address before merge Overview
Issue Details (click to expand)WARNING
SUGGESTION
Resolved since last review: the Files Reviewed (2 files)
Fix these issues in Kilo Cloud Previous Review Summary (commit 889e2f4)Current summary above is authoritative. Previous snapshots are kept for context only. Previous review (commit 889e2f4)Status: 4 Issues Found | Recommendation: Address before merge Overview
Issue Details (click to expand)WARNING
SUGGESTION
Resolved since last review: the Files Reviewed (2 files)
Reviewed by claude-sonnet-5-20260630 · Input: 32 · Output: 10.3K · Cached: 832K Review guidance: REVIEW.md from base branch |
|
Hi @trim21 very cool! We wanted to add this (including a similar pattern for the network sandbox) anyway. We should fix the 1.
|
|
ignore sandbox_writable_paths from workspace make sence as a sandbox config |
…g only - Expand leading ~ to os.homedir() in execute() before passing paths to the sandbox profile, so ~/tmp resolves correctly. - Strip sandbox_writable_paths from project-scoped config overlays. A repo kilo.json must not be able to widen the sandbox beyond the user's global config intent.
Co-authored-by: kilo-code-bot[bot] <240665456+kilo-code-bot[bot]@users.noreply.github.com>
9b258c5 to
af6bbd8
Compare
|
I tested this, works great. The input field is a bit small for most paths don't you think? And it doesn't have any tests currently. But I will merge anyway and we can iterate later. Thanks for that! |
…aths feat(sandbox): add configurable writable paths option
Add
experimental.sandbox_writable_pathsconfig option that allows users to specify additional filesystem paths the sandbox permits writes to (e.g./tmp,/var/log,~/.cache). These paths are merged with the default writable paths when the sandbox is active.Changes
CLI (
packages/opencode/)src/config/config.ts— newexperimental.sandbox_writable_pathsfield (string[])src/kilocode/sandbox/policy.ts—profile()accepts extra writable paths,execute()reads from configVS Code (
packages/kilo-vscode/)webview-ui/src/types/messages/config.ts— addedsandbox_writable_pathstoExperimentalConfigwebview-ui/src/i18n/en.ts— i18n keys for the new settingwebview-ui/src/components/settings/SandboxingTab.tsx— list input UI (add/remove paths)Usage
{ "experimental": { "sandbox": true, "sandbox_writable_paths": ["/tmp", "/var/log"] } }