fix: Sandbox Allow network bind for npx#151
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
|
Member
Author
|
@Sahilb315 Please have a look. I faced network bind problem while running This PR fixes it. |
Contributor
There was a problem hiding this comment.
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_bindboolean field toSandboxPolicyfor controlling localhost port binding - Added
allow_bindlist field toNetworkPolicyfor 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_bindin 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
approved these changes
Feb 4, 2026
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.
Uh oh!
There was an error while loading. Please reload this page.