Linux sandbox bubblewrap#22680
Conversation
|
Hi @DavidAPierce, thank you so much for your contribution to Gemini CLI! We really appreciate the time and effort you've put into this. We're making some updates to our contribution process to improve how we track and review changes. Please take a moment to review our recent discussion post: Improving Our Contribution Process & Introducing New Guidelines. Key Update: Starting January 26, 2026, the Gemini CLI project will require all pull requests to be associated with an existing issue. Any pull requests not linked to an issue by that date will be automatically closed. Thank you for your understanding and for being a part of our community! |
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request introduces a new Linux sandbox manager that leverages Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
|
Size Change: +2.27 kB (+0.01%) Total Size: 26.2 MB
ℹ️ View Unchanged
|
There was a problem hiding this comment.
Code Review
This pull request introduces a Linux sandbox using bubblewrap. While this is a good step towards process isolation, the current implementation has significant security weaknesses. The sandbox configuration is overly permissive, allowing read-only access to the entire host filesystem and direct access to host devices. Additionally, all additional paths are mounted as read-write, violating the principle of least privilege, and the environment sanitization logic can be bypassed, potentially leaking sensitive host environment variables. These issues need to be addressed to ensure effective isolation, requiring differentiation between read-only and read-write paths and corresponding test updates.
…ewrap' into linux_sandbox_bubblewrap
Summary
Generates the bwrap CLI arguments to isolate the filesystem.
Details
Skeleton of the Linux sandbox bubblewrap to be used for future sandboxing efforts.
Structures the command by placing bwrap as the program and correctly segregating the sandboxed execution using -- command ...args.
Isolates / as read-only (--ro-bind / /), mount /dev (--dev-bind /dev /dev), and explicitly binds /dev/pts to enable node-pty
compatibility.
Mounts the workspace read/write (--bind ).
Applies the --unshare-all flag to drop all network, IPC, and PID namespaces.
Integrates sanitizeEnvironment using the request configuration, keeping the sandbox secure from leaked environment variables.
Related Issues
Fixes https://github.com/google-gemini/maintainers-gemini-cli/issues/1544
Pre-Merge Checklist