latchwire

module
v0.0.0-...-42328bb Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 14, 2026 License: Apache-2.0

README

Latchwire

Latchwire is an open-source WireGuard-compatible client that keeps the static X25519 private key inside a hardware token (YubiKey PIV): the key is generated on the card and never leaves it, the protocol and the server stay unchanged, and no card means no tunnel. Design: docs/design.md. WireGuard is a registered trademark of Jason A. Donenfeld.

Status: macOS and Linux command line, with network parity: full tunnel, DNS, kill switch, on-demand and allowed users. The Linux network behaviour is tested end to end in a privileged container (test/e2e/linux/run.sh); the macOS network behaviour and everything that needs a real YubiKey are still to be verified with docs/hardware-checklist.md. The Windows port (service, named pipe IPC, Wintun, network configuration, WFP kill switch, PIN window) compiles and its pure logic is tested on other systems, but it has never run on Windows: treat it as unverified, and do not rely on its kill switch, until section 17 of the checklist passes. Latchwire is pre-release software: it has not had an independent security review, and there are no signed releases yet.

Desktop app

desktop/ is a menu bar and tray app built with Fyne, in its own Go module. It hosts the key agent, so run it instead of latchwire agent. Test it with cd desktop && go test ./...; desktop/build_macos.sh -tags demo builds a demo that needs no card or daemon.

Agent access

latchwire mcp is an MCP server that lets an AI agent on the same computer read status and, with your permission, create a key, add a tunnel, connect and disconnect. It is off until you turn it on in the desktop app, for a limited time; each of those actions asks for your approval in the app, and the PIN is only ever typed by you in Latchwire's own dialogs. It is not a defence against malware running as you. Setup: docs/manual-install.md; limits: threat model, section 5.10.

Translations

Messages live in internal/msg/locales/*.arb (ICU MessageFormat); en.arb is the source. The steps for adding a message or a language are in internal/msg/doc.go.

Directories

Path Synopsis
cmd
latchwire command
Command latchwire is the Latchwire command line: it generates keys on a YubiKey, runs the user agent and the root daemon (a service on Windows), and drives tunnels through the daemon.
Command latchwire is the Latchwire command line: it generates keys on a YubiKey, runs the user agent and the root daemon (a service on Windows), and drives tunnels through the daemon.
internal
agent
Package agent is the user-session side of Latchwire.
Package agent is the user-session side of Latchwire.
config
Package config parses Latchwire tunnel configurations.
Package config parses Latchwire tunnel configurations.
daemon
Package daemon is Latchwire's privileged tunnel manager.
Package daemon is Latchwire's privileged tunnel manager.
datadir
Package datadir locates the directory the Windows service keeps its state in.
Package datadir locates the directory the Windows service keeps its state in.
desktop
Package desktop is the logic of the desktop app, free of any UI toolkit: card inspection and key generation, the [Peer] block, binding a server's .conf to the keys on the card, the daemon client and the tunnel view model.
Package desktop is the logic of the desktop app, free of any UI toolkit: card inspection and key generation, the [Peer] block, binding a server's .conf to the keys on the card, the daemon client and the tunnel view model.
ipc
Package ipc is the local transport between the Latchwire daemon, the per-user agent and the CLI.
Package ipc is the local transport between the Latchwire daemon, the per-user agent and the CLI.
ipc/ipctest
Package ipctest gives a test a transport address of its own.
Package ipctest gives a test a transport address of its own.
keyprovider
Package keyprovider defines the vocabulary shared by every source of the device's static X25519 key: hardware tokens and the test-only software key.
Package keyprovider defines the vocabulary shared by every source of the device's static X25519 key: hardware tokens and the test-only software key.
keyprovider/piv
Package piv is the YubiKey PIV backend.
Package piv is the YubiKey PIV backend.
keyprovider/softkey
Package softkey is an in-memory key provider for tests only.
Package softkey is an in-memory key provider for tests only.
keyprovider/wgadapter
Package wgadapter plugs a keyprovider.Provider into wireguard-go as its static key, adding a per-call timeout, per-role rate limits and a cap on outstanding provider calls.
Package wgadapter plugs a keyprovider.Provider into wireguard-go as its static key, adding a per-call timeout, per-role rate limits and a cap on outstanding provider calls.
keyref
Package keyref parses references to a key slot on a hardware token.
Package keyref parses references to a key slot on a hardware token.
killswitch
Package killswitch blocks the traffic that would leave outside the tunnels: while a kill switch is on, only the tunnel interfaces, loopback, the tunnels' endpoints and what a link needs to come up (DHCP, IPv6 neighbour discovery and MLD) pass; DNS goes through the tunnels only.
Package killswitch blocks the traffic that would leave outside the tunnels: while a kill switch is on, only the tunnel interfaces, loopback, the tunnels' endpoints and what a link needs to come up (DHCP, IPv6 neighbour discovery and MLD) pass; DNS goes through the tunnels only.
mcpserver
Package mcpserver is the MCP server of latchwire mcp: the tools a local agent calls to set Latchwire up.
Package mcpserver is the MCP server of latchwire mcp: the tools a local agent calls to set Latchwire up.
msg
Package msg holds user-facing message strings.
Package msg holds user-facing message strings.
msg/gen command
Command gen writes internal/msg/en.go from internal/msg/locales/en.arb.
Command gen writes internal/msg/en.go from internal/msg/locales/en.arb.
msg/icu
Package icu is a small implementation of the ICU MessageFormat subset that Latchwire's translations use, and of the ARB files they live in:
Package icu is a small implementation of the ICU MessageFormat subset that Latchwire's translations use, and of the ARB files they live in:
netcfg
Package netcfg configures a tunnel interface's addresses and routes by running the platform's network commands (ifconfig/route on macOS, ip on Linux, netsh on Windows).
Package netcfg configures a tunnel interface's addresses and routes by running the platform's network commands (ifconfig/route on macOS, ip on Linux, netsh on Windows).
netmon
Package netmon reports that the machine's network changed (an interface, an address or a route) and gives the current network a stable identity.
Package netmon reports that the machine's network changed (an interface, an address or a route) and gives the current network a stable identity.
ttyio
Package ttyio opens the terminal the user is at, for prompts that must not come from standard input: a pipe must never answer them.
Package ttyio opens the terminal the user is at, for prompts that must not come from standard input: a pipe must never answer them.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL