A tiny macOS app-bundle wrapper that gives the herdr terminal multiplexer server (and every child process it spawns) a grantable identity under System Settings → Privacy & Security → Local Network.
Verified end-to-end on macOS Tahoe (2026-09): after pointing the herdr LaunchAgent at the bundle's launcher and granting "Herdr" Local Network permission, a non-Apple-signed process inside a herdr pane successfully opened TCP sockets to LAN hosts with attribution to Herdr.app.
macOS Tahoe's Local Network Privacy attaches permission grants to a responsible app — the nearest ancestor that is a real app bundle with a code signature. A herdr server spawned by launchd has no bundle anywhere in its ancestry, so macOS treats it as having no grantable identity:
- Every pane child is silently blocked from LAN sockets (connections fail with
EHOSTUNREACH). - Apple-signed tools (e.g.
nc,curlvia a signed shell) keep working, so the failure looks selective and confusing. - There is nothing in System Settings to grant — no toggle ever appears for it.
Wrap the server in a minimal .app bundle:
- The bundle's executable is a ~40-line C launcher (
launcher.c) thatexecs the herdr CLI in-process: a bare launch runsherdr server, any arguments are forwarded verbatim so a supervisor (e.g. a LaunchAgent or a hub script) can drive the bundle binary as if it wereherdritself. LSUIElementinInfo.plistkeeps the app out of the Dock and the app switcher — it's infrastructure, not a user-facing app.NSLocalNetworkUsageDescriptionprovides the Local Network usage string.- Ad-hoc code signing (
codesign --force -s -) gives the bundle the real Mach-O- signature that attribution and the Settings toggle require. (Script launchers cannot be signed, so the launcher must be compiled.)
- stdout/stderr land in
~/Library/Logs/herdr-server.logbecause launchd/Finder give the app no terminal.
Two empirical findings worth knowing:
- Attribution survives daemonization. herdr's daemon hop to PPID 1 does not break the attribution to the signed bundle — the grant covers the whole process tree.
- One grantable bundle, signed once, never touched again. The Local Network grant
binds to the ad-hoc signature; rebuilding and replacing a granted
/Applications/Herdr.appcan silently void the permission, going all pane children LAN-dark until re-granted. Rebuild only for fresh machines.
Verbatim from the repo's Makefile app target:
mkdir -p build/Herdr.app/Contents/MacOS build/Herdr.app/Contents/Resources
cc -O2 -o build/Herdr.app/Contents/MacOS/Herdr app/launcher.c
cp app/Info.plist build/Herdr.app/Contents/Info.plist
printf 'APPL????' > build/Herdr.app/Contents/PkgInfo
codesign --force -s - build/Herdr.app
plutil -lint build/Herdr.app/Contents/Info.plist- Copy
build/Herdr.appto/Applications. - Start the server through the bundle: point your herdr LaunchAgent's herdr path at
/Applications/Herdr.app/Contents/MacOS/Herdr, or just runopen -a Herdr. - Trigger a LAN connection, then grant Herdr under System Settings → Privacy & Security → Local Network.
- Optional: add a launchd log-capping LaunchAgent for
~/Library/Logs/herdr-server.log— a plainStandardErrorPathlog never rotates (one grew to 326 MB in ~5.5 weeks for a related agent).
- A dead LAN host perfectly mimics the privacy silent-fail signature. Before
concluding a privacy block, verify the target host is alive and probe a known-live
LAN port with an Apple-signed tool (
nc -z <gateway> 80). - Grep the actual process name, not the project name, when checking whether the
server is running — check
launchctl listand listening sockets first. - Inspect the log:
tail -f ~/Library/Logs/herdr-server.log.