ZeroBridge
Turns a Raspberry Pi Zero into a hardware-level USB HID and telemetry bridge for macOS — end-to-end encrypted, permission-free remote control from your phone.
Overview
ZeroBridge turns a Raspberry Pi Zero (W/2W) into a hardware-level automation engine and telemetry bridge for macOS. It emulates a composite USB gadget — keyboard, mouse, media keys, and both serial and Ethernet over a single OTG cable — so it interfaces with a Mac at the hardware layer, unaffected by accessibility permissions, scripting tokens, or app sandboxing.
Pipe JSON commands into a Unix socket on the Pi, or connect through the bundled Go web server to type, click, scroll, control media, or run terminal commands from any mobile browser with native hardware precision.
Core Idea
Most remote-control tools for macOS depend on Accessibility APIs, AppleScript, or screen-sharing protocols — all of which are gated by permission dialogs and can be blocked by sandboxing. ZeroBridge sidesteps that entirely: because the Mac sees the Pi as a real USB keyboard and mouse, there is nothing to authorize and nothing that can be revoked by a system update.
Architecture
The system spans three components tied together over a single USB OTG connection:
- pi-agent (Rust) — writes raw HID reports to
/dev/hidg0-2for keyboard, mouse, and media, and exposes a local Unix socket for IPC - go-server (Go) — serves a Progressive Web App over TLS, relays encrypted commands between the browser and
pi-agent, and never sees plaintext - zb-agent (Swift, macOS) — a launchd daemon bound exclusively to the USB CDC-ECM link, answering telemetry queries (cursor position, active window, screen layout, lock state) and executing commands via AppKit/Quartz
A hybrid router prefers a sub-millisecond WebSocket channel over USB Ethernet, with an automatic SSH failover (USB, then Wi-Fi) if that link drops, and a high-frequency serial line for low-level telemetry.
Security Model
- End-to-end encryption — an ephemeral P-256 ECDH handshake derives a session key via HKDF-SHA256; all commands and telemetry are encrypted with AES-256-GCM. The Go server only ever sees an opaque
{"enc": "..."}envelope - WebAuthn passkeys — new devices are authorized with TouchID/FaceID, gated by a one-time 6-digit setup code generated on the Mac or Pi
- USB-only service binding — the macOS daemon binds exclusively to the static USB Ethernet link, rejecting any request that arrives over Wi-Fi or an external interface
- Pubkey-only SSH — password authentication is disabled on the Pi; only authorized SSH keys can reach it
- Locally scoped IPC — the control socket is filesystem-scoped with Unix permissions and opens no external network port
The README is explicit about the threat model: ZeroBridge is built for a single trusted operator controlling their own Mac over a private USB tether or an isolated LAN. It does not defend against internet exposure, a hostile shared network, or a fully compromised Pi — treat the Pi as a trusted device, not a public-facing one.
Features
- Remote lock, wake, and unlock — hardware-emulated keystrokes wake and lock macOS, with password entry gated behind local passkey validation
- Screen-aware mouse movement across multi-monitor setups
- Live macOS state detection (active, locked, display sleep) surfaced in the PWA while it’s open
- A full IPC command set — cursor position, window enumeration, clipboard access, active app focus, keyboard/mouse/media emulation, and remote shell execution over SSH
Status
Actively maintained, open source under MIT. A native iOS app is planned to replace the PWA’s push-notification limitations with real APNs delivery and native WebAuthn.