Skip to content

fix(clawdbot): enable noSandbox for browser on Linux - #560

Merged
shunkakinoki merged 1 commit into
mainfrom
fix/clawdbot-browser-no-sandbox
Jan 12, 2026
Merged

fix(clawdbot): enable noSandbox for browser on Linux#560
shunkakinoki merged 1 commit into
mainfrom
fix/clawdbot-browser-no-sandbox

Conversation

@shunkakinoki

@shunkakinoki shunkakinoki commented Jan 12, 2026

Copy link
Copy Markdown
Owner

Summary

Enable `noSandbox = true` for the Chromium browser on Linux to fix browser startup failures.

Problem

Chromium's SUID sandbox requires the sandbox binary to be owned by root with mode 4755:
```
The SUID sandbox helper binary was found, but is not configured correctly.
/nix/store/.../chromium-sandbox/bin/__chromium-suid-sandbox needs to be owned by root with mode 4755
```

This isn't the case with Nix-installed Chromium.

Solution

Add `noSandbox = true` to the browser config on Linux. This disables the SUID sandbox and allows headless browsing to work.

Trade-off

Running without the SUID sandbox is slightly less secure, but acceptable for a headless browser used for web searches.


Summary by cubic

Enable noSandbox=true for Chromium on Linux to bypass the SUID sandbox requirement in Nix and fix headless browser startup failures. Restores Clawdbot’s headless browsing on Linux, with the trade-off of disabling the SUID sandbox.

Written for commit 86b067f. Summary will update on new commits.

Copilot AI review requested due to automatic review settings January 12, 2026 14:26
@coderabbitai

coderabbitai Bot commented Jan 12, 2026

Copy link
Copy Markdown

Caution

Review failed

The pull request is closed.

📝 Walkthrough

Summary by CodeRabbit

Release Notes

  • Chores
    • Modified Chromium browser sandbox configuration on Linux systems. Runtime behavior and system interaction parameters have been adjusted, affecting how the browser operates during execution.

✏️ Tip: You can customize this high-level summary in your review settings.

Walkthrough

The change adds a noSandbox configuration option to the Chromium browser settings in the clawdbot home-manager module for Linux systems, disabling the browser sandbox in the configuration overrides alongside the existing executablePath setting.

Changes

Cohort / File(s) Summary
Chromium sandbox configuration
home-manager/modules/clawdbot/default.nix
Added noSandbox = true to the browser configOverrides for the default instance on Linux, disabling Chromium's sandbox mode

Possibly related PRs

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

🐰 One sandbox falls away so free,
The chromium bounds now let it be,
A single line of config true,
Where noSandbox = true shines through! ✨

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/clawdbot-browser-no-sandbox

📜 Recent review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 8dab6c6 and 86b067f.

📒 Files selected for processing (1)
  • home-manager/modules/clawdbot/default.nix

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @shunkakinoki, 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 resolves a browser startup failure on Linux for the clawdbot module. The core issue stemmed from Chromium's SUID sandbox requiring specific file permissions that are not inherently met by Nix-installed Chromium. The solution involves configuring the browser to run without the SUID sandbox when on Linux, ensuring functionality while accepting a minor, justified security trade-off for its intended headless use case.

Highlights

  • Problem Resolution: Addresses an issue where the Chromium browser failed to start on Linux due to SUID sandbox requirements not being met by Nix-installed Chromium.
  • Configuration Change: Enables noSandbox = true for the Chromium browser configuration specifically on Linux systems.
  • Security Trade-off: Acknowledges a slight reduction in security by disabling the SUID sandbox, but deems it acceptable for a headless browser used for web searches.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@mesa-dot-dev

mesa-dot-dev Bot commented Jan 12, 2026

Copy link
Copy Markdown

Mesa Description

TL;DR

Enable noSandbox = true for the Chromium browser on Linux to fix browser startup failures.

What changed?

File summaries are not available. The change involves adding noSandbox = true to the browser configuration on Linux.

Description generated by Mesa. Update settings

The Chromium SUID sandbox requires the sandbox binary to be owned by
root with mode 4755, which isn't the case in Nix. Enable noSandbox
to allow headless browsing without the SUID sandbox.
@shunkakinoki
shunkakinoki merged commit be41054 into main Jan 12, 2026
30 of 31 checks passed
@shunkakinoki
shunkakinoki deleted the fix/clawdbot-browser-no-sandbox branch January 12, 2026 14:26

@mesa-dot-dev mesa-dot-dev Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Performed full review of 8dab6c6...86b067f

Analysis

  1. Security Downgrade Without Opt-In: Chromium's sandbox is unconditionally disabled on Linux, removing a critical security layer without making this configurable. A compromised browser now has full access to clawdbot's user account, credentials, and secrets.

  2. Platform-Specific Security Divergence: The change creates an undocumented security divergence between Linux and other platforms, embedding a significant security decision directly in the shared module rather than exposing it as a configurable option.

  3. Global Application vs. Targeted Fix: The security weakening applies to all Linux deployments regardless of whether they could support proper SUID sandbox configuration, when a more targeted approach (runtime detection or host-specific configuration) would maintain security where possible.

  4. Missing Alternative Protections: No documentation or implementation of compensating security controls (like bubblewrap or systemd confinement) is provided to mitigate the increased risk from disabling the browser sandbox.

Tip

Help

Slash Commands:

  • /review - Request a full code review
  • /review latest - Review only changes since the last review
  • /describe - Generate PR description. This will update the PR body or issue comment depending on your configuration
  • /help - Get help with Mesa commands and configuration options

0 files reviewed | 1 comments | Edit Agent SettingsRead Docs

}
// lib.optionalAttrs pkgs.stdenv.isLinux {
executablePath = "${pkgs.chromium}/bin/chromium";
noSandbox = true; # SUID sandbox requires root-owned binary with mode 4755

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Medium

Unconditionally disabling the Chromium sandbox on all Linux systems weakens browser isolation even on hosts where the SUID sandbox could be properly configured. Consider making this configurable via a module option like clawdbot.browser.noSandbox (defaulting to false) so that:

  1. The security trade-off is explicit in host configurations
  2. Only hosts that truly need it opt into the weaker security posture
  3. Future Nix updates that fix the SUID sandbox permissions can benefit automatically

Alternatively, implement runtime detection to check if ${pkgs.chromium}/libexec/chrome-sandbox has proper permissions before disabling the sandbox, so only broken environments bypass it.

Agent: 🏛 Architecture • Fix in Cursor • Fix in Claude

Prompt for Agent
Task: Address review feedback left on GitHub.
Repository: shunkakinoki/dotfiles#560
File: home-manager/modules/clawdbot/default.nix#L75
Action: Open this file location in your editor, inspect the highlighted code, and resolve the issue described below.

Feedback:
Unconditionally disabling the Chromium sandbox on all Linux systems weakens browser isolation even on hosts where the SUID sandbox could be properly configured. Consider making this configurable via a module option like `clawdbot.browser.noSandbox` (defaulting to `false`) so that:

1. The security trade-off is explicit in host configurations
2. Only hosts that truly need it opt into the weaker security posture
3. Future Nix updates that fix the SUID sandbox permissions can benefit automatically

Alternatively, implement runtime detection to check if `${pkgs.chromium}/libexec/chrome-sandbox` has proper permissions before disabling the sandbox, so only broken environments bypass it.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request enables the noSandbox option for Chromium on Linux to address browser startup issues. The change itself is correct for the stated purpose. However, I've noticed a potential structural issue in how the Linux-specific browser options are being configured. The executablePath and the new noSandbox option are being merged at the top level of configOverrides, rather than within the browser attribute set. This is likely incorrect and could prevent the settings from being applied properly. I've left a suggestion to refactor this to ensure the browser configuration is structured correctly.

Comment on lines 72 to 77
}
// lib.optionalAttrs pkgs.stdenv.isLinux {
executablePath = "${pkgs.chromium}/bin/chromium";
noSandbox = true; # SUID sandbox requires root-owned binary with mode 4755
};
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

The current structure merges executablePath and noSandbox into configOverrides at the top level, alongside browser. It's more conventional and likely correct for these browser-specific settings to be nested within the browser attribute set. This refactoring moves the Linux-specific browser attributes into the browser block, improving the configuration's clarity and correctness.

        } // lib.optionalAttrs pkgs.stdenv.isLinux {
          executablePath = "${pkgs.chromium}/bin/chromium";
          noSandbox = true; # SUID sandbox requires root-owned binary with mode 4755
        };
      }

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes Chromium browser startup failures on Linux by disabling the SUID sandbox requirement that cannot be satisfied with Nix-installed Chromium.

Changes:

  • Added noSandbox = true to the browser configuration for Linux systems to work around SUID sandbox permissions issues

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

}
// lib.optionalAttrs pkgs.stdenv.isLinux {
executablePath = "${pkgs.chromium}/bin/chromium";
noSandbox = true; # SUID sandbox requires root-owned binary with mode 4755

Copilot AI Jan 12, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Setting noSandbox = true on Linux disables Chromium’s main security sandbox, so a malicious or compromised website loaded by this headless browser could escalate directly to arbitrary code execution with the full privileges of the clawdbot process and its user account. Instead of disabling the sandbox entirely, ensure the Chromium SUID helper is installed/configured correctly or run this browser inside an additional isolation boundary (e.g., container, separate low-privilege user/namespace) so that Chromium’s own sandbox can remain enabled.

Suggested change
noSandbox = true; # SUID sandbox requires root-owned binary with mode 4755
# Rely on Chromium's default sandboxing for security; ensure the
# SUID sandbox helper is installed/configured correctly on the host
# instead of disabling it with `noSandbox = true`.

Copilot uses AI. Check for mistakes.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 1 file

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants