kimi-code icon indicating copy to clipboard operation
kimi-code copied to clipboard

Sandbox writes to project dir by default

Open jbellis opened this issue 4 months ago • 2 comments

What feature would you like to see?

Sandboxing writes would limit the blast radius of Auto/YOLO permissions.

Additional information

No response

jbellis avatar Jul 17 '26 15:07 jbellis

I've opened PR #1934 implementing this: an optional [sandbox] config section that runs Bash commands under an OS-level sandbox (bubblewrap on Linux, sandbox-exec on macOS) — workspace-only writes in workspace-write mode, deny_read masking for sensitive paths (ssh keys, .env, credentials), and network off by default — plus matching permission policies so file tools get hard denies and outside-workspace asks.

One design point worth maintainer input: the issue title asks for sandboxing by default, while the PR ships it opt-in (enabled = false) as a conservative first step (fail-open when bwrap/sandbox-exec is unavailable, so nothing breaks on hosts without it). Happy to flip the default or add an onboarding prompt in a follow-up if that's the preferred direction.

xuwenhao avatar Jul 23 '26 07:07 xuwenhao

#4115 implements this: an experimental [sandbox] config section with workspace-write (default when enabled) / read-only / danger-full-access modes — commands spawned via the Bash tool run inside macOS Seatbelt or Linux bwrap, so writes outside the workspace fail at the OS level even under Auto/YOLO. Off by default behind KIMI_CODE_EXPERIMENTAL_SANDBOX; context in #4114.

Ram-Pavith avatar Oct 03 '26 08:10 Ram-Pavith