feat(sandbox): prototype Windows process confinement#11589
Draft
marius-kilocode wants to merge 2 commits into
Draft
feat(sandbox): prototype Windows process confinement#11589marius-kilocode wants to merge 2 commits into
marius-kilocode wants to merge 2 commits into
Conversation
760e27b to
2465164
Compare
NJ-2020
pushed a commit
to NJ-2020/kilocode
that referenced
this pull request
Jul 4, 2026
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.
Windows currently reports process confinement as unavailable even when the experimental sandbox is enabled, so model-originated commands cannot consume the OS-neutral write profile on native Windows.
This draft prototypes a Kilo-owned native helper that translates the normalized filesystem profile into a write-restricted token, root-specific restricting SIDs and NTFS ACLs. It launches a target suspended inside a kill-on-close Job Object with an explicit inherited-handle list. The TypeScript backend remains a command wrapper, preserving the same tool-independent integration used by Seatbelt. Unsupported filesystems, missing helpers and setup failures remain fail-closed.
The first boundary deliberately targets local fixed NTFS volumes and protects existing nested deny paths such as
.git. It does not add network enforcement or claim support for UNC, WSL, ReFS, Dev Drive, unknown reparse layouts or ambiguous hard links.This remains a proof of concept rather than a distributable Windows backend. The helper is built only for the Windows integration gate and is not yet placed into CLI or VSIX artifacts. The minimal native
cmd.exepath demonstrates selected writes and nested denial, but PowerShell currently cannot initialize the CLR with the deliberately narrow restricting-SID set. That compatibility/security tradeoff, ACL lifecycle recovery, broader escape coverage, arm64 execution, packaging and signing remain release blockers tracked by #11542.