Skip to content

feat(policy): grant nix daemon socket connect via unix_socket_connects (SEA-827)#651

Closed
mattwilkinsonn wants to merge 3 commits into
sea-636-unix-socket-connectsfrom
sea-827-nix-daemon-socket--hermes
Closed

feat(policy): grant nix daemon socket connect via unix_socket_connects (SEA-827)#651
mattwilkinsonn wants to merge 3 commits into
sea-636-unix-socket-connectsfrom
sea-827-nix-daemon-socket--hermes

Conversation

@mattwilkinsonn

@mattwilkinsonn mattwilkinsonn commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Pull request

Summary

Daemon-backed nix commands (nix flake update, nix build, etc.) were failing inside the macOS sandbox with cannot connect to socket … Operation not permitted. The nix bundle now grants a connect(2) to the nix daemon control socket at /nix/var/nix/daemon-socket/socket on macOS, where the sandbox default-denies AF_UNIX connects even though the /nix RO bind makes the inode visible.

Related issues

Closes SEA-827

Changes

  • Added /nix/var/nix/daemon-socket/socket to unix_socket_connects in the nix bundle spec.
  • The grant is macOS-only at the policy-application layer — Linux bwrap does not gate AF_UNIX connects, so the RO bind alone is sufficient there.
  • Updated the nix bundle doc comment, the reference docs, and the JSON schema description to document the new socket grant.

Test plan

  • Added nix_bundle_grants_daemon_socket_connect in seal-policy asserting the socket path is present in the bundle table.
  • Added nix_bundle_daemon_socket_reaches_macos_profile in seal-sandbox asserting the socket path propagates end-to-end through compile() into KernelParams.unix_socket_connects for a macOS nix:* spawn.
  • Added "nix" => BundleName::Nix to the test fixture bundle-name resolver so the compile-layer test can reference the bundle by name.

Notes for reviewers

The socket path is a fixed system path (no <USER> template) shared by multi-user Linux and Determinate Nix installs on both platforms. On single-user installs that never open the daemon socket, the grant is a harmless no-op.

Co-Authored-By: seal noreply@sealedsecurity.com

@linear-code

linear-code Bot commented Jun 22, 2026

Copy link
Copy Markdown

SEA-827

@coderabbitai

coderabbitai Bot commented Jun 22, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@mattwilkinsonn, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 15 minutes and 13 seconds. Learn how PR review limits work.

To continue reviewing without waiting, enable usage-based billing in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits.

🚦 How do rate limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, the refill rate gradually slows as usage increases. The highest same-day bursts are limited more strictly.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 1b60926e-186c-4dfb-8154-c87c12ec464c

📥 Commits

Reviewing files that changed from the base of the PR and between 65e1f16 and a48667f.

📒 Files selected for processing (5)
  • CHANGELOG.md
  • crates/seal-policy/src/manifest/sandbox.rs
  • crates/seal-sandbox/src/compile.rs
  • docs/site/src/content/docs/reference/manifest/sandbox/command-tools.mdx
  • schemas/seal.toml.json
📝 Walkthrough

Walkthrough

The nix sandbox bundle's unix_socket_connects field is populated with /nix/var/nix/daemon-socket/socket, allowing daemon-backed nix commands to connect(2) to the nix daemon inside the macOS sandbox. The change is accompanied by enum and field doc comment updates, two new tests, updated schema and MDX docs, and a changelog entry.

Changes

Nix daemon socket access in macOS sandbox

Layer / File(s) Summary
Nix bundle unix_socket_connects config and doc comments
crates/seal-policy/src/manifest/sandbox.rs
unix_socket_connects in BUNDLES for BundleName::Nix is populated with /nix/var/nix/daemon-socket/socket; the BundleName::Nix enum doc comment and BundleSpec.unix_socket_connects field documentation are expanded to describe the macOS connect(2) permission for daemon-backed nix commands.
Unit and compile-level regression tests
crates/seal-policy/src/manifest/sandbox.rs, crates/seal-sandbox/src/compile.rs
nix_bundle_grants_daemon_socket_connect asserts the daemon socket path is in unix_socket_connects; tool_entry_for gains a "nix" arm; nix_bundle_daemon_socket_reaches_macos_profile compiles a macOS nix:* spawn and asserts the socket path appears in KernelParams.unix_socket_connects.
Docs, schema, and changelog
schemas/seal.toml.json, docs/site/src/content/docs/reference/manifest/sandbox/command-tools.mdx, CHANGELOG.md
nix bundle description updated in the JSON schema and MDX reference doc; an Unreleased changelog bullet documents the new macOS sandbox socket permission.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐇 A socket was locked, nix daemons weep,
The sandbox said "no!" and nix fell asleep.
But now with a path and a connect(2) key,
/nix/var/nix/daemon-socket/socket runs free!
The rabbit hops on — nix builds with glee. 🎉

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: granting nix daemon socket connect access via unix_socket_connects in the policy layer, directly reflecting the core modification across all affected files.
Description check ✅ Passed The description is directly related to the changeset, providing context for the bug fix, explaining the specific socket path addition, documenting platform-specific behavior, and detailing all test additions.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch sea-827-nix-daemon-socket--hermes

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

Copy link
Copy Markdown
Contributor Author

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • Merge Queue - adds this PR to the back of the merge queue
  • Merge Queue Fast Track - for urgent changes, fast-track this PR to the front of the merge queue

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has required the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@greptile-apps

greptile-apps Bot commented Jun 22, 2026

Copy link
Copy Markdown

Greptile Summary

Fixes daemon-backed nix commands (nix flake update, nix build) failing inside the macOS sandbox with cannot connect to socket … Operation not permitted by granting connect(2) to /nix/var/nix/daemon-socket/socket via unix_socket_connects. The grant is macOS-only at the policy-application layer (Linux bwrap does not gate AF_UNIX connects, so no change is needed there).

  • Adds /nix/var/nix/daemon-socket/socket to the nix BundleSpec's unix_socket_connects field, with a strict exact-equality test in seal-policy guarding against undocumented socket additions.
  • Adds a compile-layer end-to-end test in seal-sandbox asserting the socket path propagates through compile() into KernelParams.unix_socket_connects on a macOS nix:* spawn.
  • Updates the doc comment, reference docs (command-tools.mdx), and JSON schema to document the new grant.

Confidence Score: 5/5

The change is a targeted, minimal allowlist addition — one fixed socket path, macOS-only at the collection layer, with no template expansion.

The grant is a single fixed system path with no user-controlled input, collected only on macOS, and harmless on single-user installs that don't run a daemon. Both new tests are well-scoped: the bundle-layer test uses exact slice equality so any future silent addition to the allowlist will fail CI, and the compile-layer test verifies the path reaches the kernel params end-to-end.

No files require special attention.

Important Files Changed

Filename Overview
crates/seal-policy/src/manifest/sandbox.rs Adds /nix/var/nix/daemon-socket/socket to the nix bundle's unix_socket_connects; adds a strict exact-equality test asserting the allowlist is exactly that one path.
crates/seal-sandbox/src/compile.rs Adds an end-to-end compile test that verifies the daemon socket path reaches KernelParams.unix_socket_connects on a macOS nix:* spawn; uses .contains() appropriately since a full spawn may include additional socket entries.
CHANGELOG.md Documents the new nix daemon socket grant in the changelog.
docs/site/src/content/docs/reference/manifest/sandbox/command-tools.mdx Appends macOS daemon socket grant description to the nix bundle documentation.
schemas/seal.toml.json Updates the JSON schema description for the nix bundle constant to document the macOS socket grant.

Reviews (8): Last reviewed commit: "fix(policy): tighten unix_socket_connect..." | Re-trigger Greptile

Comment thread crates/seal-policy/src/manifest/sandbox.rs
@mattwilkinsonn mattwilkinsonn force-pushed the sea-636-unix-socket-connects branch from ec47141 to 1716de4 Compare June 22, 2026 03:29
@mattwilkinsonn mattwilkinsonn force-pushed the sea-827-nix-daemon-socket--hermes branch from 09f3200 to c216d9c Compare June 22, 2026 03:29

@coderabbitai coderabbitai 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.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@crates/seal-policy/src/manifest/sandbox.rs`:
- Around line 1187-1188: The documentation comment for the field starting at
line 1187 is outdated and states that the field is empty for every current
bundle. Update this comment to reflect the current state where the nix
BundleSpec now populates the unix_socket_connects field with the daemon socket.
Revise the wording to accurately describe what bundles currently do with this
field rather than claiming it is always empty.
- Around line 3331-3334: The assertion for the Nix bundle's unix_socket_connects
uses .contains() which is too loose for a security-sensitive permission list, as
it would pass even if additional socket paths are accidentally added later.
Replace the .contains() check with a full slice equality assertion that exactly
matches the expected socket paths. This ensures the allowlist remains tightly
controlled and matches the pattern used in existing curated-domain tests.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: a1e9dd31-e7a6-4a49-8e77-a8b556d73656

📥 Commits

Reviewing files that changed from the base of the PR and between 09f3200 and c216d9c.

📒 Files selected for processing (5)
  • CHANGELOG.md
  • crates/seal-policy/src/manifest/sandbox.rs
  • crates/seal-sandbox/src/compile.rs
  • docs/site/src/content/docs/reference/manifest/sandbox/command-tools.mdx
  • schemas/seal.toml.json

@coderabbitai coderabbitai 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.

Caution

Inline review comments failed to post. This is likely due to GitHub's internal server error or limits when posting large numbers of comments. If you are seeing this consistently it is likely a permissions issue. Please check "Moderation" -> "Code review limits" under your organization settings.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@crates/seal-policy/src/manifest/sandbox.rs`:
- Around line 1187-1188: The documentation comment for the field starting at
line 1187 is outdated and states that the field is empty for every current
bundle. Update this comment to reflect the current state where the nix
BundleSpec now populates the unix_socket_connects field with the daemon socket.
Revise the wording to accurately describe what bundles currently do with this
field rather than claiming it is always empty.
- Around line 3331-3334: The assertion for the Nix bundle's unix_socket_connects
uses .contains() which is too loose for a security-sensitive permission list, as
it would pass even if additional socket paths are accidentally added later.
Replace the .contains() check with a full slice equality assertion that exactly
matches the expected socket paths. This ensures the allowlist remains tightly
controlled and matches the pattern used in existing curated-domain tests.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: a1e9dd31-e7a6-4a49-8e77-a8b556d73656

📥 Commits

Reviewing files that changed from the base of the PR and between 09f3200 and c216d9c.

📒 Files selected for processing (5)
  • CHANGELOG.md
  • crates/seal-policy/src/manifest/sandbox.rs
  • crates/seal-sandbox/src/compile.rs
  • docs/site/src/content/docs/reference/manifest/sandbox/command-tools.mdx
  • schemas/seal.toml.json
🛑 Comments failed to post (2)
crates/seal-policy/src/manifest/sandbox.rs (2)

1187-1188: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Update the field docs now that nix populates this list.

Empty for every current bundle is stale because the nix BundleSpec now sets unix_socket_connects to the daemon socket.

Suggested wording
-    /// Empty for every current bundle; populated by bundles that
-    /// wrap a local-daemon CLI talking over an AF_UNIX socket.
+    /// Empty for bundles that do not wrap a local-daemon CLI;
+    /// currently populated by the nix bundle for the daemon
+    /// control socket.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

    /// Empty for bundles that do not wrap a local-daemon CLI;
    /// currently populated by the nix bundle for the daemon
    /// control socket.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@crates/seal-policy/src/manifest/sandbox.rs` around lines 1187 - 1188, The
documentation comment for the field starting at line 1187 is outdated and states
that the field is empty for every current bundle. Update this comment to reflect
the current state where the nix BundleSpec now populates the
unix_socket_connects field with the daemon socket. Revise the wording to
accurately describe what bundles currently do with this field rather than
claiming it is always empty.

3331-3334: 🛠️ Refactor suggestion | 🟠 Major | ⚡ Quick win

Pin the exact nix socket allowlist.

This is a security-sensitive permission list; .contains(...) would still pass if another socket path were accidentally added later. Match the existing curated-domain tests and assert the full slice.

Suggested test tightening
-        assert!(
-            bundle(BundleName::Nix)
-                .unix_socket_connects
-                .contains(&"/nix/var/nix/daemon-socket/socket"),
-            "nix bundle must grant connect to the daemon socket (SEA-827); got {:?}",
-            bundle(BundleName::Nix).unix_socket_connects
+        assert_eq!(
+            bundle(BundleName::Nix).unix_socket_connects,
+            &["/nix/var/nix/daemon-socket/socket"],
+            "nix bundle must grant only the daemon socket connect permission (SEA-827)"
         );
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@crates/seal-policy/src/manifest/sandbox.rs` around lines 3331 - 3334, The
assertion for the Nix bundle's unix_socket_connects uses .contains() which is
too loose for a security-sensitive permission list, as it would pass even if
additional socket paths are accidentally added later. Replace the .contains()
check with a full slice equality assertion that exactly matches the expected
socket paths. This ensures the allowlist remains tightly controlled and matches
the pattern used in existing curated-domain tests.

@sealedsecurity-ci

Copy link
Copy Markdown

@graphite-app

graphite-app Bot commented Jun 22, 2026

Copy link
Copy Markdown

Merge activity

  • Jun 22, 3:51 AM UTC: mattwilkinsonn added this pull request to the Graphite merge queue.
  • Jun 22, 3:57 AM UTC: CI is running for this pull request on a draft pull request (#657) due to your merge queue CI optimization settings.
  • Jun 22, 3:58 AM UTC: This pull request has been added to the Graphite merge queue failure handling queue because the batch it was included in failed to pass CI.
  • Jun 22, 3:59 AM UTC: CI is running for this pull request on a draft pull request (#658) due to batch failure handling.
  • Jun 22, 4:02 AM UTC: CI is running for this pull request on a draft pull request (#659) due to batch failure handling.
  • Jun 22, 4:10 AM UTC: This pull request was re-added to the Graphite merge queue after passing CI during failure handling.
  • Jun 22, 4:11 AM UTC: CI is running for this pull request on a draft pull request (#661) due to your merge queue CI optimization settings.
  • Jun 22, 4:15 AM UTC: The Graphite merge queue removed this pull request due to downstack failures on PR #620.
  • Jun 22, 4:15 AM UTC: The Graphite merge queue removed this pull request due to downstack failures on PR #620.
  • Jun 22, 5:32 AM UTC: mattwilkinsonn added this pull request to the Graphite merge queue.
  • Jun 22, 5:38 AM UTC: CI is running for this pull request on a draft pull request (#664) due to your merge queue CI optimization settings.
  • Jun 22, 5:41 AM UTC: The Graphite merge queue removed this pull request due to downstack failures on PR #620.
  • Jun 22, 5:41 AM UTC: The Graphite merge queue removed this pull request due to downstack failures on PR #620.
  • Jun 22, 8:44 PM UTC: mattwilkinsonn added this pull request to the Graphite merge queue.
  • Jun 22, 8:50 PM UTC: CI is running for this pull request on a draft pull request (#669) due to your merge queue CI optimization settings.
  • Jun 22, 8:51 PM UTC: The Graphite merge queue removed this pull request due to downstack failures on PR #620.
  • Jun 22, 8:51 PM UTC: The Graphite merge queue removed this pull request due to downstack failures on PR #620.
  • Jun 22, 8:57 PM UTC: mattwilkinsonn added this pull request to the Graphite merge queue.
  • Jun 22, 8:59 PM UTC: CI is running for this pull request on a draft pull request (#670) due to your merge queue CI optimization settings.
  • Jun 22, 9:02 PM UTC: This pull request has been added to the Graphite merge queue failure handling queue because the batch it was included in failed to pass CI.
  • Jun 22, 9:15 PM UTC: CI is running for this pull request on a draft pull request (#674) due to batch failure handling.
  • Jun 22, 9:19 PM UTC: The Graphite merge queue couldn't merge this PR because it was not satisfying all requirements (Failed CI (buildkite/seal-ci-orchestrator)).
  • Jun 22, 9:19 PM UTC: PR #651 has been removed from the merge queue after undergoing failure handling due to failing CI checks: buildkite/seal-ci-orchestrator. Check for failures in draft pull request (#674).
  • Jun 24, 1:37 AM UTC: mattwilkinsonn added this pull request to the Graphite merge queue.
  • Jun 24, 1:42 AM UTC: The Graphite merge queue removed this pull request due to downstack failures on PR #620.
  • Jun 24, 1:42 AM UTC: The Graphite merge queue removed this pull request due to downstack failures on PR #620.
  • Jun 24, 2:32 AM UTC: mattwilkinsonn added this pull request to the Graphite merge queue.
  • Jun 24, 2:37 AM UTC: CI is running for this pull request on a draft pull request (#688) due to your merge queue CI optimization settings.
  • Jun 24, 2:45 AM UTC: Merged by the Graphite merge queue via draft PR: #688.

@mattwilkinsonn mattwilkinsonn force-pushed the sea-636-unix-socket-connects branch from 1716de4 to 8dd401b Compare June 22, 2026 04:49
@mattwilkinsonn mattwilkinsonn force-pushed the sea-827-nix-daemon-socket--hermes branch 2 times, most recently from 0abaa60 to 9f69558 Compare June 22, 2026 05:18
@mattwilkinsonn mattwilkinsonn force-pushed the sea-636-unix-socket-connects branch from ccd7f43 to 4ee0460 Compare June 22, 2026 23:35
@mattwilkinsonn mattwilkinsonn force-pushed the sea-827-nix-daemon-socket--hermes branch from 9f69558 to 009d166 Compare June 22, 2026 23:35

@coderabbitai coderabbitai 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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@crates/seal-policy/src/manifest/sandbox.rs`:
- Around line 1190-1191: The documentation comment for the unix_socket_connects
field at lines 1190-1191 is outdated and states the field is empty for every
current bundle, but this is no longer accurate since nix bundles now populate it
at line 1974. Update the field documentation to correctly reflect that the field
is populated by nix bundles (in addition to bundles that wrap a local-daemon CLI
talking over an AF_UNIX socket), removing the claim that it remains empty for
every current bundle.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: ba9ce1eb-a81d-4c2b-bb05-b86439bb418a

📥 Commits

Reviewing files that changed from the base of the PR and between 9f69558 and 009d166.

📒 Files selected for processing (5)
  • CHANGELOG.md
  • crates/seal-policy/src/manifest/sandbox.rs
  • crates/seal-sandbox/src/compile.rs
  • docs/site/src/content/docs/reference/manifest/sandbox/command-tools.mdx
  • schemas/seal.toml.json

@coderabbitai coderabbitai 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.

Caution

Inline review comments failed to post. This is likely due to GitHub's internal server error or limits when posting large numbers of comments. If you are seeing this consistently it is likely a permissions issue. Please check "Moderation" -> "Code review limits" under your organization settings.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@crates/seal-policy/src/manifest/sandbox.rs`:
- Around line 1190-1191: The documentation comment for the unix_socket_connects
field at lines 1190-1191 is outdated and states the field is empty for every
current bundle, but this is no longer accurate since nix bundles now populate it
at line 1974. Update the field documentation to correctly reflect that the field
is populated by nix bundles (in addition to bundles that wrap a local-daemon CLI
talking over an AF_UNIX socket), removing the claim that it remains empty for
every current bundle.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: ba9ce1eb-a81d-4c2b-bb05-b86439bb418a

📥 Commits

Reviewing files that changed from the base of the PR and between 9f69558 and 009d166.

📒 Files selected for processing (5)
  • CHANGELOG.md
  • crates/seal-policy/src/manifest/sandbox.rs
  • crates/seal-sandbox/src/compile.rs
  • docs/site/src/content/docs/reference/manifest/sandbox/command-tools.mdx
  • schemas/seal.toml.json
🛑 Comments failed to post (1)
crates/seal-policy/src/manifest/sandbox.rs (1)

1190-1191: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Fix stale field documentation to match the new nix population.

Line 1190 says unix_socket_connects is empty for every current bundle, but Line 1974 now populates it for nix. Please update the wording to avoid future misreads.

Suggested doc fix
-    /// Empty for every current bundle; populated by bundles that
-    /// wrap a local-daemon CLI talking over an AF_UNIX socket.
+    /// Empty for most bundles; populated by bundles that wrap a
+    /// local-daemon CLI talking over an AF_UNIX socket (currently `nix`).
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

    /// Empty for most bundles; populated by bundles that wrap a
    /// local-daemon CLI talking over an AF_UNIX socket (currently `nix`).
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@crates/seal-policy/src/manifest/sandbox.rs` around lines 1190 - 1191, The
documentation comment for the unix_socket_connects field at lines 1190-1191 is
outdated and states the field is empty for every current bundle, but this is no
longer accurate since nix bundles now populate it at line 1974. Update the field
documentation to correctly reflect that the field is populated by nix bundles
(in addition to bundles that wrap a local-daemon CLI talking over an AF_UNIX
socket), removing the claim that it remains empty for every current bundle.

@mattwilkinsonn mattwilkinsonn force-pushed the sea-636-unix-socket-connects branch from 4ee0460 to 9eb9ac2 Compare June 23, 2026 03:45
@mattwilkinsonn mattwilkinsonn force-pushed the sea-827-nix-daemon-socket--hermes branch from 009d166 to 7f7383e Compare June 23, 2026 03:45
mattwilkinsonn added a commit that referenced this pull request Jun 23, 2026
…rtion (SEA-827 review)

Address CodeRabbit review on PR #651:

- The `unix_socket_connects` field doc said "Empty for every current
  bundle" — stale now that the nix bundle populates it. Reword to name
  the nix bundle as the current populator.
- `nix_bundle_grants_daemon_socket_connect` used `.contains()`, which
  would pass even if an extra socket path were added later. Switch to
  exact slice equality so the security-sensitive allowlist fails the
  test on any unreviewed addition.

Refs SEA-827

Co-Authored-By: seal <noreply@sealedsecurity.com>
mattwilkinsonn and others added 3 commits June 23, 2026 21:56
…s (SEA-827)

Daemon-backed nix commands (`nix flake update`, `nix build`) connect
the control socket at `/nix/var/nix/daemon-socket/socket`. The `/nix`
RO bind makes the inode visible, but the macOS sandbox default-denies
AF_UNIX `connect()`. The nix bundle now declares the socket in
`unix_socket_connects` (the SEA-636 primitive), so the macOS profile
emits the `network-outbound` allow. Fixed system path, no `<USER>`
template; harmless no-op on single-user installs without a daemon.

Closes SEA-827

Co-Authored-By: seal <noreply@sealedsecurity.com>
…rtion (SEA-827 review)

Address CodeRabbit review on PR #651:

- The `unix_socket_connects` field doc said "Empty for every current
  bundle" — stale now that the nix bundle populates it. Reword to name
  the nix bundle as the current populator.
- `nix_bundle_grants_daemon_socket_connect` used `.contains()`, which
  would pass even if an extra socket path were added later. Switch to
  exact slice equality so the security-sensitive allowlist fails the
  test on any unreviewed addition.

Refs SEA-827

Co-Authored-By: seal <noreply@sealedsecurity.com>
@mattwilkinsonn mattwilkinsonn force-pushed the sea-636-unix-socket-connects branch from 9eb9ac2 to b90ce29 Compare June 24, 2026 02:16
@mattwilkinsonn mattwilkinsonn force-pushed the sea-827-nix-daemon-socket--hermes branch from 65e1f16 to a48667f Compare June 24, 2026 02:16
@graphite-app graphite-app Bot closed this Jun 24, 2026
@graphite-app graphite-app Bot deleted the sea-827-nix-daemon-socket--hermes branch June 24, 2026 02:45
@github-actions github-actions Bot locked and limited conversation to collaborators Jun 24, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant