End-to-End Encryption Security
NFLTR provides two end-to-end encrypted tracks, TLS passthrough and P2P direct, plus a WireGuard VPN that is end to end between client and exit. Tunnel commands run in verified end-to-end encryption by default. Inspectable mode is available only as an explicit opt-in via --e2ee=false.
Tutorials: End-to-end encryption with pairing keys · Reach a private LAN over WireGuard
Encrypted Tracks
🔐 TLS Passthrough (default)
Tunnel commands run in verified mode by default. The agent generates or loads a TLS certificate and terminates TLS itself. The server routes by SNI hostname without decrypting and sees only the TLS ClientHello.
Protocols: HTTPS, gRPCS, any TLS-wrapped protocol
Cert options: Auto-generated ECDSA P-256, user-provided cert/key, or ACME/Let's Encrypt
🛡️ WireGuard VPN (nfltr wg)
Full L3 VPN tunnel using WireGuard, end to end between the client and the exit: they are WireGuard peers of each other, and the relay only forwards their sealed packets. Use the same pairing key (--e2ee-key-file) on both ends so a relay in the middle cannot swap in its own WireGuard key. Each client reaches only the exit it named in its own account.
Protocols: TCP, UDP, ICMP — any IP protocol
Features: Userspace (no root), SOCKS5 proxy, CGNAT address allocation
✦ P2P Direct (nfltr p2p)
Data goes directly between peers when NAT traversal succeeds, otherwise through the relay or TURN. On every path it is sealed with AES-256-GCM under keys from an X25519 exchange, authenticated by a key file on both machines (--e2ee-key-file) or by comparing the session fingerprint both print.
Features: File transfer, text chat, audio/video calls
NAT traversal: STUN-assisted, falls back to encrypted relay
TLS Passthrough for Tunnel Commands
Tunnel commands run with agent-terminated TLS by default. Use --e2ee=false only when you need inspectable mode for debugging.
Supported Commands
| Command | Default behavior |
|---|---|
nfltr http | Agent terminates HTTPS for pinned clients; a share URL is relay-terminated unless the agent holds a certificate for its host name (--e2ee-cert) |
nfltr tcp | TCP tunnel with agent-terminated TLS wrapping |
nfltr terminal | Browser terminal via agent's HTTPS server (xterm.js) |
nfltr shell | Embedded SSH: SSH's own encryption through the relay; check the host key the agent prints |
nfltr command | Command-as-a-service over agent's HTTPS |
nfltr tail | Log tail viewer over agent's HTTPS |
nfltr watch | Live command output over agent's HTTPS |
nfltr share | Ephemeral content share; the relay ends the share URL's TLS unless the agent holds a certificate for its host name |
nfltr ai | AI session (Claude, etc.) over agent's HTTPS |
nfltr a2a | Agent-to-agent with payload encryption (default on) |
Certificate Options
# Auto-generated self-signed ECDSA P-256 cert (default verified mode)
nfltr http 3000
# User-provided certificate and key
nfltr http 3000 --e2ee-cert server.crt --e2ee-key server.key
# A share URL: nfltr.xyz issues agents no certificate for its host name,
# so the relay ends its TLS and can read it
nfltr http 3000 --share
# Explicit inspectable mode for debugging
nfltr http 3000 --e2ee=false
WireGuard VPN
Full Layer 3 VPN tunnel using the WireGuard protocol. Runs in userspace (no root required) using gvisor netstack.
What the relay sees: sealed WireGuard packets, and which client connects to which exit, when, and how much. WireGuard is end to end: the client and the exit are peers of each other, and the relay forwards their packets without holding a WireGuard key, so it cannot read addresses, ports or payloads inside the tunnel. The relay does pass each side the other's public key, so a compromised relay could swap in its own key and sit in the middle; the same pairing key on both ends (--e2ee-key-file) stops that, because a relay without the secret cannot complete a WireGuard handshake. Accounts are isolated: a client reaches only the exit it named in its own account.
🔑 Curve25519 Key Exchange
The client and the exit exchange WireGuard public keys through the relay, in gRPC metadata on their authenticated sessions. The relay allocates a CGNAT IP (100.64.0.0/10) and holds no WireGuard key; with the same pairing key (--e2ee-key-file) on both ends it cannot swap in one of its own.
🌐 SOCKS5 Proxy
Connect via nfltr wg socks5 — routes TCP traffic through the WireGuard tunnel. Access remote services as if you were on the same LAN.
🚧 Allow-listed Destinations
nfltr wg serve forwards only to the destinations you pass with --allow (CIDRs, IPs or hosts, each optionally with a port) and refuses and logs everything else. --allow all is an explicit opt-in, and still excludes the exit's own loopback (127.0.0.1, ::1) unless you also list 127.0.0.1: or --allow all is an explicit opt-in.lt;port--allow all is an explicit opt-in.gt;localhost:. The agent side and --allow all is an explicit opt-in.lt;port--allow all is an explicit opt-in.gt;nfltr wg socks5 run in userspace: no sudo, no /dev/tun.
# Start WireGuard server on the agent; it forwards only to --allow
nfltr wg serve --name my-network --allow 192.168.1.0/24
# Connect from another machine via SOCKS5
nfltr wg socks5 my-network --listen :1080
# Access remote services through the tunnel
curl --proxy socks5://localhost:1080 http://192.168.1.100:8080
P2P Direct Transfer
Data goes directly between peers when it can, otherwise through the relay or TURN, sealed with AES-256-GCM on every path. The server handles signaling and, without a direct path, carries sealed records.
Cryptography Summary
🔐 AES-256-GCM / CTR
P2P transfers use AES-256-CTR stream encryption. A2A messaging uses AES-256-GCM authenticated encryption. Both provide confidentiality and integrity.
🔑 Per-Session Keys
Fresh keys derived for every session — X25519 ECDH for A2A (one handshake per hub and machine, kept up to 24 hours, with its own keys for each call), HMAC-based KDF for P2P, Curve25519 for WireGuard (end to end between client and exit). Compromising one session doesn't affect others.
🤝 HMAC Mutual Auth
P2P connections authenticate both parties via HMAC challenge-response before any data flows. Prevents man-in-the-middle attacks during handshake.
🌐 STUN NAT Traversal
P2P connections go direct when STUN-assisted NAT traversal succeeds (LAN, CGNAT, hairpin NAT), and fall back to the relay, still sealed end to end, when it does not.
🚫 No Server Session Keys
On TLS passthrough and P2P, the server never possesses session keys or plaintext data. TLS passthrough reads only SNI; P2P data reaches it, if at all, sealed. WireGuard packets pass through the relay sealed, and it holds no WireGuard key; with a pairing key on both ends it cannot swap in one of its own. A2A messaging is covered below, with its limits.
What's Encrypted
| Track | What's E2EE | What the server sees |
|---|---|---|
| TLS Passthrough | All HTTP/TCP traffic (agent terminates TLS) | SNI hostname only — opaque TLS bytes |
| WireGuard VPN | All tunnel traffic, end to end between client and exit (against a relay that swaps keys, with a pairing key) | Sealed WireGuard packets; which client connects to which exit, timing and sizes |
| P2P Direct | File contents, chat messages, call media | Signaling, and sealed records when no direct path works |
| A2A Messaging | Payload bytes (always; keyed with your machines' own keys) | Routing headers (agent IDs), timing and sizes — payload is ciphertext |
A2A messaging: what it protects, and what it does not
Agent-to-agent frames (nfltr a2a, and the hub, nodes and workers of nfltr orch) are always end to end encrypted with a key only your machines hold: a Noise handshake with fresh X25519 keys mixed with that key, then AES-256-GCM. There is no unkeyed mode.
- Any relay, watching or active, sees ciphertext: without the key it cannot complete a handshake, so it cannot sit in the middle, and it cannot replay, reorder or reroute frames.
- Where the keys come from: the hub makes its root key on first start; each other machine gets its own key derived from it, made by
nfltr node joinon the hub's machine or copied by you fromnfltr orch hub machines add <machine> --outonce that machine has signed in; see Join machines as nodes. A key never passes through the relay. Your account API key cannot do this job: the relay sees it on every request. - No downgrade: an end refuses unencrypted and unkeyed requests, the relay's own included; a command without a key refuses to start and names the fix.
- Not covered: metadata: agent and machine ids, labels, timing and message sizes. A hub refuses every task request from the relay's own agent and sends the relay no summary of its runs, so the dashboard shows none; runs stay on the hub's machine (
nfltr orch hub runs; see What the relay sees).
Trust Model
NFLTR uses a trust-the-server-for-routing-only model:
- Agents authenticate to the server (API key / machine certificate / mTLS)
- The server performs routing: SNI-based for TLS passthrough, IP allocation for WireGuard, signaling relay for P2P
- Subsequent data is encrypted end-to-end — the server relays opaque bytes it cannot decrypt (for WireGuard, against an active relay only with a pairing key; A2A is always keyed; see above)
Tunnel commands run in end-to-end encrypted verified mode by default, where the NFLTR relay cannot read your traffic on the verified host name (against a relay that lies, only for clients that check the agent's certificate: a pin, or its fingerprint compared out of band). Use --e2ee=false only when you intentionally need inspectable mode for debugging. If a CDN or reverse proxy terminates TLS in front of the relay, that edge is outside this guarantee.
Private by design
Two E2EE tracks - TLS passthrough and P2P direct - plus a WireGuard VPN, end to end between client and exit. Verified mode is the default for tunnel commands.
Install the CLI Agent-to-Agent →