Repository navigation
feat(sandbox): per-server profiles and tole sandbox list|show|set (#810) - #821
Merged
Merged
Conversation
What Named sandbox profiles and per-server bindings in the user config, with tole sandbox list, show and set. Why Second slice of #750: grants should be declared once as a profile and referenced by server name, and the owner needs a way to inspect and change a binding without hand-editing, while a project config can still never loosen the sandbox. Changes - [sandbox.profiles.<name>] (workspace, network, read, write) and [sandbox.servers.<name>] profile; [sandbox] profile may name a defined profile. server and strict stay built in. - tole_core::sandbox: Policy.servers and Policy::profile_for; a launch uses the server's own profile (grants re-checked per launch as before). - tole sandbox list|show <server>|set <server> --profile <p>: reads and writes the user config only, keeps the rest of the file, re-parses and refuses an edit that changes anything but the binding, owner-only (refuses under an agent session). - tole config check prints the effective profile of the default and of each bound server with its source; project sandbox lines stay IGNORED. - docs/sandbox-design.md section 6.1, epics, README, CHANGELOG. Testing Core unit tests for profile_for and per-server argv; config tests for parsing, bad values naming the key, user-only layering and effective source; tole-cli integration tests (tests/sandbox_cli.rs) on the real binary with TestDir; cargo fmt, clippy --workspace --all-targets --all-features -D warnings, tests of tole-core and tole-cli, and the --no-default-features profiles. Closes #810
🔍 Cora AI Code Review✅ No issues found. Code looks good! Review powered by cora-code · BYOK · MIT |
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.
What
Named sandbox profiles and per-server bindings in the user config, with
tole sandbox list,showandset. Second slice of #750.Why
Grants should be declared once as a profile and referenced by server name. The owner needs a way to inspect and change a binding without hand-editing the file. A project config must still never loosen the sandbox.
Changes
[sandbox.profiles.<name>](workspace,network,read,write) and[sandbox.servers.<name>] profile.[sandbox] profilemay name a defined profile.serverandstrictstay built in and cannot be redefined.tole_core::sandbox:Policy.serversandPolicy::profile_for. A launch uses the server's own profile, and its grants are re-checked at each launch as before. The doctor grant lines from feat(sandbox): tole doctor lists the sensitive grants of each sandboxed server and logs the sandbox decision at startup (#750 part 1) #809 follow the server's own profile.tole sandbox list|show <server>|set <server> --profile <p>reads and writes the user config only.setkeeps the rest of the file, re-parses the result and refuses any edit that changes more than the binding. It refuses under an agent session (security(trust): owner-only trust records can be written by the agent (tole CLI from run_command, file tools when the workspace holds the data dir) #684).--profileis the global tole flag; fortole sandboxit names the sandbox profile.tole config checkprints the effective profile of the default and of each bound server with its source. A project config's sandbox lines stayIGNORED.docs/sandbox-design.mdsection 6.1, epics, README, CHANGELOG.mode, and the profile hash in the lock entry. These are noted in the design doc.Testing
profile_for, per-server argv and the doctor lines.tole-cliintegration tests (tests/sandbox_cli.rs) on the real binary, usingTestDir.cargo fmt,clippy --workspace --all-targets --all-features -D warnings, tests oftole-coreandtole-cli, and the--no-default-featuresprofiles.scripts/review-local.sh): no findings. No LLM was configured here, so only the deterministic checks ran.Closes #810