feat(exec): add command_wrapper for sandbox support#2684
Draft
chengyongru wants to merge 1 commit intomainfrom
Draft
feat(exec): add command_wrapper for sandbox support#2684chengyongru wants to merge 1 commit intomainfrom
chengyongru wants to merge 1 commit intomainfrom
Conversation
Allow users to wrap shell commands in a sandbox (e.g. bubblewrap,
firejail, nsjail) via config, without nanobot baking in any sandbox
backend. The template supports {command} and {cwd} placeholders with
plain string replacement.
Collaborator
Author
|
mark: #1940 |
|
Hi @chengyongru, I built Zerobox which is a cross platform process sandboxing written in Rust: https://github.com/afshinm/zerobox. Would it be possible to have Zerobox as an example as well? I'm more than happy to add |
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
tools.exec.commandWrapperconfig option to wrap shell commands in a user-defined template before execution{command}and{cwd}placeholders with plain string replacementdocs/COMMAND_WRAPPER.mdwith sandbox examples (bubblewrap, firejail, nsjail) and caveatsTest plan
test_exec_command_wrapper_applied— wrapper correctly wraps commandtest_exec_command_wrapper_with_cwd—{cwd}substituted with absolute pathtest_exec_command_wrapper_empty_noop— empty string is backward compatibletest_exec_command_wrapper_guard_runs_before_wrapper— guard runs before wrappertest_exec_command_wrapper_ignores_unknown_placeholders— no KeyError on typostest_exec_command_wrapper_does_not_leak_attributes— no Python introspectiontest_tool_validation.pypass