feat(cli): /sandbox on|off|toggle for runtime state change#202
Merged
emal-avala merged 1 commit intomainfrom Apr 23, 2026
Merged
feat(cli): /sandbox on|off|toggle for runtime state change#202emal-avala merged 1 commit intomainfrom
emal-avala merged 1 commit intomainfrom
Conversation
Extends the existing `/sandbox` command to accept a subcommand that
flips `config.sandbox.enabled` at runtime, no restart needed.
/sandbox show status (unchanged)
/sandbox on enable the sandbox
/sandbox off disable the sandbox
/sandbox toggle flip state
Alias `/sandbox-toggle` kept for name-parity with TS Claude Code.
Safety:
* When `security.disable_bypass_permissions` is set, `off` and
`toggle`-from-enabled are blocked with a clear message
* Enabling on a host with no working strategy (e.g. Linux without
bwrap set up) prints a ⚠ note so the user knows tools will
still run unsandboxed
* Status-display path (no args) unchanged
Change applies to *new* subprocess tool calls. In-flight bash calls
keep whatever policy they were launched with.
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
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.
Summary
Extends the existing
/sandboxcommand to accept a subcommand that flipsconfig.sandbox.enabledat runtime — no restart needed. Alias/sandbox-toggle.Why
Users run into a common workflow: start the REPL, hit repeated sandbox denials on a trusted workload, want to disable the sandbox for the remainder of the session. Previously required exiting and re-running with
--no-sandbox. Now a single command.Safety
security.disable_bypass_permissionsgate respected —offandtoggle-from-enabled are blocked with a clear message when the config flag is setbwrapset up) prints a ⚠ note so the user knows tools will still run unsandboxedZero-arg status-display path is unchanged (no-op subcommand).
Test plan
cargo fmt --all— cleancargo clippy --workspace --all-targets -- -D warnings— cleancargo test -p agent-code --test smoke— 4/4 pass/sandbox on→ enabled;/sandbox off→ disabled;/sandbox toggleflips; unknown subcommand prints usage