About this project

vpnonly is a lightweight split-tunneling tool for macOS that routes only the applications you specify through a WireGuard VPN. Unlike standard VPN clients that tunnel everything, vpnonly keeps your browser, banking apps, and streaming services on your normal internet connection while sending only chosen apps through the VPN exit. The tool works by leveraging macOS's built-in PF firewall, which can match packets by Unix group membership rather than by application. When you launch an app through vpnonly, it runs the application with a special group assigned to it, then PF rules route that group's traffic through the WireGuard interface while everything else continues normally. The project consists of approximately 350 lines of shell scripts and a small C launcher file. It requires no kernel extension, no Network Extension entitlement, and never modifies /etc/pf.conf or your default route. Rules live in a dedicated anchor, and bringing down the VPN clears only those rules. For WireGuard support, it bundles the stock wireguard-go from Homebrew. The CLI version works with NordVPN out of the box, but providers using cryptokey routing (Mullvad, Proton, self-hosted servers) require the patched wireguard-go that rewrites the inner source address - this patch is included in the compiled Mac app but not yet in the CLI formula. Known limitations include Safari and other WebKit apps (they route connections through separate system processes that never carry the group), DNS queries (not tunneled, so lookups still exit normally), and IPv6 (blocked for grouped apps rather than tunneled). There's also no automatic reconnect if the server drops. Installation is via Homebrew: brew tap kanishkdan/vpnonly && brew install vpnonly. A paid Mac app version ($19 for two Macs) is also available at vpnonly.app with additional features like per-app toggles without relaunching, automatic updates, and a country picker. The source code under app-engine/ is published with checksums so users can audit exactly what runs as root before trusting it. All privileged scripts are short enough to read in five minutes.