fix(tool-sandbox): let allow_launch_services reach the open shim on macOS - #1464
Merged
lukehinds merged 2 commits intoJul 24, 2026
Merged
Conversation
Contributor
PR Review SummarySize
Affected crates
Blast radius — ContainedThis PR touches: source code Updated automatically on each push to this PR. |
…acOS Signed-off-by: James Carnegie <me@kipz.org>
kipz
force-pushed
the
kipz/fix-allow-launch-services-shim
branch
from
July 20, 2026 16:45
49b181a to
93ff260
Compare
kipz
marked this pull request as ready for review
July 20, 2026 16:51
kipz
added a commit
to kipz/nono
that referenced
this pull request
Jul 20, 2026
… reach the open shim on macOS
kipz
added a commit
to kipz/nono
that referenced
this pull request
Jul 20, 2026
… reach the open shim on macOS
kipz
added a commit
to kipz/nono
that referenced
this pull request
Jul 20, 2026
… reach the open shim on macOS
kipz
added a commit
to kipz/nono
that referenced
this pull request
Jul 21, 2026
kipz
added a commit
to kipz/nono
that referenced
this pull request
Jul 21, 2026
kipz
added a commit
to kipz/nono
that referenced
this pull request
Jul 21, 2026
… reach the open shim on macOS
kipz
added a commit
to kipz/nono
that referenced
this pull request
Jul 23, 2026
… reach the open shim on macOS
lukehinds
approved these changes
Jul 24, 2026
lukehinds
left a comment
Contributor
There was a problem hiding this comment.
lgtm
note to self, put something in changelog since allow_launch_services is public-facing
1 task
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.
Linked Issue
Closes #1463
Summary
allow_launch_services: trueonly worked when no other command in the profile declaredopen_urls. Once any other command's edge setopen_urls, three separate gaps combined to break it for everyallow_launch_services-only command:add_child_process_exec_gate_with_policy): the browser-open shim's path was only admitted to the exec allowlist foropen_urlsedges, notallow_launch_servicesones — even though a bareopenin the mediated$PATHalways resolves to the shim (never straight to/usr/bin/open) once any command in the profile needs it.inject_url_open_env): the URL-socket env var that lets the shim recognize itself as the relay was only set foropen_urlsedges — without it, the shim doesn't even attempt to connect to the supervisor.add_url_open_caps): connect access to the URL listener socket was, again, only granted foropen_urlsedges — so even once the shim tried to connect, the sandbox denied the connection.validate_url_open): unconditionally requiredopen_urlsto be set, with noallow_launch_servicescheck — so a relayed request would still be rejected.This PR extends all four gates to also recognize
allow_launch_services, scoped entirely to the macOS tool-sandbox path (Linux'sallow_launch_servicesremains a documented no-op, unchanged).Agent Disclosure
This PR was authored by an AI agent (Claude Code). Files consulted/changed:
crates/nono-cli/src/tool-sandbox/platform/macos.rs(add_child_process_exec_gate_with_policy,validate_url_open,add_url_open_caps),crates/nono-cli/src/tool-sandbox/env.rs(inject_url_open_env). Also read (unchanged):crates/nono-cli/src/command_policy.rs(any_command_allows_url_open),crates/nono-cli/src/tool-sandbox/url_shim.rs,crates/nono-cli/src/url_open.rs, and the Linux equivalent (crates/nono-cli/src/tool-sandbox/platform/linux.rs) to confirmallow_launch_servicesis intentionally a no-op there and left untouched. ConsultedCLAUDE.mdfor the affected area. Confirms compliance with repository requirements.Test Plan
make ci(clippy-D warnings, fmt-check, full test suite) — clean.allow_launch_services-without-open_urlscase and the unaffected/no-op case.open_urls(on one command) andallow_launch_services(on another), invoked through genuine tool-sandbox child mediation. Before:fork/exec .../shims/open: operation not permitted, then (after partial fixes) a LaunchServices dispatch failure. After all four fixes: the browser opens successfully. Also re-verified against the original real-world trigger (a CLI tool doing an interactive OAuth browser login through the sandbox) — confirmed the browser opens there too.Checklist
CHANGELOG.mdif neededAgent Compliance Check