Skip to content

feat(macos): add entitlements for automation and privacy permissions#196

Merged
forketyfork merged 2 commits intomainfrom
feat/macos-entitlements
Feb 4, 2026
Merged

feat(macos): add entitlements for automation and privacy permissions#196
forketyfork merged 2 commits intomainfrom
feat/macos-entitlements

Conversation

@forketyfork
Copy link
Owner

Summary

CLI apps running inside Architect terminals could not request macOS automation permissions (e.g., AppleScript). Unlike Ghostty, no permission dialog appeared - the requests just failed silently.

Solution

Added proper macOS entitlements and Info.plist usage descriptions, following Ghostty's approach:

  • New entitlements files: macos/Architect.entitlements (production) and macos/ArchitectDebug.entitlements (debug, with disable-library-validation for unsigned dylibs)
  • Info.plist updates: Added 13 NS*UsageDescription keys for all privacy-sensitive operations (AppleEvents, Bluetooth, Calendar, Camera, Contacts, LocalNetwork, Location, Microphone, Motion, PhotoLibrary, Reminders, SpeechRecognition, SystemAdministration)
  • Bundle script changes:
    • Added --debug flag to select appropriate entitlements
    • Changed main bundle executable from shell wrapper to actual binary (entitlements require signed binaries, not scripts)
    • Added code signing step for all bundled dylibs and the app bundle

Test plan

  • Build and bundle: zig build && ./scripts/bundle-macos.sh ./zig-out/bin/architect .tmp/test --debug
  • Launch the app and run a CLI tool that requires automation permissions (e.g., osascript)
  • Verify the macOS permission dialog appears

Issue: CLI apps running inside Architect terminals could not request
macOS automation permissions (e.g., AppleScript). Unlike Ghostty, no
permission dialog appeared - the requests just failed silently.

Solution: Added proper macOS entitlements and Info.plist usage descriptions
following Ghostty's approach. Created entitlements files for production and
debug builds, added 13 NS*UsageDescription keys to Info.plist, and updated
the bundle script to code-sign the app with entitlements. Also changed the
main bundle executable from a shell wrapper to the actual binary, since
entitlements only work on signed binaries.
@forketyfork forketyfork requested a review from Copilot February 4, 2026 09:31
Copy link

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 macOS entitlements and privacy permission descriptions to enable CLI apps running in Architect terminals to request automation and privacy permissions (e.g., AppleScript, camera, microphone). Previously, these requests failed silently without permission dialogs.

Changes:

  • Added entitlements files for production and debug builds
  • Updated Info.plist with 13 privacy usage descriptions
  • Modified bundling script to sign binaries with entitlements and switch from shell wrapper to direct binary execution

Reviewed changes

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

File Description
scripts/bundle-macos.sh Added debug flag support, switched to direct binary execution, implemented code signing with entitlements, and updated dependency patching logic
macos/ArchitectDebug.entitlements Debug entitlements with library validation disabled for unsigned dylibs
macos/Architect.entitlements Production entitlements for automation and privacy permissions

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

Add comment explaining why a flag is used instead of early return:
signing must always happen regardless of Nix dependencies.
@forketyfork forketyfork merged commit 209c950 into main Feb 4, 2026
4 checks passed
@forketyfork forketyfork deleted the feat/macos-entitlements branch February 4, 2026 09:56
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.

1 participant