fix(sandbox): prevent config self-disable - #11703
Merged
Merged
Conversation
Contributor
Code Review SummaryStatus: 1 Issue Found | Recommendation: Address before merge Overview
Issue Details (click to expand)WARNING
Fix these issues in Kilo Cloud Files Reviewed (5 files)
Previous Review Summaries (2 snapshots, latest commit 801f8ff)Current summary above is authoritative. Previous snapshots are kept for context only. Previous review (commit 801f8ff)Status: 1 Issue Found | Recommendation: Address before merge Overview
Issue Details (click to expand)WARNING
Fix these issues in Kilo Cloud Files Reviewed (6 files)
Previous review (commit 0c237da)Status: 1 Issue Found | Recommendation: Address before merge Overview
Issue Details (click to expand)WARNING
Fix these issues in Kilo Cloud Files Reviewed (18 files)
Reviewed by gpt-5.4-20260305 · Input: 67.5K · Output: 10.6K · Cached: 239.4K Review guidance: REVIEW.md from base branch |
RSO
approved these changes
Jun 26, 2026
11 tasks
t7tran
pushed a commit
to t7tran/kilocode
that referenced
this pull request
Aug 14, 2026
…lf-disable fix(sandbox): prevent config self-disable
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A sandbox policy was previously derived from the live effective configuration each time a model tool ran. That configuration is intentionally writable so agents can make normal project changes, and Kilo resolves it from several locations, including the primary
kilo.json[c]files, ancestor and repository configuration, global configuration, configured override directories, and legacy OpenCode-compatible files.This made the sandbox configuration part of the authority it was supposed to constrain. A confined agent could change an effective config source to set
experimental.sandboxorexperimental.sandbox_restrict_networkto a weaker value, wait for config invalidation or reload, and then use a later shell, web, MCP, fork, or delegated task invocation with more authority. Replacing or renaming config files, resolving config indirectly, or resuming work through a child session created equivalent paths. Restarting the backend also allowed a resumed session to initialize from the modified configuration.This change moves confinement authority out of live model-writable configuration and into persistent session policy state.
The local server is another possible route around a file-based fix. If a sandboxed process can discover server credentials or reach an unauthenticated local control plane, it could request the same trusted toggle that the UI uses. To close that path:
KILO_SERVER_PASSWORDorKILO_SERVER_USERNAME;{env:...}references;{file:...}substitution opens and validates one file descriptor before reading, preventing direct, symlinked, and path-swap access to/proc/.../environ;The primary configuration scenario is a project-local
kilo.jsonorkilo.jsonc. Legacy OpenCode-compatible files remain accepted inputs, but they do not receive special authority and are covered by the same source-independent snapshot boundary. No legacy file is created as part of policy persistence.The practical result is that configuration remains editable data, not a model-controlled capability switch. An agent can modify
kilo.jsonas part of normal repository work, but that write cannot increase the authority of the active session or any delegated work derived from it.Closes #11624