Repository navigation
fix(agent route): let the sandboxed app open its socket; record the ADR-0013 spike - #112
Merged
Merged
Conversation
…DR-0013 spike The ADR-0013 spike, run with this app's exact entitlements and hardened runtime, found that the folder exception for /Users/Shared/encrypted- note-keys covers files but not Unix sockets: bind() there is refused under the App Sandbox, with or without network.server. So the merged ADR-0012 route could not have opened its socket in a sandboxed build; the tests pass because they run unsandboxed. Add one temporary-exception.sbpl rule allowing only network-bind and network-inbound on Unix sockets in that folder (no outbound, no IP sockets), approved by the owner on 2026-11-09, and update its pinned hash. The spike showed the rule works with the exact file committed here; a Developer ID-signed, notarized build still has to confirm it. ADR-0013 records the spike: the Security framework's signature checks are refused under the sandbox for other programs, but the kernel's own record (csops_audittoken, sysctl) gives identity, team and validation category for Claude Code, Codex and other accounts' processes, and a fake ad-hoc "com.anthropic.claude-code" shows no team and no Developer ID category. The owner accepted Claude Code although its signature disables library validation. ADR-0012, the guide and the security model describe the two entitlements. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
The ADR-0013 spike found a real problem in the merged agent-key route (ADR-0012), and this PR fixes it with one sandbox rule you approved. It also records the spike in ADR-0013.
The problem
As built, the app could not have opened its agent socket in a real, sandboxed build. The folder exception for
/Users/Shared/encrypted-note-keyscovers files, not Unix sockets. The route's tests pass because they run unsandboxed.The spike used a stand-in program signed with this app's exact
Entitlements.plistand hardened runtime, under the real App Sandbox, with fake data only. Every test also ran unsandboxed as a control.bind()a Unix socketbind()withnetwork.serveraddedbind()with the rule in this PRThe fix (the one entitlement change)
scripts/pinned-hashes.txtis updated for it (101968d3…→cd6e849a…).Still to confirm: a Developer ID-signed, notarized build. The spike was signed ad-hoc.
docs/agent-keys.mdkeeps that hand check open.What ADR-0013 now records
csops_audittoken(andsysctlfor the parent process), it gives identity, team and "validated as Developer ID" for Claude Code, Codex, and processes owned by other accounts.sysctlreads the parent's process number even across accounts, whereproc_pidinfois refused.com.anthropic.claude-codematches the identity, but has no team and no Developer ID category.Files
src-tauri/Entitlements.plist,scripts/pinned-hashes.txt: the rule and its hash.docs/adr/0013-…md: the spike result, how the check reads programs, and the Claude Code decision.docs/adr/0012-…md,docs/agent-keys.md,docs/security-model.md: they now describe the two entitlements, and the hand check notes what the spike answered.src-tauri/src/agent_route.rs: one comment.Checks, stated plainly
Passed locally:
cargo fmt;Not completed locally:
This PR changes no code path and nothing in
companion/, so CI on clean macOS and Windows runners is the full check.🤖 Generated with Claude Code