Gabriel Koerich › passbox

Senior Engineer · AI Workflows · Solana / DeFi

Another machine

A Linux box with no Secure Enclave can read a secret held by a Mac. The fingerprint happens on the Mac; the client holds no store and no key, so a copy of it is worth nothing.

Verified from a Raspberry Pi on a LAN and a fly.io machine in another country, both over Tailscale.

On the Mac

The broker has to be already running, in your login session. One started by an incoming connection cannot raise a Touch ID prompt: whoever calls evaluatePolicy has to be somewhere a sensor is reachable. A LaunchAgent is how you get that.

Start the Homebrew service as your user, not with sudo, since a sudo service has no login session. Then forward the tailnet port to the broker:

brew services start passbox
tailscale serve --bg --proxy-protocol 1 --tcp 8787 tcp://127.0.0.1:8787

The service is the one way to keep the broker running. Do not add a LaunchAgent of your own beside it: launchd keeps both alive, and the second to start takes the socket while the first keeps the tailnet port, so local commands and remote clients reach different brokers. A build from source has no service, and its broker starts on demand with the first command that needs it.

With only the Tailscale app and no tailscale command, run the same line as /Applications/Tailscale.app/Contents/MacOS/Tailscale serve .... passbox prints it that way when it finds no tailscale on PATH.

Why serve rather than binding the tailnet address

The broker binds 127.0.0.1:8787 and Tailscale forwards to it. Binding the 100.x address directly looks right and does not work: macOS runs Tailscale as a network extension, the socket accepts the connection, and the first read fails with ENOTCONN. Measured 2026-09-27, and reproduced with a plain Python server, so it is the platform rather than passbox.

Cost: loopback has none of the unix socket's 0600 protection, so any local user can reach that port. It is the only inbound path macOS delivers.

--proxy-protocol 1 makes Tailscale open each connection with the node's tailnet address, since through serve the broker only ever sees 127.0.0.1. The broker resolves that address with tailscale whois, so the prompt and the audit log name the host, as in claude on server ([email protected], 100.64.0.7). The name comes from the control plane, not from the client. The broker refuses a connection without the header, because a client could otherwise send its own and claim any host. Set PASSBOX_AGENT on the client to name the job as well, such as an orch job id.

Cost: a local user who connects to the loopback port directly can write a header that names another tailnet host. It does not get past the prompt, but the prompt can then name the wrong host.

On the client

curl -fsSL -o passbox.tar.gz \
  https://github.com/gabrielkoerich/passbox/releases/latest/download/passbox-x86_64-unknown-linux-musl.tar.gz
tar -xzf passbox.tar.gz && sudo install passbox /usr/local/bin/

echo "100.x.y.z" > ~/.passbox/host      # the Mac's tailnet address, or its MagicDNS name
passbox get github/token

The client appends port 8787 when the line has no port, and host:port names another. Use a name or an IPv4 address, since the colons of an IPv6 address read as a port. The release binary is x86_64. On ARM, such as a Raspberry Pi, build it with cargo install passbox --no-default-features.

PASSBOX_HOST does the same for one run. A configured host wins over anything on the client's own disk, so a machine with no store still asks the Mac rather than falling back to a passphrase it does not have.

grant and exec go to the Mac too. passbox exec --env A=x/a --env B=x/b -- cmd raises one prompt on the Mac for both, and passbox grant on the client mints a token there and prints it here.

In a container

examples/linux-client has a Dockerfile with Tailscale and the client, and a fly.io deployment that was used to verify this.

fly launch --no-deploy --name passbox-poc
fly secrets set TS_AUTHKEY=tskey-auth-... PASSBOX_HOST=100.x.y.z
fly deploy --ha=false
fly ssh console --pty -C "passbox get github/token"

Give the container a real tun device. tailscaled --tun=userspace-networking reaches the tailnet only through a SOCKS proxy, so an ordinary connect() to a 100.x address times out with no hint why. The entrypoint uses /dev/net/tun when the platform provides one.

An iPhone as a second approver

Not ready to rely on: the Mac side below is built and tested, and the iPhone app in ios/ installs from TestFlight but has not yet paired with a Mac. It has no notifications, so it sees a request only while it is open.

passbox phone add     # shows a code, the phone dials in with it, a fingerprint here confirms if the key matches
passbox phone ls
passbox phone rm      # the phone can then open nothing

Once a phone is enrolled, a Touch ID prompt that goes unanswered for 10 seconds is also shown on the phone, and whichever answers first decides. With the lid closed the phone is asked at once. Face ID opens the store key inside the phone's own Secure Enclave, so a sensor still stands behind every release. The phone reaches the broker over the tailnet, set up as above, and the audit log says which approvals came from it.

# ~/.passbox/config.toml
[phone]
delay = 10     # seconds Touch ID goes unanswered before the phone is asked too
timeout = 60   # seconds the phone has when the Mac cannot prompt at all

The reasoning is in docs/content/design.md.

What this does not give you

The job is not identified. The host comes from the control plane, but PASSBOX_AGENT is still whatever the caller claims.

The Mac must be awake, unlocked, and its lid open. Nothing can answer a prompt otherwise. A closed lid fails, and the error says so: Touch ID is unavailable, open the lid or use the recovery passphrase.

Nobody is there at 3am. A scheduled job wants injection or a grant, not a prompt. See Unattended.