Skip to content

fix: Sandbox Allow network bind for npx#151

Merged
Sahilb315 merged 2 commits intomainfrom
feat/sandbox-network-bind-support
Feb 4, 2026
Merged

fix: Sandbox Allow network bind for npx#151
Sahilb315 merged 2 commits intomainfrom
feat/sandbox-network-bind-support

Conversation

@abhisek
Copy link
Member

@abhisek abhisek commented Feb 4, 2026

  • feat: Add support for network bind
  • chore: Add comments for bwrap sandbox

Open with Devin

@codecov-commenter
Copy link

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 37.77%. Comparing base (f90fa0e) to head (8f27127).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #151      +/-   ##
==========================================
+ Coverage   37.73%   37.77%   +0.03%     
==========================================
  Files          84       84              
  Lines        5117     5120       +3     
==========================================
+ Hits         1931     1934       +3     
  Misses       3009     3009              
  Partials      177      177              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@abhisek
Copy link
Member Author

abhisek commented Feb 4, 2026

@Sahilb315 Please have a look. I faced network bind problem while running npx @modelcontextprotocol/inspector

This PR fixes it.

Copy link
Contributor

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 4 additional flags.

Open in Devin Review

Copy link
Contributor

Copilot AI left a comment

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 adds support for binding to localhost ports in sandbox profiles, primarily to enable npx generators and development servers to work properly.

Changes:

  • Added allow_network_bind boolean field to SandboxPolicy for controlling localhost port binding
  • Added allow_bind list field to NetworkPolicy for specifying explicit bind addresses
  • Implemented network bind support in the Seatbelt (macOS) translator with comprehensive tests
  • Documented why network bind is not implemented in Bubblewrap (Linux) translator
  • Enabled allow_network_bind in the npx profile

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
sandbox/profiles/npx.yml Enabled network bind for npx profile to support generators and dev servers
sandbox/policy.go Added AllowNetworkBind boolean field and Network.AllowBind list with proper merge logic
sandbox/platform/seatbelt_translator_darwin.go Implemented network bind rules for macOS Seatbelt sandbox
sandbox/platform/seatbelt_translator_darwin_test.go Added comprehensive tests for network bind functionality
sandbox/platform/bubblewrap_translator_linux.go Added comment explaining why network bind is not implemented for Linux

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

@Sahilb315 Sahilb315 merged commit 3778d4d into main Feb 4, 2026
19 checks passed
@Sahilb315 Sahilb315 deleted the feat/sandbox-network-bind-support branch February 4, 2026 10:02
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.

4 participants