§1
RoamSwitch is a Mac app that stays resident in the menu bar. Depending on how much it trusts the network you are currently connected to, it automatically switches the macOS firewall, sharing services, AirDrop and DNS. It also watches for ARP spoofing, ports opened to the outside, USB storage and ransomware-like encryption, and when it detects danger it goes as far as emergency isolation (Air-Gap), which blocks traffic with the packet filter (pf).
In other words, RoamSwitch keeps a root-privileged daemon resident and, if it wanted to, could stop all of the Mac's traffic. The developer is an individual, and the words "please trust us" alone cannot justify this privilege. So this document explains the design in a form that can be verified.
Who this is for
- Engineers deciding whether to install it
- Security researchers and journalists who want to understand the internals before a review or an article
- Security staff at partner companies evaluating an internal rollout or OEM bundling
What this document does not cover
It does not go into detection-threshold tuning, false-positive statistics, or UI walkthroughs.
What it explains is four things: privileges, process boundaries, data flow, and
cryptography. The feature specifications themselves are in the bundled MCP resource
roamswitch://docs/features and in the in-app help.
What is disclosed, and how far (disclosure policy)
This document is written on the assumption that an attacker already has the distributed binary.
Every endpoint URL, identifier, file path, XPC protocol, and embedded public key that appears here
can be pulled out of the shipping RoamSwitch.app in a few minutes with
strings, codesign -d, or a traffic proxy. Writing them down here therefore
gives an attacker nothing new. The only thing it advances is a reviewer's understanding.
On the other hand, server-side implementation that cannot be determined from the binary is not described. Rate-limit thresholds, keys, administration endpoints, the DB schema and the Firebase project configuration fall under this. The design of OEM and partner integrations is also outside the scope of this document and is handled in a separate internal document. "What can be learned by observing the client" is the line this document draws for disclosure.
This document corresponds to the source for the version noted at the top. Where behavior changes
in a later version, the document is revised and the version number and target build are updated.
If you find a discrepancy between the text and the code, please let us know at
lafine.net/contact.html.
§2
RoamSwitch.app is made up of three executables. Only one of them is privileged; the
other two run with login-user rights. All three ship with Hardened Runtime enabled, Developer ID
signed, and notarized.
| Executable | Privilege | Can do | Cannot do |
|---|---|---|---|
| RoamSwitch .app |
Login user | Monitor network state, run diagnostics, draw the UI, call the helper over XPC, change AirDrop via defaults, launch ClamAV (optional) |
Directly operate the firewall, pf, or system daemons (all of this goes through the helper) |
| RoamSwitch Helper |
root | Only the operations listed in HelperProtocol (§3 table): firewall/stealth, load/unload of the sharing daemons, applying the pf ruleset, changing DNS, sending signals to processes |
Anything else. There is no interface for running arbitrary commands. No network-send entitlement is declared, but because it is not sandboxed, that by itself does not forbid network traffic (outbound traffic is measured in §7) |
| RoamSwitch MCPServer |
Login user | Read and format diagnostic values, search the local knowledge base; results are returned to the client over stdio | Change settings, toggle lockdown, isolate a port, eject a device. By default it opens no socket and sends nothing over the network (the only exceptions are the default-off npm signature verification and the vulnerability scan aimed at this Mac itself, 127.0.0.1; see §8). No network-send entitlement is declared, but because it is not sandboxed, that by itself does not forbid network traffic |
Entitlements and signing
- All three targets have
ENABLE_HARDENED_RUNTIME = true. - App Sandbox is disabled (
com.apple.security.app-sandbox = false). The helper's and MCPServer's entitlements are empty dictionaries. - The distribution build is signed with Developer ID Application, notarized by Apple, and stapled (§10).
App Sandbox is not used. RoamSwitch needs to read the hardware UUID from IOKit, use CoreWLAN and
DiskArbitration, enumerate other processes' listening sockets (lsof), open an XPC
connection to a LaunchDaemon, and spawn system binaries. None of this is possible inside the
sandbox, so it is left disabled.
Four things compensate for that. First, Hardened Runtime. Second, Developer ID signing and notarization. Third, only one executable runs as root — the helper — and what that helper can do is fixed and enumerated (the §3 table). Fourth, connections to the helper are restricted by code signature (§3).
§3
How it is registered
The helper is registered as a LaunchDaemon with SMAppService.daemon(plistName:). The plist declares only Label, BundleProgram, one MachServices entry, and AssociatedBundleIdentifiers. It cannot be registered unless it is in /Applications, and the first time requires manual approval in System Settings.
Whose connections it accepts (ClientValidator)
The helper inspects the connecting process in NSXPCListener's
shouldAcceptNewConnection and hands out HelperProtocol only to those that
pass. The inspection uses the audit_token rather than the PID, to
avoid PID reuse and TOCTOU.
# Code-signing requirements the Release build demands of connecting clients
identifier "com.tetsuharu.RoamSwitch"
and anchor apple generic
and certificate leaf[subject.OU] = "GV76B6G4YU"
This requirement is checked with SecCodeCopyGuestWithAttributes and
SecStaticCodeCheckValidity, and the connection is dropped if it does not pass. Only
DEBUG builds drop the team-ID pin, for development convenience. What actually ships is always a
Release build.
The helper's safety rests on this single code-signing requirement. Anything that satisfies it (a
properly signed RoamSwitch.app) can call every operation in the table below. There is
no channel for feeding it arbitrary commands, but the operations in that table are not weak in
themselves. If RoamSwitch.app itself is taken over, these operations pass to the
attacker.
What the helper can do (the complete list)
The privileged operations defined in Shared/HelperProtocol.swift are all of them.
There is no privileged API that is not listed here.
| Method | What it does | Binary / API invoked |
|---|---|---|
| setBlockAll(_:) | Turns the application firewall and stealth mode on or off | /usr/libexec/ApplicationFirewall/ --setblockall / --setstealthmode |
| getBlockAllStatus(...) | Reads the current values of the above | socketfilterfw --getblockall |
| setSharingServicesEnabled(_:) | unload / load of the SSH / SMB / Screen Sharing daemons. When stopping, it records only "the ones that were running" and restores only those | /bin/launchctl list / unload -w / load -w (fixed to the three: ssh.plist / com.apple.smbd.plist / com.apple.screensharing.plist) |
| enableNetworkAirGap(...) disableNetworkAirGap(...) |
Applies and lifts the emergency full block (block drop all). Goes through PFRulesetCoordinator (§4) |
/sbin/pfctl -f / -e / -sr |
| setGuardedDevServerPorts(_:) | Uses pf to block only external connections to the given dev-server ports (localhost passes through). Passing an empty array lifts all of them | /sbin/pfctl (also via the Coordinator) |
| setSecureDNSServers(_:) restoreOriginalDNSServers(...) getCurrentDNSServers(...) |
Switches the DNS of active network services to malware-blocking DNS (Quad9 9.9.9.9 / Cloudflare 1.1.1.2), backing up the original settings and restoring them |
/usr/sbin/networksetup -listallnetworkservices / -getdnsservers / -setdnsservers |
| setLinkGuardSinkhole(_:) | Link Guard (§5). Writes the given phishing/scam domains into a delimited managed section of /etc/hosts as 0.0.0.0, then flushes the DNS cache. An empty array removes the section. Domains are normalized and de-duplicated; IPs and junk are dropped; capped at 60,000; written via a temp file + atomic replace |
rewrites /etc/hosts (FileManager.replaceItemAt)/usr/bin/dscacheutil -flushcache /usr/bin/killall -HUP mDNSResponder |
| lockGatewayARP(_:) unlockGatewayARP(...) getGatewayARPLockStatus(...) |
Preventive gateway ARP/NDP lock (§5). Pins the given IP → MAC mappings (the IPv4 gateway, the IPv6 default router, on-link DNS resolvers) as permanent neighbour-cache entries. IP and MAC formats are validated; a reconcile model (pins not in the request are removed). The pin set is persisted to gateway_arp_lock.json |
/usr/sbin/arp -s / -d /usr/sbin/ndp -s / -d |
| wireGuardImport(_:) wireGuardForget(...) |
VPN tunnel (§5). The helper saves / deletes the WireGuard .conf text at 0600 |
file write only |
| wireGuardUp(endpointIPv4:endpointIPv6:port:) wireGuardDown(...) wireGuardStatus(...) |
Bring the tunnel up / down / read status. The endpoint hostname is resolved by the app and the IP is passed to the helper (the helper's DNS can be cut by the kill-switch) | Homebrew wg-quick up/down, wg show (wireguard-tools; disabled if not installed) |
| terminateProcess(pid:forceKill:) | Suspends (SIGSTOP) or force-quits (SIGKILL) a process. Used to contain ransomware-like processes. pid > 1 only |
kill(2) system call (not a subprocess) |
| getHelperVersion(...) | Returns the helper's version string (used for app-compatibility checks) | — |
terminateProcess can send SIGKILL to any process, as long as
pid > 1. setSecureDNSServers accepts any DNS-server string. That is
the width the feature needs, but it is not narrow. Judge it with the understanding that the
code-signing check in front of it (ClientValidator) is the only gate.
State inside the helper
HelperTool.sharedis a single instance shared across connections. It used to be a separate instance per connection, so an emergency containment that opened a new connection could hit a race that lost track of "which services to bring back."- The sharing-service and DNS backups are only mutated on a serial queue (
stateQueue).
Privilege separation inside the helper, and the exception for reading the SSH log
Immediately after starting, the helper applies a kernel-enforced sandbox to itself, and child processes inherit it. It blocks replacing system programs, registering LaunchDaemons, rewriting sudoers, PAM and sshd settings, and running programs from writable locations. What it does not block are account changes via dscl and network sending and receiving.
Under this ceiling, /usr/bin/log does not run. The macOS 26 log does not work either inside the sandbox or as nobody, so it cannot read sshd's unified log. SSH brute-force detection needs this log, so one exception is made in the privilege separation.
The exception is a small root process that the helper starts with --ssh-log-reader before it enters the sandbox. It receives only a 1-byte start and stop, and launches /usr/bin/log with fixed arguments. There is no way to specify arguments or commands, and it streams the log to the helper without reading its contents.
Because the log contains strings an attacker can write, the root helper does not interpret the lines. Interpretation is done by an analysis worker that runs as nobody and is forbidden network access and writing. On a Mac with Remote Login disabled, log is not started. There are 5 SSH operations that can be called over XPC, and there is no way to pass an arbitrary command.
§4
Four features touch pf: the emergency air-gap, the dev-server port guard, the VPN tunnel's
WireGuard kill-switch (§5, 1.7.6+), and its Tailscale kill-switch (§5, 1.8.0+ — only the selected backend's). All of them always go
through a single entry point, PFRulesetCoordinator, and never run
pfctl -f themselves.
Why there is a single entry point
Previously, two features loaded rules separately with pfctl -f and fought over pf's main ruleset. As a result, the Mac could sometimes still be reached while showing "isolating". It was found in an attack test from another machine and fixed in 1.4.3.
How it works now
- Rebuilt in full every time. The entire required ruleset is rebuilt from the current state and applied in one shot. It is never applied as a diff.
- One serial queue. Every pf change runs on the same
DispatchQueue, so whether it came from an XPC connection, the helper's startup, or the failsafe timer, changes are processed in order. - The order of priority is as follows (higher items take precedence).
- Emergency air-gap →
set skip on lo0andblock drop all(nothing else is considered) - VPN kill-switch →
block drop allpluspass quickfor only:lo, the tunnel interface (utunN), the UDP handshake to the pinned endpoint IP(s), DHCP, and ICMP - Dev-server guard →
block drop in quick proto tcp ... port { … } - None → reload
/etc/pf.confand return pf to its original state
- Emergency air-gap →
- Read back after applying.
pfctl -srreads the rules back to confirm thatblock drop all, or each port's rule, is actually loaded. A case wherepfctl -fwas silently ignored is not treated as success. - The temp file is written to a path containing a
UUIDand deleted once applied (v1.4.5 dropped the fixed path in favor of a hard-to-guess one). The state directory is/Library/Application Support/RoamSwitch.
The XPC responses from enableNetworkAirGap and setGuardedDevServerPorts,
(Bool, String?), report whether the operation passed all the way through the
read-back. The caller (such as ARPSpoofContainmentManager) retries on failure, and if
it still fails it puts the message straight on screen: "Traffic is not stopped yet. Turn off
Wi-Fi now."
§5
The kinds of block are each different
| Kind | Scope | Trigger | loopback |
|---|---|---|---|
| Emergency air-gap | Stops all traffic, incoming and outgoing | When ransomware-like encryption activity is detected. On ARP-spoofing detection it fires immediately only in Lockdown; on Balanced / trusted networks it notifies instead (you trigger it manually). On a known-bad "ClickFix"-style command pattern in shell history, such as decoding base64 straight into a shell or AppleScript (1.8.7+, Pro, off by default). Not used for everyday away-from-home protection | Passed through with set skip on lo0 |
| VPN kill-switch | Everything except the tunnel, its handshake, DHCP, and ICMP | When the VPN tunnel (§5, Pro, off by default) is on and you join an untrusted network. Held until the tunnel is established (and while it is down) | Passed through with set skip on lo0 |
| Dev-server port guard | Only external TCP connections to the given ports | A one-click manual isolation, or automatic blocking when an unfamiliar listening port is detected (Pro) | From localhost, unchanged |
| Everyday untrusted-network protection | Firewall and stealth, sharing stopped (§6). pf is not used | When you connect to a network you have not registered | — |
| Link Guard | Only name resolution of phishing/scam domains (0.0.0.0 via /etc/hosts). pf is not used |
A destination on the threat feed, or a brand-name homograph. On by default (Pro) | Not affected |
| Preventive ARP/NDP lock | Only the MAC of the gateway, the IPv6 router, and on-link DNS (neighbour cache). pf is not used | On joining an untrusted network (Pro, off by default). Re-pinned on every network change | Not affected |
How the Air-Gap neither lingers nor can be waited out
- How it ends depends on what triggered it (1.9.52 onward). A tampered ransomware decoy, a confirmed XProtect detection and a manual isolation chosen from an ARP warning are "high confidence"; ClickFix, port anomalies and the like are "low confidence". A low-confidence isolation still releases by itself after 10 minutes at most. A high-confidence one does not release at 10 minutes: releasing fully on time alone would let an attacker simply wait it out.
- A high-confidence isolation stays fully closed up to a limit (1 hour by default, 5 minutes to 24 hours in settings) and checks the cause there. For ransomware it counts the cause as gone only when the suspect process was identified and has exited, and the decoys have not changed since the detection. If that cannot be confirmed it moves to "degraded mode": new connections stay blocked (except loopback and DHCP) while only the Wi-Fi radio is restored, so you can see what is going on. It never opens because time passed. It opens only when you release it or the cause is confirmed gone.
- When an isolation starts, connections that were already open are cut too. pf's state table is flushed (
pfctl -F states), which stops traffic that began before the isolation. The same happens when it moves to degraded mode. - An isolation caused by ARP spoofing is released automatically only when the cause is confirmed gone without any traffic. The check only reads the ARP cache (it sends no packets) and declares the cause gone when the trusted gateway MAC is seen on 3 consecutive checks spanning at least 60 seconds. While isolated, however, the gateway's ARP entry can disappear from the neighbour table (confirmed on a real Mac), and then the cause cannot be confirmed. In that case it stays in degraded mode until you release it.
- Even if the helper dies, the release check does not stop. A dedicated LaunchDaemon with no
KeepAliveat all (AirGapFailsafe) starts on its own every 3 minutes and applies the same decision as the helper (low confidence: release at 10 minutes; high confidence: check the cause at the limit, then degrade). If the helper itself crashes and loses its own release timer, this safety net is unaffected (1.8.6 onward; the confidence-based decision from 1.9.52). - This dedicated daemon never touches the interactive helper's own launch configuration. An earlier attempt (1.8.5) used the helper's own
KeepAlive.PathStatefor this recovery, but it occasionally interfered with a normal app Quit and caused an unintended restart, so it was reverted in favor of the current, fully independent daemon. - The timestamp check uses a hybrid of monotonic uptime (
ProcessInfo.systemUptime) and wall-clock time. It normally prefers monotonic uptime, so NTP corrections and manual clock changes don't affect it. It falls back to the wall clock only when uptime can't be trusted — right after a reboot, detected when the current value is smaller than the stored one. - It is re-applied after a restart or when the daemon is recreated. At launch the helper reads the on-disk state with
reapplyFromDisk()and restores the Air-Gap, the port guard and the system default, in that order. It also carries over the isolation's state (its confidence, full or degraded) and the elapsed time, so timing continues from the first time it engaged (confirmed on a real Mac by restarting the helper). - A failed lift is treated as a failure. If
block drop allcould not actually be removed, the timestamp is written back so that the failsafe timer and the retry have something to converge on. The screen never falsely shows "lifted." - You can take control back at any time: with "Release Air-Gap isolation" in the menu bar, with the release button in the modal, or simply by turning Wi-Fi off. Releasing does not require Pro (it works even if Pro lapses in the middle of an isolation).
How a port-guard false positive is recovered
Automatic blocking of unknown ports (Pro, on by default when enabled) can stop legitimate receiving apps such as LocalSend and Syncthing. You can lift it with "Allow" in the notification or from the "Externally exposed ports" screen, and an executable you have allowed is not blocked afterwards. General-purpose interpreters such as Python are identified by "executable path + port number", and standard daemons that satisfy anchor apple are not monitored.
Self-healing ransomware canary bait & containment suppression
After an emergency Air-Gap is triggered because a canary file (decoy) was tampered with or renamed, when you confirm it is safe and lift the isolation, the damaged or missing canary files are automatically regenerated from the app's genuine templates, and their hashes are also repaired. The kqueue real-time monitoring is not interrupted and resumes immediately (data altered by an attacker is never mistaken for the new baseline). While the emergency isolation is active (while the modal is shown), multiple firing and duplicate notifications caused by periodic integrity polling are automatically suppressed, so they do not get in the way of the user's confirmation or response.
General-purpose entropy-based ransomware detection — 1.10.0, Pro, on by default
It watches Documents, Desktop, Downloads and Pictures with FSEvents, and when 20 or more writes with entropy above the threshold (7.92) occur within 5 seconds, it automatically cuts off the network. Because it does not rely on decoy files, it can also catch encryption in places with no decoys. The process is identified with lsof and checked against an allowlist of tools such as cp and Time Machine.
It also counts files (16 KiB or larger) whose beginning (up to 8 MiB) split into 4 KiB windows has two or more windows at 7.9 or above, catching partial encryption. It is not applied to build artifacts, and encryption in blocks smaller than 4 KiB is not visible. In measurements, on 3,531 files this check added 0 detections, and in a simulation with 150 real files detection rose from 0–35% to 100%. This is not a confirmation against real ransomware.
The Linux edition can track bursts per process because fanotify attaches a PID to each write event. macOS has neither fanotify nor (by design) EndpointSecurity, so this implementation reads only the path from FSEvents and counts the burst globally, independent of process. Limitation: several legitimate processes writing large numbers of high-entropy files at once (concurrent compression or encryption jobs, for example) may be more prone to a false positive here than on the Linux edition.
Pre-damage snapshots for ransomware recovery (Mac)
Because the snapshot taken at detection time contains already-encrypted files, APFS local snapshots are also taken periodically, separately from detection (default every 6 hours; choose from off, 1, 3, 6, 12 or 24 hours). On detection, taking and pruning snapshots stops for up to 7 days, protecting the last pre-detection snapshot.
Recovery is manual: only the files you need are extracted to ~/RoamSwitch-Recovered/, current files are not overwritten, and the whole volume is not restored. macOS may delete snapshots automatically, and there is no guarantee they remain beyond about 24 hours. The recovery window is a Pro feature, and the pre-detection snapshots are taken in the free version too.
Forensic evidence bundle — 1.10.0
When an emergency Air-Gap starts, a background queue that does not hold up the isolation saves the process list (ps), connections (lsof -i), files changed in the last 5 minutes and more to ~/Library/Application Support/RoamSwitch/incident-evidence/<timestamp>/manifest.json, and records the SHA-256 of each piece of evidence. The manifest hash is also written, together with the previous line's hash, to chain.log outside the bundle.
The MCP get_forensic_evidence_bundles returns, for each bundle, whether it has been tampered with, and any chain breaks and missing bundles. This is detection, not prevention: someone who can rewrite both can create a consistent history. Limitation: because it does not use EndpointSecurity or similar, it takes no packet captures or memory snapshots.
When a containment by ransomware detection (decoy files, entropy) or by the XProtect link saves an evidence bundle, that save is added as a record under the detection record. In the Security Activity Log, the details of a record show "Triggered by" and the name of the evidence bundle. In the MCP tool get_incident_timeline for AI clients, parentEventID, rootEventID and evidenceRefs appear only on records that have a link (at most 8 references, holding only the bundle name, file name and SHA-256, never content). The manifest of the evidence bundle also records the id of the triggering record. A link is made only when the id of the triggering record is known, and nothing is linked just because the times are close. Containment after ARP spoofing creates no evidence bundle, so it has no linked records.
Process execution recorder (Mac, Pro, off by default)
The privileged helper launches macOS's standard /usr/bin/eslogger and records process launches only within this Mac. It does not apply for the EndpointSecurity entitlement, and Full Disk Access must be granted. While it is not granted, “Unavailable” is shown and it rechecks every 60 seconds. Notification only; it does not block execution, cut off communication or isolate.
Notifies on the following 14 behaviors.
Shell launched from a browser, Office or mail / execution of unsigned binaries from places such as temporary folders / one-line commands that download and pipe into a shell / osascript using base64 or eval / execution right after the quarantine attribute is removed / launch of an unsigned binary from a newly registered autostart entry / retrieval of keychain secrets by a parent with a non-Apple signature / one-line python3, perl and similar runs that decode and call curl and the like in one line (1.10.0 onward) / launches with DYLD_INSERT_LIBRARIES set (1.10.0 onward; this is the only environment variable read) / execution that directly references RoamSwitch's fake credential files / deletion or thinning of local snapshots by anything other than the OS and RoamSwitch / looking for 8 or more kinds of attack tools within 30 seconds / launch of 3 or more kinds of attack tools within 2 minutes by a script runtime or AI agent / command lines shaped like a reverse shell or bind shell.
Each detection carries a MITRE ATT&CK technique ID.
Execution of unsigned (or ad-hoc signed) programs is reported when they are launched from /tmp, /var/tmp, /Users/Shared, or from /var/folders/…/T/ (the TMPDIR). Executables that developer tools such as Xcode, Go, Swift and Cargo create in temporary folders are excluded.
It also evaluates Sigma rules placed in ~/Library/Application Support/RoamSwitch/sigma.d (a subset of category: process_creation). Unsupported rules are not loaded, and the reason is shown on the log screen. It does not fetch rules. A match only produces a notification and a timeline entry; it neither blocks nor changes settings.
Only high-severity detections become banners, and the same kind is grouped to once per 10 minutes (every event stays in the record). Developer tools such as Claude Code and the GitHub CLI reading their own credentials are not notified by default. If another program reads them, the "Allow this program" action in the notification allows just that item (by Team ID when it is signed, otherwise by executable name, paired with the item name).
Records are readable only by root (directories 0700, files 0600), and by default 200 MB and 14 days are kept. Environment variables are not stored, but arguments may contain secrets. A hash chain can detect rewriting, gaps and removal of seals. However, this is detection, not prevention, and deletion or rollback of the latest segment cannot be detected.
Limits: executions before the helper starts, or before recording is enabled, are not recorded. eslogger observes after the fact and cannot block. Under load such as thousands of process launches per second, events are dropped (the count is shown on screen and operation continues). This record is not a replacement for an EDR (endpoint detection and response).
Credential honeytokens — 1.10.0, Pro, on by default
It places fake credential files containing markers at ~/.aws/credentials, ~/.ssh/id_rsa_backup and ~/.docker/config.json. It never overwrites a real file that already exists. Access is detected with kqueue and a check of the access time every 30 seconds, and it only notifies, without blocking or isolating.
The names are chosen so as not to break the normal operation of ssh, AWS and Docker (0600 from 1.10.3). It also places them at ~/.pypirc and ~/.env.backup. ~/.npmrc and GCP credentials are not used as decoys because that would break legitimate operation. When there is access, it adds only one related decoy, and the chain stops at one step.
Reads of real credential files cannot be detected on the Mac. This is because it does not use EndpointSecurity and cannot reliably see which process opened them. It does not place fake files in places such as ~/.claude, which tools read every time. Instead, the overall diagnostic agent_credential_files checks the permissions and locations of AI agents' sign-in files using attributes only. It does not read the contents.
The notification shows the decoy file's path, the program that read it (path and PID), its parent process and the command (secret values are masked). If the reader has already exited and cannot be identified, it says so. When the process execution record is on, it also lists commands started around the time of the access: a command that names the decoy file is a strong clue, while one that merely started at the same time did not necessarily read it.
Browser credential-access watch — 1.10.0, opt-in even within Pro, off by default
Watches writes to the password and cookie databases of Chrome, Firefox, Arc and others via FSEvents, and detects processes other than the browser itself and backups (identified with lsof). For Safari, only the cookie file is covered, and only when Full Disk Access is granted. Unlike the other new guards, it is not turned on automatically when you enable Pro. False positives from extensions and similar software cannot be avoided.
Always-on reverse shell detection and network settings change watch (1.13.0, Pro, on by default)
Using libproc, reads the logged-in user's processes and their open file descriptors every 4 seconds. It uses no external commands and does not read the contents of communication. If it sees the same outbound TCP connection on the input/output of a shell, nc or similar twice in a row, it notifies you. It neither terminates nor blocks anything, and notifies at most once per 15 minutes for the same pair. Only connections to public addresses are covered; root processes are not examined.
On a network configuration change, reads the DNS servers and the router and compares them with what was previously seen on the same network. It uses no external commands and no communication. It notifies about a DNS server never seen before, a PAC, or a newly enabled WPAD, and notifies strongly when the router and DNS are new at the same time. It neither changes settings nor blocks anything; you add a legitimate change to the baseline manually from the menu.
Limits Both guards work only with a Pro license and turn off when the license is lost. A rogue DHCP server itself cannot be seen. Only the difference in the result is a clue. A rogue server that hands out the same DNS and router as before cannot be found. Tunnels such as a VPN, DNS servers set by hand or by a configuration profile, and DNS-over-HTTPS profiles are not compared.
Communication with the Sensor (TLS and signatures)
It connects to a RoamSwitch Sensor (a separate product) on the same LAN over TLS 1.3 with a pinned fingerprint (SHA-256) (Sensor 0.3.9 or later). The user enters the value from the Sensor's screen; it is not obtained over the network. It does not fall back to plaintext if TLS fails, and request signatures include a timestamp and a nonce. Only the old format without a fingerprint connects in plaintext, with a warning.
If the certificate changes, the connection is refused. The pin is not updated automatically; it is saved only when the user enters and confirms a new value and a signed probe actually succeeds over a TLS round trip. Limitation: this probe does not use a key to verify that the Sensor is the same one that was paired before. It presumes that the user enters the value confirmed on the Sensor's screen.
Multi-layer download detection (static signatures + ClamAV) — static signature layer added in 1.8.7
Files newly placed in Downloads, Desktop and Documents are first checked against static signatures (first 4 MB, simple byte-sequence matching only). It works without ClamAV. The signatures cover the EICAR test signature, whose accuracy can be guaranteed without a sample, and 5 well-known one-line reverse shells from public write-ups (/dev/tcp/ in bash/sh, nc -e, Python pty.spawn, Perl Socket, PHP fsockopen). We do not write byte sequences of specific malware families as signatures without a sample.
Only files judged “clean” by the static signatures are then scanned with ClamAV. They are scanned immediately, regardless of a .tmp extension or the presence of the com.apple.quarantine attribute. Test signatures such as EICAR are only recorded in the notification history; they are neither quarantined nor blocked. Even if a file with the same name exists, quarantine reliably uses a different name.
Web shell detection in development web folders (Web Rules)
Checks PHP, JavaScript and other files in local web development folders (~/Sites, MAMP, etc.) with the same 20 rules as the Linux version. The rules describe only publicly known techniques and contain no sample signatures.
Custom rules go in ~/Library/Application Support/RoamSwitch/rules.d (only files owned by root or yourself and not writable by others are read). Updates happen once a day and are receive-only. Development folders are checked once a day and manually. Detection is after the fact only; nothing is stopped before execution. In the PHP session folder, only sess_ files are read.
Automatic quarantine applies only to critical by default; high is reported without touching the file. The post-detection hook runs only files owned by root or yourself and not writable by others, with a 30-second timeout. Account action (off by default; enabling requires the administrator password) disables the owner's login shell, but does nothing for root, UIDs below 501, or logged-in users. The administrator password confirmation path has not yet been verified on a real machine. Detections across 114,501 files in development folders: 0.
Monitoring new login-item persistence (LaunchAgent/LaunchDaemon) — 1.8.7
Detects new .plist files in ~/Library/LaunchAgents, /Library/LaunchAgents and /Library/LaunchDaemons via FSEvents. The write itself cannot be stopped; it is noticed right after (within a few seconds) and its content is judged.
The key to the judgment is not the executable's signature but what it directly launches. A technique reported in 2026 puts the malice in the script itself and calls the legitimately signed /bin/bash or /usr/bin/osascript. So when a new LaunchAgent/LaunchDaemon directly launches an interpreter such as bash or python3, it warns even if the signature is valid, and also runs the arguments through the signatures. For BundleProgram registrations, only the codesign --verify --strict verification is done.
It also reads and checks autorun locations other than LaunchAgent every 5 seconds. These are shell startup files (such as ~/.zshrc), ~/.ssh/rc, periodic scripts, git hooks, login/logout hooks and Folder Action scripts. They are compared by the SHA-256 of their content, and the first pass only records.
It notifies on lines shaped like a reverse shell, decode-and-execute, download-and-execute, or execution of a program in a temporary folder, and on configured login/logout hooks. For startup files, SSH rc and git hooks, only newly added lines are examined. Writes cannot be stopped; it is detection only.
Detecting ClickFix and locking down in an emergency — 1.8.7, off by default
"ClickFix" is a social-engineering technique where a fake CAPTCHA or error screen instructs you to open Terminal and paste in a command "to verify." Detections surged more than 500% from 2024 to 2025, and by 2026 it's considered one of the most prevalent macOS attack vectors. Because it's your own, legitimate shell doing exactly what you typed, it slips past Gatekeeper's signature verification entirely.
Menu bar → “Malware Protection” → ClickFix protection (Pro, off by default). It watches lines added to ~/.zsh_history and ~/.bash_history after launch, and detects only one-line reverse shell commands and forms that decode Base64 and pass it to a shell or osascript. curl | bash alone is out of scope, because it cannot be told apart from official install instructions. On detection it triggers an emergency Air-Gap, which may stop further downloads or credential exfiltration in progress (automatically released after 10 minutes at most).
Known limitation. Because detection relies on the shell history, it cannot handle fileless variants that call Script Editor through an applescript:// URL without going through Terminal. Examining the unified log (log show/log stream) on a real machine also yielded no signal usable for judgment. We state this as a limitation rather than falsely claim support.
Docker Risk Detection Guard — 1.8.9, Pro, off by default
Menu bar → “Malware Protection” → “Detect privileged Docker containers and docker.sock mounts” (DockerEventGuard). Every 20 seconds it gets container IDs with docker ps -q and examines only newly started ones with docker inspect --format. Under the same conditions as the Linux version, it detects a --privileged launch or a bind mount of /var/run/docker.sock.
Even on detection, it does not block automatically. Privileged containers and docker.sock mounts are dangerous settings, but they are not confirmation of a compromise, and they have legitimate uses. Because few users need it, it is off by default even in Pro. It does not use the EndpointSecurity entitlement. It was tried with 3 patterns on a real Docker Desktop (29.7.2), confirming no false positives and no missed detections.
Secret/API-Key Leak Auditor — added in 1.8.4, folder scanning added in 1.8.9
Menu bar → “Malware Protection” → “Secrets and API key leak audit”. It looks for leaked API keys and tokens in pasted text or in a folder you select (1.8.9 onward, recursive), and shows line numbers, masked strings and recommended actions. It skips .git, node_modules and similar, as well as files over 2MB and binaries. Fully local; nothing is sent externally.
Link Guard (blocking phishing connections) — 1.7.2 and later, hardened in 1.8.0
Menu bar → "Malware Protection" → "Link Guard" (Pro). Blocks connections to phishing/scam sites on-device, across every browser and app. There are two enforcement points, used together in priority order.
- ① Content filter system extension (1.8.0 onward; takes priority once approved). It is a
NEFilterDataProviderextension and needs no application to Apple. It sees outbound TCP flows after name resolution. The destination name comes from the OS's resolved name or the TLS ClientHello SNI, so it can block even when the browser uses DoH/DoT. It does not rewrite/etc/hosts. QUIC (UDP/443) is dropped inblockmode, making clients fall back to TCP. Approval is needed only the first time. - ②
/etc/hostssinkhole (fallback, while the extension is unapproved/declined). The privileged helper writes the target domains into a delimited managed section of/etc/hostsas0.0.0.0and flushes the cache. Capped at 60,000. Once the extension is active this section is removed. - Three modes. "Off" disables it. "Ask first (block if no answer)" pauses the matching connection, asks the user and blocks it if there is no answer (see Real
warnbelow). "Auto-block obvious scam sites (recommended)" drops immediately. The default is block as of 1.7.2. - Real
warn(1.8.0 onward, extension only). With.pause(), it holds the matching flow, and the app shows an “Allow/Block” notification. When the chosen result arrives (the extension checks every 1.5 seconds), it lets the flow through or drops it; if there is no response for 25 seconds, it lets it through. The decision is remembered per host (Allow 5 minutes / Block 1 hour). The “Allow this time (5 minutes)” ofblockends after 5 minutes even if the app is restarted. - Only clear cases are blocked. A listing on the threat feed, or a brand-name Unicode homograph — everything else (high-risk TLDs, subdomain impersonation, …) is a warning. The verdict engine is shared with the Linux edition and sends URLs nowhere.
- Connections to external servers used for diagnostics (OAST) are notification only. It notifies when the destination is an OAST server such as
interact.shoroast.pro, or a subdomain of one. These are destinations that SSRF and RCE testing tools use to confirm success, and ordinary apps rarely connect to them. The connection is not stopped, and not held even in warn mode. Notifications for the same host are limited to once per hour. It does not notify when there is no system extension or when link protection is off. - Recovering from a wrong block. Allow a domain from the notification or the menu (5 minutes or permanent). The allow-list is subtracted when the section is regenerated.
- Pro-gated. Enforcement (
applyMode()) only happens on a valid Pro license. Without Pro the mode is stored but/etc/hostsis never touched. Activating or lapsing a license takes effect mid-session. - Feed and bundled seed. The block list comes from the signed threat feed (§7, verified with a feed-dedicated key). It works on the app's bundled seed (~60,000 entries) even before the first fetch, and turning off "Auto-update" means no outbound traffic.
Preventive gateway ARP/NDP lock — 1.7.5 and later
Menu bar → "Port & Device Monitor" → "Pin the gateway's ARP/NDP on untrusted networks (preventive)" (Pro, off by default).
- How it works. When you connect to an untrusted network, it collects the MACs of the IPv4 gateway, the IPv6 router and the DNS resolver on the same link, and the helper pins them as
permanententries witharp -s/ndp -s(TOFU: trust the first MAC seen). From then on, forged ARP/NDP replies are ignored, and man-in-the-middle attacks are prevented before they happen. - Scope. Only those three kinds of entry are pinned. Trusted (open) networks are never pinned. On every network change it unlocks once and re-pins. Off-link public resolvers (8.8.8.8, …) have no on-link ARP entry and are automatically excluded.
arp -sis preventive; the air-gap is after the fact. This pin exists so a spoof can't succeed; ARP-spoofing detection (ARPSpoofContainmentManager) and the emergency air-gap exist to "cut faster than a human" once one is seen. They run independently.- Persistence. The pin set is saved to
/Library/Application Support/RoamSwitch/gateway_arp_lock.jsonso it can be unlocked across an XPC reconnect or a helper restart.
The VPN tunnel (WireGuard / Tailscale) and its kill-switch — 1.7.6 and later, selectable backend in 1.8.0
Menu bar → "Port & Device Monitor" → "VPN Tunnel" (Pro, off by default). This is the primary anti-MITM defense — it does not depend on the integrity of L2 (ARP/NDP). The backend is selectable (submenu → "Backend") between "WireGuard (config file)" and "Tailscale (Exit Node)". RoamSwitch implements no cryptography itself; only the chosen backend is armed.
- (A) WireGuard backend. It does not use Network Extension and calls Homebrew's
wireguard-tools. The helper stores the imported configuration (.conf) with0600. The kill switch is pf'sblock drop all, letting through only loopback, the tunnel, UDP to the endpoint, DHCP and ICMP. It warns about configurations that are not full-tunnel. - (B) Tailscale backend (1.8.0+). RoamSwitch does not log in or install anything. It only reads
tailscale status --jsonand runstailscale set --exit-node=<node>. The Standalone version with CLI integration is recommended. With the App Store version, you choose the Exit Node in the Tailscale app. An Exit Node is required, and it is cleared automatically if it cannot be reached. - ⚠️ The Homebrew version (
brew install tailscale) is not recommended. It has a known bug that prevents it from rewriting macOS routing correctly (tailscale/tailscale#21395, #21216), so traffic may leak even when it reports success, or the connection may be lost when the exit node is released. RoamSwitch checks the actual routing and warns you, but the Standalone version avoids the problem. - Network reconfiguration on disconnect. The standalone macOS
tailscaleddoesn't cleanly restore routing + DNS when an exit node is cleared, so RoamSwitch bounces the active network service(s) (the same as toggling Wi-Fi by hand; only services with an IPv4 address, safe for multi-NIC and static-IP). Traffic drops for ~5–10 s and the protection level is not demoted during that window. - The Tailscale kill-switch is off by default (opt-in). The exit node already tunnels everything; the pf
block drop all(permits only CGNAT/MagicDNS/STUN/DERP/DHCP/ICMP/DNS) is for advanced users and is "leak-resistant, not leak-proof" (DNS is allowed sotailscaledsurvives). - Automatic / on license loss. Comes up on untrusted networks, down on trusted ones; lifted when the Pro license lapses.
§6
When you connect to a network you have not registered, the "protection level" switch does not use pf. It simply changes standard OS settings in a way that can be reversed later.
| Operation | Implementation | Privilege | How it is restored |
|---|---|---|---|
| Firewall + stealth mode ON | socketfilterfw --setblockall on / --setstealthmode on | root (helper) | off when you return to a safe network |
| Stop SSH / SMB / Screen Sharing | launchctl unload -w | root (helper) | Records only the ones that were running when stopped, and load -w on return (with SSH also coupled to /usr/sbin/systemsetup -setremotelogin on for guaranteed modern macOS restore) |
| Disable AirDrop | defaults write com.apple.sharingd DiscoverableMode | User (the app itself) | Saves the previous value and writes it back on return |
None of this is a new blocking mechanism that RoamSwitch adds — it is just toggling OS settings. If you delete the app, the only thing that stops is the network-dependent switching; the last OS settings that were applied stay as they are. Nothing is left locked, but if you want to err on the safe side, set it back to "Open" on a trusted network before uninstalling.
§7
What stays on the Mac
| Data | Location | Contents |
|---|---|---|
| License token | Keychain com.tetsuharu.RoamSwitch.license | An Ed25519-signed token. kSecAttrAccessibleAfterFirstUnlock |
| App settings / guard on-off | UserDefaults suite com.tetsuharu.RoamSwitch | Trusted-network registrations, protection policy, exclusion lists, and so on |
| pf state | /Library/Application Support/ | The air-gap timestamp, JSON of the guarded ports, the VPN kill-switch state, the temp file for the ruleset being applied |
| Link Guard threat feed | ~/Library/Application Support/ | The downloaded phishing/scam domain list (or the app's bundled seed if not yet fetched). The feed version is in UserDefaults |
| Link Guard managed section | /etc/hosts | A delimited section bounded by # BEGIN RoamSwitch link guard … # END, nulling blocked domains to 0.0.0.0. Removed when the mode is "Off" (§5) |
| ARP/NDP lock pins | /Library/Application Support/ | The IP → MAC set made permanent by the preventive lock (§5). Deleted when unlocked |
| WireGuard config | /Library/Application Support/0600) | The .conf the user imported. The endpoint hostname is also stashed in UserDefaults (the app resolves it) |
| Device fallback UUID | UserDefaults | A random value, generated only when IOKit does not return a UUID (§9) |
| Logs | os.Logger / NSLog | Unified logging. Nothing is sent externally |
Traffic that leaves the machine (the complete list)
There is no code anywhere that collects and sends diagnostic results, port information, URLs, or logs. No analytics SDK or crash reporter SDK is included. The only external library is Sparkle (updates). The only network traffic is the 9 paths in the table below, plus the user-initiated features, default-off features, and DNS threat protection described under the table (the 6th applies only if the user has configured a VPN, the 7th only if RoamSwitch Sensor pairing is enabled, and the 9th only if event forwarding is enabled and a destination is entered).
| Connection | Destination | When it happens | What is sent |
|---|---|---|---|
| License activation / deactivation | lafine.net /api/v1/license/* |
Only when the user enters a license key, or deactivates Pro | License key, device hash, device name (the "Name" in System Settings), and app version. On release, only the key and device hash. Personal information is handled by Stripe at purchase; the app does not handle it |
| Update check | lafine.net /updates/appcast.xml |
Sparkle checks every 24 hours (and also at launch if 24 hours or more have passed since the last check). Always enabled by default; no system information is sent | An HTTP request (a standard UA and version). The downloaded item is verified by EdDSA signature (§10) |
| Link Guard threat feed | lafine.net /updates/v1/{manifest, feed/<version>.txt} |
In the Pro version, when Link Guard's "Auto-update" is on (the default): every 24 hours (and at launch). Turning "Auto-update" off removes this path | A GET only. No query string, no cookies, nothing that identifies the machine (the standard User-Agent includes the app name and version, and the macOS version). A receive-only signed static file; the manifest and the feed body are both verified with Ed25519. The signing key is dedicated to the feed and is a separate key from the app-update SUPublicEDKey (so a leak is confined to "a bad blocklist") |
| Package CVE Scan / active-vulnerability-scan update data | lafine.net /updates/v1/manifest |
Checks run every 24 hours, and the actual download happens once a week (also at app launch if 7 or more days have passed since the last download). The KEV list, however, is downloaded daily. The update data for package CVE matching is always downloaded. It is receive-only data used only for local list matching, there is no setting to turn it off, and it applies to all users, including the Free edition. The CVE map for proof-based vulnerability scanning is downloaded only if you enable “Proof-based vulnerability scan (active reachability check)” | GET only. There is no query string, cookie, or device-identifying information (the standard User-Agent includes the app name, version, and macOS version). These are receive-only signed static files, and the manifest and the feed itself are verified with Ed25519. The key and manifest are shared with the link-protection threat feed, but the feeds fetched are separate files (known CVE maps for Homebrew/npm/PyPI/crates.io/RubyGems/Packagist/Go/Maven, the CVE map for proof-based vulnerability scanning, and a list of popular npm package names for typosquatting detection) |
| ClamAV virus-definition update | ClamAV official mirrors | When the user has installed ClamAV. In the Pro version it launches freshclam automatically at launch, every 24 hours, and during autonomous patrols; in the Free version only when the menu item "Update Virus Definitions" is pressed |
A standard ClamAV definition fetch. It contains no RoamSwitch-derived information (ClamAV's own standard identifying information may be included) |
| VPN tunnel (§5, WireGuard / Tailscale) | The WireGuard endpoint the user configured, or the Tailscale control plane (Tailscale, Inc.) | Only when a VPN tunnel (Pro, off by default) is configured and you connect to an untrusted network. With WireGuard, the endpoint host name is resolved via DNS once before the tunnel starts. With Tailscale, the control-plane traffic comes from the tailscaled that the user installed and logged in to; all RoamSwitch itself does is read tailscale status --json and run tailscale set --exit-node= | With WireGuard: the WireGuard handshake (UDP) and the traffic inside the tunnel. The destination is the user's own VPN server and the contents are the user's own traffic. With Tailscale: traffic between the user's own Tailscale account and Tailscale, Inc.'s control plane (device registration, DERP relay, etc., governed by Tailscale's own privacy policy). In either case RoamSwitch adds no identifier and no diagnostic data |
| RoamSwitch Sensor pairing & audit link | RoamSwitch Sensor on the same LAN (hardware the user has set up themselves, running at a fixed IP) | Only when “RoamSwitch Sensor Pairing” (Pro, off by default) is enabled and you enter the Sensor’s IP address and pairing code to pair (a one-time exchange). After pairing, it connects to that same fixed IP again only when you press “Request Audit from Sensor,” and during automatic result retrieval (starting 5 minutes after the request, then every 5 minutes, up to 5 attempts) | Pairing sends this endpoint’s hostname and Ed25519 public key, and receives the public key Sensor issued. Audit requests and result retrieval are authenticated with an Ed25519 signature — only signed requests are sent. Diagnostic results and port information are only ever received as Sensor’s response; file contents are never sent. The only destination is the fixed IP address of the Sensor the user set up themselves — it never reaches any external server, including lafine.net. Mutual trust is only established through the explicit pairing-code exchange |
| Checkout page | Stripe Checkout | Only when the user presses the buy button (it opens in the browser) | — (a browser navigation) |
| Event forwarding (SIEM, syslog, webhook) | The syslog server or webhook address the user typed, or a file the user chose | Only when "Event forwarding" (Pro, off by default) is turned on and a destination has been typed. Unless it is turned on, this path has no thread and no socket | Only these fields of the incidents and notifications RoamSwitch recorded: host name, event ID, time, kind, severity, rule, action taken, process ID and name, and a summary (up to 1024 bytes). File contents, the screen and typed text are not included. The destination is under the user's own control and nothing reaches the developer's servers, lafine.net included. TLS checks the certificate chain and the host name and sends nothing if they cannot be verified. The webhook address and the HMAC key are kept in the Keychain and handed to curl on standard input, not as arguments |
“Zero Telemetry” means no telemetry that collects and sends usage or diagnostic results. It does not mean no network traffic at all. The 9 paths in the table above and the features described under the table do exist. Each is either traffic triggered by a user action, a signature-verified receive-only download, or traffic with an external service the user chose (the ClamAV distribution source, the protective DNS provider, the URL being checked, and so on). Diagnostic results, ports, and file contents on the Mac are never sent to the developer.
The link-protection threat feed (row 3) adds a “receive-only update” to the “send nothing” policy. Linux whitepaper §1.1 also separates “Zero Telemetry” from “receive-only updates”. If you turn off “Auto-update”, link protection works with only the bundled data (about 60,000 phishing/scam domains) and offline homograph detection, and this path does not occur.
The VPN tunnel (row 6) only happens if the user configures their own WireGuard server, or chooses the Tailscale backend and is already logged into tailscaled with their own Tailscale account; the destination and the contents are under the user's control. RoamSwitch only brings the tunnel up, holds the kill-switch, or reads Tailscale's status to switch the exit node — it adds no identifier and no usage data. Without a VPN configured, this path does not exist.
RoamSwitch Sensor pairing (row 7) is a Pro-only feature that is off by default; this path does not exist unless you enable it. Pairing itself is only established through an explicit action — entering the pairing code the Sensor’s operator issued together with the Sensor’s fixed IP address. Every subsequent communication (audit requests, result retrieval) is likewise addressed to that same user-owned fixed IP and authenticated with an Ed25519 signature. It never reaches any external server, including lafine.net. Diagnostic results or file contents are never sent, other than as Sensor’s own response.
Event forwarding (row 9) is a Pro-only feature that is off by default; unless it is turned on and a destination typed, this path does not exist. Only the fields listed in the row's content column are sent, and the destination is a SIEM, syslog server, webhook or file the user controls. Nothing reaches the developer's servers. An incident includes the name and ID of the process involved, so the administrator of the destination can see them. If that is not wanted, leave the feature off. Events that could not be sent are kept, for TCP, TLS and the webhook only, in a queue on this Mac's disk (0600) and retried at growing intervals.
There are 5 kinds of traffic not in the table, and none of them sends diagnostic results or file contents to the developer. (1) While Pro DNS threat protection is active (by default, when away from home or on an untrusted Wi-Fi), queries go to one of Quad9, Cloudflare, AdGuard, or CleanBrowsing. (2) Pro npm signature verification asks the npm registry each time. (3) Proof-based vulnerability scanning only targets 127.0.0.1. (4) The HEAD request of the link safety check is described in the paragraph below. (5) “Domain check” runs only when you press it, and queries the domains you entered (up to 20) to a DNS resolver, the TLD's RDAP server, and, if there is an MX, the mta-sts host.
The in-app “Link safety check” sheet sends a HEAD request to the target URL to see where a shortened URL leads (following to private or local addresses was stopped by the SSRF protection in v1.4.5). The MCP audit_url_safety, on the other hand, is an offline analysis that completes on the spot and sends the URL nowhere (§8).
On 2026-08-29, I audited the running 1.4.7 for about 2 hours with tcpdump, nettop / lsof, and LuLu (maximum lockdown, appcast check forced). Result: the only outbound traffic from RoamSwitch's 3 processes was the appcast check to lafine.net. The MCP server's sockets were localhost only. The entitlements dump was empty. Paths added since then are in the table above, and a re-measurement of the current version is planned.
Full write-up and a script anyone can run to reproduce it: audit/RESULTS-2026-08-29.md
Since then, the threat feed (1.7.2, row 3 above), the VPN tunnel (1.7.6, row 6), the update data for package CVE matching (row 4), Sensor pairing (row 7), and others have been added. In the current version you see receive-only GET requests to lafine.net, and, when a VPN is configured, UDP to your own WireGuard server. The threat feed disappears with “Auto-update: off” and the VPN with “VPN not configured”, but the appcast and the update data cannot be turned off.
§8
RoamSwitchMCPServer is a standalone command-line tool bundled in RoamSwitch.app/Contents/MacOS/. An MCP client such as Claude Desktop launches it as a subprocess and communicates over stdio (newline-delimited JSON-RPC 2.0).
What the design constrains
- There is not a single tool that changes settings, defenses, ports, or devices. The only writes are when 3 tools update their own records (diagnostic history, log baselines and notification history, and npm's own cache and logs). So that an LLM cannot change defenses, APIs for changing the level, isolating ports, or ejecting devices are deliberately not provided.
- It opens no listening socket. It neither registers a service nor listens. It reads one line from stdin, returns one line on stdout, and then the client ends the process.
- No telemetry is sent. The only outbound traffic is the opt-in (Pro only on Mac) run_npm_audit_signatures (npm registry). In the Linux Server Edition, only for domains the operator wrote in domain_check_domains, the diagnostic queries the DNS resolver and the TLD's RDAP server, and if there is an MX it also reads the MTA-STS policy file. run_active_vuln_scan (disabled by default), the Mac's get_exposed_ports (one HTTP GET per port), and the Server Edition's web check go to 127.0.0.1. The Mac's 4 diagnostic tools may send a ping, usually 1 (at most 3), to check the gateway's MAC. On Linux, only get_guard_status may send 1.
- Settings are read from a different domain. It explicitly specifies the app's domain with
UserDefaults(suiteName: "com.tetsuharu.RoamSwitch")and reads from it (the domain for its own bundle ID is empty). It only reads and never writes.
The tools it exposes
| Tool | What it returns | Traffic |
|---|---|---|
| get_security_report | A 23-item check (FileVault / SIP / Gatekeeper / auto-update / XProtect / firewall / Wi-Fi encryption / ARP / gateway ARP pinning / SSH configuration audit / sudo NOPASSWD audit / exposed ports / proxy auto-discovery / AI agent credential files / backup / likely-exploited vulnerabilities / guard configuration, and more) with a score and per-item remediation advice. Each item also carries the corresponding NIST CSF 2.0 and CIS Controls v8 control IDs (1.10.0 onward). | Local only (a ping may be sent to the gateway on the LAN to look up its MAC address; Linux get_security_report and verify_security_findings send none) |
| verify_security_findings | Re-evaluates the items of get_security_report against the current state and returns one of stillPresent, resolved or inconclusive, with a reason. Use it to confirm that a fix took effect. Items that cannot be measured are never treated as safe and become inconclusive. Omitting checkIds covers all items (up to 50 on Mac and 64 on Linux). Some Mac items depend on in-app setting values. It is read-only and performs no repairs or setting changes. The result includes verificationStatus and rationale, plus counterEvidence and severityChangesIf if the item still applies. | Local only (a ping may be sent to the gateway on the LAN to look up its MAC address; Linux get_security_report and verify_security_findings send none) |
| audit_mcp_configs | Reads the MCP configuration files of AI clients (Claude Desktop, Cursor and others, plus .mcp.json in registered folders) and flags auto-approval without confirmation, plain-text http://, unpinned npx versions and similar. It is read-only and sends nothing. It returns no values or secrets, only items such as server names. Files that cannot be parsed are listed in unreadableFiles. | None |
| audit_agent_setup | Reads the instruction files, skills and settings of AI agents (Claude Code, Codex and others), plus VS Code tasks and GitHub Actions in registered folders, and flags text hidden with invisible characters, instructions that fetch and run content as is, overly broad permissions and similar. A match is a place to check, not a verdict of malice. It is read-only, sends nothing and returns no body text or secrets. With format=sarif it returns SARIF 2.1.0. | |
| get_detection_coverage | For each MITRE ATT&CK technique used to weaken defenses, erase traces or persist, it returns whether detection is possible (detects / partial / none), what is not visible (blindSpot) and the guard state (liveState). It runs nothing and sends nothing. none does not mean there was no attack, and liveState is not proof that a guard is working. With format=navigator it returns an ATT&CK Navigator layer (4.5). | None |
| get_exposed_ports | A list of listening TCP ports. For any exposed beyond localhost, it cross-references a known-dangerous-service DB and sends one HTTP GET per exposed port to 127.0.0.1:port (local, closed) to check CORS / headers | The probe to 127.0.0.1, plus a ping to the gateway (Mac) |
| get_guard_status | The on/off state of the Pro auto-response guards (port anomaly / ARP / USB / Bluetooth / Web+Mail download / DNS threat protection), the current protection level, and the trusted-network state | Local only (a ping may be sent to the gateway on the LAN to look up its MAC address; Linux get_security_report and verify_security_findings send none) |
| audit_url_safety | Judges URLs for phishing, homographs (Unicode spoofing), brand-subdomain spoofing, high-risk TLDs, and plain HTTP. It is synchronous and fully offline (analyzeURL; redirects are not followed). Defanged forms found in threat reports (such as hxxps://evil[.]example/login) are restored to the original address before judging. | None |
| get_app_help | A full-text search of the bundled knowledge base (feature specs / settings / troubleshooting / notification-message explanations) | None |
| audit_secrets | Detects leaked API keys and private keys in text, files, and directories (detected values are output masked). For directories, setting the optional argument include_build_output (boolean) to true also reads folders of publicly served front-end output such as dist and build, which the recursive scan skips (buildOutput is added to the result). | None |
| audit_security_logs | Aggregates recent security logs (Sudo authentication failures, SSH brute force, firewall blocks, and so on; on Mac also Gatekeeper and XProtect, on Linux also AppArmor and ClamAV) and returns them with secrets such as API keys and tokens masked. It also includes detection results for new patterns and frequency anomalies (statistical spikes). On Linux, when the journal could not be read, it does not treat 0 items as “nothing happened”; it sets journalReadComplete to false and puts the reason in journalError. | Local only |
| run_active_vuln_scan | A non-destructive vulnerability check that targets only 127.0.0.1. Because it is a tool that sends network requests, it is disabled by default. On Mac it also lists the side effects of each check (sideEffects in probesRun, such as more than 5 requests to one port). Findings distinguish what was confirmed (confirmed) from cases where only the version is in the affected range (version_range_match). | 127.0.0.1 only (off by default) |
| run_package_cve_scan | Checks installed packages (Homebrew / dpkg, dnf, and so on) against the local CVE map. It makes no network connections. If the list cannot be obtained, it sets complete to false. For Ubuntu (20.04 to 26.04), it checks only CVSS 7.0 and above that have a fixed version, so “no match” does not mean there are no CVEs. On Mac, results are ordered by severity and then EPSS (epss). For findings a person has accepted, it returns the count (acceptance); acceptance cannot be done through MCP. | None |
| run_package_cve_scan_languages | Checks dependency lockfiles for npm, PyPI, crates.io, and others against the same local CVE map. It makes no network connections at all. | None |
| run_package_lifecycle_script_scan | An inventory of the scripts in the package.json files under node_modules that run on every npm install (preinstall, install, postinstall, prepare). Forms such as curl | sh, eval, and base64 -d get isDangerPattern, and anything added after the confirmed state appears in drift. Registered folders are checked automatically when lockfiles and similar files change, right after startup, and once a day, and similarly named dependencies are also examined (nothing is sent or run). Only a person, from the screen, can mark a state as confirmed. This is a Pro feature and is enabled by default. | None |
| run_dependency_source_scan | Flags settings that allow dependency confusion (an attack in which a public package with the same name is installed in place of an internal one). It covers pip extra-index-url (requirements*.txt, pip.conf, pyproject.toml, uv.toml) and npm lockfiles where .npmrc does not pin the source for an @scope. The absence of a setting that avoids just-published versions is also shown as “Low” (a note that the defense is missing). It only reads files, runs nothing, and does not query the registry. Pro only. | None |
| get_quarantine_status | Returns the malware quarantine vault's contents: original path, detected threat name, quarantine time and size. | Local only |
| get_canary_status | Returns the ransomware canary's decoy-file state plus up to the 50 most recent detected incidents. | Local only |
| get_ransomware_recovery_snapshots | Returns the APFS recovery snapshots (pre-damage, detection, manual), the recommended one to recover from, the retention-mode state and the snapshot interval. A detection snapshot may already contain encrypted files. Pro only. | Local only |
| search_exec_events | Searches the process execution record (eslogger) by path, arguments or signing ID, and returns the recorder's state and whether the record is readable. Pro only. | Local only |
| get_process_tree | Builds the ancestors and descendants of a process from the execution record. Pro only. | Local only |
| get_notification_history | Returns the history of notifications RoamSwitch has sent (security log-audit anomalies, ClickFix detections, and the like) from the past 7 days, most recent first. | Local only |
| get_port_anomaly_incidents | Returns the baseline status of the port anomaly guard, the ports currently auto-blocked, and up to the latest 50 incidents. Auto-blocked ports are a current state with no timestamp, and are distinct from the timestamped incident history. This distinction is written in the annotation field of the response. | Local only |
| get_ssh_guard_incidents | Returns the state and records of the SSH brute-force guard. It includes whether it goes as far as banning or only detects, the sources currently banned and the time remaining, and the latest records (up to 200). Attempted usernames are not stored on Linux and only counted; on Mac they are sanitized and returned, up to 5. It is read-only, and there is no MCP tool to lift a ban. Available on Linux with the Server Edition and with the Client Edition when sshd is running, and on Mac with the Pro version. | Local only |
| get_runtime_threat_status | Returns whether an Air-Gap isolation triggered by XProtect malware detection has occurred, and the incident that triggered it. When investigating the reason for an Air-Gap, use this tool first. | Local only |
| get_ransomware_entropy_guard_status | Returns whether generic entropy-based ransomware detection is enabled, and the most recent burst-detection incidents (on Linux, the latest 50: time, pid, process name, affected files, average entropy, and whether the writer was frozen). If the stored file cannot be read, incidentsReadable is false, and an empty list does not mean “nothing detected”. Other users' home paths are shown only to root and administrators. It does not communicate. | Local only |
| get_honeytoken_status | Returns whether the credential honeytokens are enabled, and the most recent access-detection events. On Linux it also returns where the decoys are placed, the state of the monitoring process, and the latest 50 accesses to the decoys (time, kind, path, suspicious process). If the records cannot be read, eventsReadable is false, and an empty list does not mean “no access”. Other users' home paths are shown only to root and administrators. It does not communicate. | Local only |
| get_browser_credential_watch_status | Returns whether the browser credential-access watch is enabled and its recent access-detection events. | Local only |
| get_forensic_evidence_bundles | Returns the list of forensic evidence bundles (process list, network connections, modified files, and the like) saved when an emergency Air-Gap fired. It also returns, for each bundle, integrity (verified, manifest_altered, artifact_altered:name, artifact_missing:name or not_anchored), and overall chainOk and chainBrokenAt, and missingBundles for bundles that are in the chain but gone. This detects tampering; it does not prevent it. | Local only |
| get_vulnerability_scan_history | Returns the last recorded result and days elapsed (pass_age) for each probe that run_active_vuln_scan has recorded. | Local only |
The instructions of initialize also tell the LLM “Cannot change security level, isolate ports, or eject devices”. MCP resources (roamswitch://docs/*) are read-only Markdown, and since 1.10.0 there are also triage procedures (roamswitch://skills/*, 4 of them, English only). For annotations, readOnlyHint is false only for the 3 tools that write to record files, destructiveHint is false for all tools, and openWorldHint is true only for run_npm_audit_signatures.
In September 2026, we had a local LLM (Qwen 3.8 27B) investigate an incident through this MCP server. The model misread the result of get_port_anomaly_incidents and tied a past port block to an ongoing incident. The cause was that the server returned a snapshot with no timestamp and a timestamped history without distinguishing them. After we added an annotation, the same model refused to make that link. We confirmed this with a regression test and a rerun on a real machine.
The source of this server and of the detection logic such as ARP monitoring, port diagnostics, and the 23-item health check is published at github.com/lafine1211/roamswitch-mcp (MIT, a mirror of the shipped code, tagged per release). You can verify in code that there is no tool that changes defenses, what is passed to the LLM, and what communicates externally. The privileged helper, pf control, the blocking guard, and licensing are not included.
The tests ship with it too — mirrored unit tests, adversarial-input tests, and mutation fuzzing,
run by swift test and verified in CI. Fuzzing turned up one unguarded crash
(JSONSerialization stack-overflows on a deeply-nested JSON object); it is fixed with
a nesting-depth check ahead of the parser, and recorded in SECURITY_TESTING.md.
§9
The token
- It uses Ed25519 (Curve25519 signatures). The public key is embedded in the app (
LicenseVerifier.embeddedPublicKeyBase64). The corresponding private key exists only in the license backend (a Firebase Functions environment variable) and is not in the repository. - The signed data is canonical JSON. The signature is created and verified over the exact bytes produced by encoding
LicensePayload(license key, tier, device hash, issued-at, expiry, seat count) withJSONEncoder's.sortedKeysand.withoutEscapingSlashes. - It is designed to fail closed. If the embedded key is missing or malformed, or if the signature or the canonical JSON cannot be produced, the result is not "verified" — it returns
invalidSignature.
Device binding
device_hash = SHA-256( "RoamSwitch-LifetimeSalt-v1" : lowercase(IOPlatformUUID) )
The raw hardware UUID is not sent to the server. In the rare case where IOKit does not return a
UUID, it falls back to a random UUID kept in UserDefaults. At verification time, if the
token's device_hash does not match the current device hash, the result is
deviceMismatch.
It works offline
All validateSavedLicense() does at startup is read the token from the Keychain and
verify it locally with the embedded public key. It does not connect to the network. If the
license server is ever shut down, Pro features keep working on a Mac that is already activated.
The server is contacted only for a new activation and for an explicit deactivation. The
deactivation notice to the server is best-effort — even if it fails, the local deactivation
always completes.
The default is a one-time (Lifetime) purchase; expires_at is checked only when
is_lifetime is false. Seat count is expressed by tier — 2 for personal Pro, 5 for
Team.
§10
Signing and notarization (scripts/release.sh)
- Run
xcodebuild archive(Release, manual signing, Developer ID Application). - Export with
-exportArchiveasmethod: developer-id. - After
notarytool submit --wait, runstapler stapleon the .app. - Verify with
spctl -a -t exec -vv. - Re-zip after stapling to produce the Sparkle update artifact (so the notarization ticket is included and it runs offline without a Gatekeeper warning).
- Build the DMG, notarize and staple the DMG as well, and verify with
stapler validate.
Updates (Sparkle 2.9.6)
| Key | Value |
|---|---|
| SUFeedURL | https://lafine.net/updates/appcast.xml |
| SUPublicEDKey | CNxzwijMzMCJzliId76Yl88S/9np6t/xg/zQ9YbYzHs= |
| SUEnableAutomaticChecks | true |
| SUScheduledCheckInterval | 86400 |
Before an update is applied, the EdDSA signature listed in the appcast is verified
against the SUPublicEDKey embedded in the app. The private signing key exists only in
the build environment. The appcast is served over HTTPS. Delta updates are signature-verified the
same way.
It is not a weakness that the URL of appcast.xml is public. Its contents are only the version, release notes, URL, size, and the EdDSA signature of each build. Because the signature is verified with the public key built into the app, even an attacker who can replace the appcast cannot push a malicious update without the signing key. Gatekeeper (Developer ID and notarization) is the second gate.
Two risks remain. One is that updates fail to arrive because of a host outage or a broken appcast (no malicious install occurs; the app simply is not updated). The other is a freeze attack that deliberately suppresses security updates. Sparkle 2 checks version ordering and rejects downgrades and replays, but fully preventing a freeze would require a dedicated update server with expiry times. This is a topic for future consideration.
§11
What RoamSwitch is meant to handle
- Probing and attacks from an attacker on the same LAN or from a hijacked IoT device. Countered with stealthing, audit of exposed ports, and isolation from the outside (RESULTS-DEFENSE-2026-08-30 and RESULTS-PENTEST-2026-08-31 demonstrate autonomous blocking in all scenarios: ARP spoofing, unknown ports, ransomware encryption, and download quarantine).
- Exposure on a network you don't trust. It automatically stops sharing services and AirDrop.
- Man-in-the-middle attacks (ARP/NDP spoofing). From 1.7.6 on, this is handled in layers. (1) A VPN tunnel with a kill switch (§5, the main defense; it does not depend on L2 integrity), (2) preventive pinning of the gateway ARP/NDP on untrusted networks (§5), (3) spoofing detection and emergency Air-Gap (after the fact). The VPN tunnel and gateway pinning are Pro and off by default. Spoofing detection is on by default, and emergency Air-Gap is on by default when Pro is enabled.
- Finding dev servers and databases (Redis, MongoDB, Elasticsearch, and so on) exposed on
0.0.0.0without authentication, and blocking them from outside. - Catching ransomware-like unauthorized encryption activity early and stopping all traffic (it does not rely on signatures).
- BadUSB and physical keyboard approval guard (
USBKeyboardGuard, CGEventTap + IOKit) that intercepts and drops keystrokes from unapproved USB keyboards/cables (Rubber Ducky, O.MG Cable, etc.) to prevent automated command injection attacks. - An approval prompt for unknown USB storage (an unrecognized drive is held read-only rather than ejected immediately), and an automatic ClamAV scan on attached storage (optional).
- Detects sensitive API keys (OpenAI, Anthropic, GitHub, AWS, etc.) in the clipboard entirely locally, and prevents an accidental paste into a web form or AI chat before it happens.
- Detects and warns about dangerous Pickle-format AI model files (an arbitrary-code-execution risk) downloaded from Hugging Face or the web.
- The industry-standard EICAR test signature and well-documented reverse-shell one-liners inside downloaded files (
StaticSignatureScanner, 1.8.7+, works even without ClamAV installed). - A newly-registered LaunchAgent/LaunchDaemon that invokes a raw script interpreter directly (
PersistenceMonitorGuard, 1.8.7+). - Lines shaped like a reverse shell or similar that are added to shell start-up files, periodic scripts, SSH rc, git hooks, login and logout hooks and Folder Action scripts (
StartupScriptWatch, read every 5 seconds). - A shell or interpreter, or an
nc,ncatorsocatrunning a shell on the connection, whose input and output are a TCP connection it opened outward to a public address (a reverse shell). Every 4 seconds it checks the logged-in user's own processes and notifies once the same finding is seen in two checks in a row (ReverseShellWatchGuard, Pro, on by default, notify only). Root-owned processes and connections to private addresses or loopback are not watched. - Rewriting of DNS, router, or PAC by means such as a rogue DHCP server. Compared with the previous state of the same network, it notifies of a new DNS server, a new PAC address, or WPAD turned on (
NetworkSettingsWatchGuard, Pro, on by default, notification only). It neither blocks nor changes settings. VPN and manual or configuration-profile DNS are not compared. Accept a legitimate change with “Update network settings baseline to current state…”. - "ClickFix"-style attacks, where a fake warning screen talks you into running a command in Terminal yourself — detected via known-bad command patterns in shell history, triggering an emergency air-gap (
ClickFixGuard, 1.8.7+, Pro, off by default). - Detects and notifies the instant a container starts with a container-escape-risk Docker configuration, such as
--privilegedmode or a/var/run/docker.sockbind-mount (DockerEventGuard, 1.8.9+, Pro, off by default, notify-only). - Secret/API-key leak auditing that now covers not just pasted text but recursive, folder-level scanning too (
SecretLeakAuditor, folder scanning added in 1.8.9, entirely on-device).
What we have decided not to do
- It is not a replacement for antivirus. ClamAV and XProtect are used as auxiliaries; RoamSwitch on its own is not a general-purpose malware detector.
- The policy is not to apply for the EndpointSecurity entitlement. This is because it is hard to get through review with an individual account. Features that need pre-execution blocking (such as
ES_EVENT_TYPE_AUTH_EXEC) are out of scope. Instead, after-the-fact detection such as static signature detection, autostart monitoring, and ClickFix countermeasures is implemented without the entitlement. - It is not a guarantee. It is one layer in a defense-in-depth stack, not something that "completely prevents ransomware." Marketing copy is reviewed on this premise too.
- It cannot protect an already-compromised root or kernel. If an attacker already has root, they can remove the helper's pf rules too.
- It does not restore L2 integrity itself. The preventive ARP/NDP pin is trust-on-first-use — if an attacker is already in place before you connect, it can pin a spoofed MAC. The VPN tunnel (§5) is the answer when you don't want to make that assumption: even with L2 poisoned, the contents are encrypted and the kill-switch stops plaintext from leaking. It is not a substitute for enterprise DHCP snooping or Dynamic ARP Inspection.
- It does not provide a VPN server. The tunnel feature uses a WireGuard config the user supplies; RoamSwitch does not become a VPN provider.
Attack surface that installing RoamSwitch adds
| Attack surface | How it is contained |
|---|---|
A LaunchDaemon that runs as root, and its mach service (com.tetsuharu.RoamSwitch.Helper) |
The operation surface is fixed to HelperProtocol (the §3 table). There is no arbitrary-command channel. Connections are authorized by a code-signing requirement, using audit_token. |
If RoamSwitch.app itself is compromised, all of the helper's operations pass to the attacker |
Hardened Runtime is enabled, and the app is given no unnecessary privileges. Outbound traffic is limited to the paths in the §7 table (and the user-initiated and default-off features described below that table). No network-send entitlement is declared, but because the app is not sandboxed, that by itself does not forbid network traffic (measurements are at the end of §7). We plan to have this reviewed by a third party. |
| The system-binary paths the helper spawns | Absolute paths like /sbin/pfctl are specified directly, with no dependence on PATH. Arguments are hard-coded too (apart from port numbers, DNS strings, the ARP IP/MAC pairs, and the VPN endpoint IP — all of which are format-validated). |
Link Guard rewriting /etc/hosts (setLinkGuardSinkhole) |
Writes are confined to a delimited managed section; lines outside it are preserved verbatim. Domains are normalized and validated, IPs and junk are dropped, the list is capped at 60,000, and the file is written via a temp file + atomic replace. It only sinkholes clear cases (threat-feed listing or brand-name homograph), decided by a local-only verdict engine. The block list itself comes from the signature-verified threat feed (feed-dedicated key). |
Link Guard's threat-feed fetch (a receive-only daily GET) |
A static-file fetch with no query string and no per-device identifier (only the standard User-Agent). The manifest and feed body are both Ed25519-verified, and a fetch that fails verification is discarded (no fallback to unsigned data). "Auto-update: Off" removes the path entirely. |
Preventive ARP/NDP pin (lockGatewayARP) |
Only the neighbor-cache entries for the gateway, IPv6 router, and on-link DNS are pinned. The IPs and MACs passed in are validated for format and handled by reconciling against the requested set (entries are not added on its own). It operates only on untrusted networks, and is Pro and off by default. The limits of TOFU are stated under “what we decided not to do”. |
VPN tunnel (wireGuardImport/Up/…, Homebrew wireguard-tools) |
The .conf is stored by the helper at 0600. The endpoint IP is resolved by the app and passed to the helper (the helper never resolves an arbitrary hostname). The tunnel's destination and contents are under the user's control. The feature is disabled if wireguard-tools is not installed. Pro, off by default. The kill-switch goes through PFRulesetCoordinator (§4). |
| The MCP server passing system state to an LLM (a confused deputy) | No tool changes settings, protections, ports or devices, and the only writes are three tools updating their own record files. URL checks are offline. The settings domain is only read, never written. |
| Hijacking the update path | EdDSA signature verification (SUPublicEDKey), plus a bundled notarization ticket. The appcast is over HTTPS. |
Appendix A
Everything stated in this document can be verified against the distributed artifact with the following commands.
Signing and notarization
# Developer ID signature and Team ID
codesign -dvvv /Applications/RoamSwitch.app 2>&1 | grep -E 'Authority|TeamIdentifier|flags'
# Whether the notarization ticket is stapled
stapler validate /Applications/RoamSwitch.app
spctl -a -t exec -vvv /Applications/RoamSwitch.app
# Signature of the bundled helper / MCP server
codesign -dvvv /Applications/RoamSwitch.app/Contents/MacOS/RoamSwitchHelper
codesign -dvvv /Applications/RoamSwitch.app/Contents/MacOS/RoamSwitchMCPServer
Entitlements (confirming that no network-send entitlement is declared; because the app is not sandboxed, this by itself does not forbid network traffic)
codesign -d --entitlements :- /Applications/RoamSwitch.app/Contents/MacOS/RoamSwitchHelper
codesign -d --entitlements :- /Applications/RoamSwitch.app/Contents/MacOS/RoamSwitchMCPServer
# → An empty entitlements dictionary. No app-sandbox / network client keys.
Measuring the traffic
# Run tcpdump alongside it to confirm that, in normal use, no traffic occurs outside the paths in the table
sudo tcpdump -i any -n 'host not 127.0.0.1' and 'not port 53'
# No traffic other than the paths in the table (license activation, update checks, signed update data, ClamAV updates, and so on)
For a stricter, automated check with per-process attribution, see
rs-zerotel-audit.sh in roamswitch-support/audit/
Defense Architecture & Penetration Testing (5 Defense Boundaries)
# Batch-verifies the XPC authorization boundary, pf Air-Gap priority, port exposure detection, the MCP Read-Only invariant (no tool with a mutating name), and ARP monitoring, all automatically
git clone https://github.com/lafine1211/roamswitch-support
cd roamswitch-support/audit
./rs-defense-audit.sh all
Live penetration testing & multi-layer defense audit from a macOS VM: RESULTS-DEFENSE-2026-08-30
DNS Threat Protection (Quad9 Malware & C2 Blocking) Verification
# Query Quad9's official test domain for verifying threat blocking
nslookup test.dns9.quad9.net
# → Should return ** server can't find test.dns9.quad9.net: NXDOMAIN, i.e. name resolution is blocked
Web & Mail Download Guard (ClamAV Real-Time Detection) Verification
# Create the harmless antivirus industry-standard test string (EICAR) in Downloads
echo 'X5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*' > ~/Downloads/eicar_test.com
# → FSEvents detection triggers an immediate ClamAV scan; no notification is shown, and "EICAR test signature detected (harmless)"
# is recorded in notification history. Since EICAR is an industry-standard test file and not an actual threat,
# it is neither quarantined nor blocked and the file is left in place (only a real malware sample is moved to the quarantine manager).
Static Signature Detection (No EndpointSecurity Required) Verification
## A textbook reverse-shell one-liner from public offensive-security references (harmless, never executed)
echo 'bash -i >& /dev/tcp/127.0.0.1/4444 0>&1' > ~/Downloads/rs_test.sh
## → Even without ClamAV installed, a "Dangerous download file quarantined" notification appears and it's
## moved to the Quarantine folder immediately (doesn't depend on ClamAV's signature database)
New Autostart Monitoring (PersistenceMonitorGuard) Verification
# Create a harmless LaunchAgent that invokes a raw script interpreter directly (never actually run)
cat > ~/Library/LaunchAgents/com.example.selfcheck.plist <<'EOF'
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0"><dict>
<key>Label</key><string>com.example.selfcheck</string>
<key>ProgramArguments</key><array><string>/bin/bash</string><string>-c</string><string>echo hi</string></array>
</dict></plist>
EOF
# → Within a few seconds, a "New autostart registration detected" notification should appear. Remove it afterward:
rm ~/Library/LaunchAgents/com.example.selfcheck.plist
Link Guard (blocking phishing connections)
# Whether the managed section is present (2 BEGIN/END lines if Pro + default mode)
sudo grep -c 'RoamSwitch link guard' /etc/hosts
# The section's contents and sinkhole count
sudo sed -n '/BEGIN RoamSwitch link guard/,/END RoamSwitch link guard/p' /etc/hosts | head -4
sudo sed -n '/BEGIN RoamSwitch link guard/,/END RoamSwitch link guard/p' /etc/hosts | grep -c '^0\.0\.0\.0'
# Whether it's actually dropped (checked with one entry from the section; harmless)
D=$(sudo sed -n '/BEGIN RoamSwitch/,/END RoamSwitch/p' /etc/hosts | awk '/^0\.0\.0\.0/{print $2; exit}')
dscacheutil -q host -a name "$D" # → ip_address: 0.0.0.0 (name resolution is blocked)
# Also confirm the section above disappears via Menu → "Link Protection" → "Off"
The receive-only threat feed (signature-verified)
# Public feed and manifest (anyone can fetch and verify them)
curl -s https://lafine.net/updates/v1/manifest # version/generated/threatfeed{...}
curl -sI https://lafine.net/updates/v1/manifest.sig # → text/plain
# The only thing sent is a GET with no query string, cookies, or per-device identifier (standard User-Agent only). Verify with tcpdump running alongside.
Preventive ARP/NDP lock (§5, 1.7.5+)
# Connect to an untrusted network with preventive lock enabled → check for permanent entries
arp -an | grep -i permanent # Gateway and other IPs are listed as (permanent)
ndp -an | grep -i 'P ' # IPv6 side (P = permanent)
sudo cat "/Library/Application Support/RoamSwitch/gateway_arp_lock.json" # The set of currently pinned IP→MAC mappings
# Release the lock from the menu → the above should disappear
VPN tunnel + kill-switch (§5, 1.7.6+)
# Assumes wireguard-tools (via Homebrew)
brew list wireguard-tools >/dev/null && echo "wireguard-tools: OK"
# Enable VPN on an untrusted network → before the tunnel is up, pf is in kill-switch state
sudo pfctl -sr | grep -E 'block drop all|pass .*(utun|udp)' # block drop all + a limited set of pass quick rules
# After the tunnel is up (wg-quick up already run)
wg show # handshake / transfer is active
route -n get default | grep interface # → utunN (the default route is the tunnel)
# Disable the VPN → kill-switch is released and pf returns to its prior state
The privileged helper itself
# The registered LaunchDaemon
sudo launchctl print system/com.tetsuharu.RoamSwitch.Helper
# The currently loaded pf rules (actual state of Air-Gap / port guard)
sudo pfctl -sr
# The helper's state directory
ls -la "/Library/Application Support/RoamSwitch/"
The MCP server's response (offline check)
BIN=/Applications/RoamSwitch.app/Contents/MacOS/RoamSwitchMCPServer
printf '%s\n' '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{}}' \
'{"jsonrpc":"2.0","id":2,"method":"tools/list"}' | "$BIN"
# Returns serverInfo and the tool definitions. No network connection occurs.
The MCP server's source and tests
git clone https://github.com/lafine1211/roamswitch-mcp
cd roamswitch-mcp
swift build -c release # The same source as the shipped binary
swift test # Unit, adversarial-input, stdio, and mutation fuzzing tests
# See SECURITY_TESTING.md for what's tested and any issues found
Device identifier
# The raw value bound to the token (only a salted SHA-256 is ever sent)
ioreg -d2 -c IOPlatformExpertDevice | awk -F'"' '/IOPlatformUUID/{print $4}'