Skip to content

LaunchAgents & LaunchDaemons

The template forge — where XML plists are stamped into existence with the precision of a bureaucracy that runs on cron

Sanctum manages a set of macOS LaunchAgents (user-level) and LaunchDaemons (root-level) that form the boot chain for the haus intelligence platform. Each plist is rendered from templates at ~/.sanctum/templates/launchagents/ by the generate-plists.sh script, which pulls values from instance.yaml and tokens from the macOS Keychain.

You might wonder why these aren’t written in a friendlier format. The answer is that Apple chose XML for process management configuration in 2005 and has been politely pretending that was fine ever since. The template system exists so you never have to touch raw plist XML. You’re welcome.

LaunchAgents are loaded at user login. The ordering below reflects the logical dependency chain — launchd does not guarantee ordering, but RunAtLoad: true ensures all agents start promptly after login.

In practice, everything starts within seconds of each other and sorts itself out. It’s less of a chain and more of a stampede in roughly the right direction.

These agents stand up the VM, the gateway, and the firewall bridge. Without them, the rest of the stack is a collection of orphaned processes with nowhere to send their feelings.

PropertyValue
Labelcom.sanctum.utm-autostart
PurposeLaunch UTM, start the VM, and set the bridge100 IP to the configured mac_bridge_ip
Required Servicevm
KeepAliveNo
RunAtLoadYes

Runs a startup script that launches UTM.app, waits for the VM to boot, and configures the bridge interface IP via sudo ifconfig. Requires the vmnet-bridge sudoers entry at /etc/sudoers.d/vmnet-bridge.

The first domino. Everything else assumes the VM is running and the bridge exists. If this one fails, enjoy your very expensive space heater.


PropertyValue
Labelcom.sanctum.gateway
PurposeOpenClaw/DenchClaw agent gateway on the Mac side
Required Servicegateway
KeepAliveNo
RunAtLoadYes
Port1977

The Mac-side agent gateway. Uses /opt/homebrew/bin/node (stable Homebrew symlink, not a versioned Cellar path) because pointing a LaunchAgent at a Cellar path is a time bomb with a brew upgrade fuse.


PropertyValue
Labelcom.sanctum.firewalla
PurposeBridge between the Sanctum stack and the Firewalla Purple router via the P2P API
Required Servicefirewalla
KeepAliveYes
RunAtLoadYes
Port1984
Bind0.0.0.0 (accessible from VM)

Runs firewalla-bridge.js which authenticates to Firewalla’s cloud endpoint and then communicates locally over port 8833. The bridge binds to all interfaces so the VM can reach it at 10.10.10.1:1984.

A bridge to a bridge. Networking is turtles all the way down.


The agents that give the house its opinions. One serves a 27-billion-parameter model. One synthesizes speech. One listens for a wake word and responds as a fictional Jedi. Totally standard residential infrastructure.

PropertyValue
Labelcom.sanctum.xtts-server
PurposeXTTS-v2 text-to-speech server using Mac GPU (MPS)
Required Servicextts
KeepAliveNo
RunAtLoadYes

Provides TTS capability for the voice agent. Runs on the Mac to leverage Metal Performance Shaders — because asking a CPU to synthesize speech in real time is like asking a poet to take dictation. It can do it. It won’t enjoy it.


PropertyValue
Labelcom.sanctum.voice-agent
PurposeYoda voice interaction agent
Required Servicevoice_agent
KeepAliveNo
RunAtLoadYes

Manages voice capture, wake-word detection, and Yoda personality interactions. A daemon that sits in silence, waiting for someone to speak, then answers in the cadence of a small green Jedi master. Your house does this now. You chose this life.


PropertyValue
Labelcom.sanctum.idle-mlx
PurposeCouncil-27B MLX model server for local agent inference
Required Servicemlx_server
KeepAliveYes
RunAtLoadYes
Port1337

Serves the Qwen3.5-27B-4bit model with a LoRA adapter supporting 6 agent personalities. KeepAlive ensures the model stays loaded in memory. Twenty-seven billion parameters, sitting in RAM, waiting to be useful. The idle power draw of a small space heater, but for thinking.


PropertyValue
Labelcom.sanctum.proxy
PurposeSanctum Proxy — single-binary LLM routing layer
Required Serviceproxy
KeepAliveYes
RunAtLoadYes
Port4040 (all interfaces)

A single Rust binary that handles the full LLM request pipeline: request sanitization, content-based routing, prompt caching, PII scrubbing, assistant prefill stripping, model resolution, tiered fallback chains, and analytics. All agent traffic enters through port 4040. The bouncer and the bartender in one efficient package.


Every system with a VM that can’t see the LAN eventually grows a small collection of tunnels. This is that collection. Each one exists because some process needed to reach some other process, and a direct route was too much to ask.

PropertyValue
Labelcom.sanctum.ha-tunnel
PurposeSSH tunnel from the HA Docker container to the VM’s Network Control API on port 4007
Required Servicehome_assistant
KeepAliveNo
RunAtLoadYes

Allows the Home Assistant container (running in Docker bridge networking) to reach the VM’s Network Control API via host.docker.internal. A Docker container, talking through an SSH tunnel, to a VM it can’t see, about devices on a network it’s not on. Distributed systems are just loneliness at scale.


PropertyValue
Labelcom.sanctum.health-tunnel
PurposeSSH tunnel for the health ingester to reach the VM on port 10101
Required Servicehealth_center
KeepAliveYes
RunAtLoadYes

The health ingester’s lifeline to the VM. Keeps itself alive because health data waits for no one — your resting heart rate doesn’t care that the tunnel crashed at 3 AM.


PropertyValue
Labelcom.sanctum.tunnel
PurposeCloudflare Zero Trust tunnel for external access
Required Servicecloudflare
KeepAliveYes
RunAtLoadYes

Runs the cloudflared tunnel daemon for the configured tunnel name (e.g., manoir-nepveu). Routes external traffic to internal services like Home Assistant and the health ingester. The one tunnel in this list that actually reaches the outside world, which makes it either the most important or the most dangerous, depending on your threat model.


PropertyValue
Labelcom.sanctum.orbi-bridge
Purposesocat bridge allowing the VM to reach the Orbi router
Required Servicevm
KeepAliveYes
RunAtLoadYes
Ports18080 (HTTP), 18085 (API)

Forwards VM traffic from 10.10.10.1:18080 to the Orbi router at 192.168.1.2:80 and 10.10.10.1:18085 to 192.168.1.2:5000. Required because the VM has no direct LAN access.

The VM wants to talk to the router. The VM can’t reach the router. So we built a socat tunnel through the Mac. Networking: where every problem is solved by adding another layer of indirection.


PropertyValue
Labelcom.sanctum.signal-bridge
PurposeSignal messaging bridge for agent communication
Required Servicesignal_bridge
KeepAliveYes
RunAtLoadYes

Lets agents send and receive Signal messages. End-to-end encrypted AI communication — because if your house is going to text you, it should at least have the decency to do it privately.


The quiet ones. They file your documents, rotate your secrets, watch for fires, and serve your offline Wikipedia. They don’t get thanked enough.

PropertyValue
Labelcom.sanctum.icloud-filer
PurposeAutomatic filing daemon for iCloud Drive documents
Required Serviceicloud_filer
KeepAliveYes
RunAtLoadYes

Watches iCloud Drive directories and automatically files documents into organized folder structures. Digital Marie Kondo, but for PDFs. Does it spark joy? Doesn’t matter. It sparks organization.


PropertyValue
Labelcom.sanctum.watchdog
PurposeHealth monitoring watchdog that runs every 600 seconds
Required Servicewatchdog
KeepAliveNo
RunAtLoadYes
StartInterval600

Periodically checks the health of all enabled services and auto-heals failures via service-doctor. Not KeepAlive — uses launchd’s StartInterval for periodic execution. Every ten minutes, it wakes up, looks around, makes sure nothing is on fire, and goes back to sleep. The most relatable agent in the fleet.


PropertyValue
Labelcom.sanctum.rotate-secrets
PurposeMonthly secret rotation (gateway tokens, API keys)
Required Service
KeepAliveNo
RunAtLoadNo
StartCalendarInterval1st of each month at 03:30

Runs on a calendar schedule, not at boot. Rotates secrets stored in 1Password and the macOS Keychain. The only agent that doesn’t start at login — it waits for its appointed hour like a well-mannered assassin.


PropertyValue
Labelcom.sanctum.dashboard
PurposeCommand center dashboard web server
Required Servicedashboard
KeepAliveNo
RunAtLoadYes
Port1111

The dashboard. Where you go to see, at a glance, whether the twenty-odd processes described on this page are all still speaking to each other. Think of it as mission control, except the mission is “keep the house sentient.”


PropertyValue
Labelcom.sanctum.kiwix-serve
PurposeKiwix offline library server (Wikipedia, etc.)
Required Servicekiwix
KeepAliveYes
RunAtLoadYes
Port8888
ThrottleInterval30

Requires an external T9 drive to be mounted. KeepAlive with ThrottleInterval prevents rapid restart loops if the drive is disconnected. All of human knowledge, served from an external hard drive — the library of Alexandria, if Alexandria ran on USB-C.


Everything above runs as your user. Everything below runs as root. There is exactly one daemon in this section, and it exists because of a number: 80. The lowest-numbered privilege escalation in the history of home automation.

PropertyValue
Labelcom.sanctum.dench-proxy
PurposeReverse proxy from port 80 to port 1977 for the Holocron chat interface
Required Servicegateway
KeepAliveYes
RunAtLoadYes
Runs asroot

This is a LaunchDaemon (not a LaunchAgent) because binding to port 80 requires root privileges. It enables http://holocron/ access from the LAN without specifying a port.

Plist location: /Library/LaunchDaemons/com.sanctum.dench-proxy.plist

The entire reason this runs as root is so family members can type holocron into a browser instead of holocron:1977. Usability has a cost. That cost is sudo.


All plists are rendered from Mustache-style templates using values from instance.yaml and tokens from the macOS Keychain:

Terminal window
# Preview what would be generated (dry run)
~/.sanctum/generate-plists.sh --dry-run
# Generate and install all plists for enabled services
~/.sanctum/generate-plists.sh

The generator:

  1. Reads each template from ~/.sanctum/templates/launchagents/
  2. Checks if the corresponding service is enabled in instance.yaml
  3. Expands {{PLACEHOLDER}} tokens with config values
  4. Pulls secrets from the macOS Keychain using the configured keychain_account
  5. Writes the rendered plist to ~/Library/LaunchAgents/ (or /Library/LaunchDaemons/ for daemons)

Load or unload agents using launchctl:

Terminal window
# Load an agent
launchctl bootstrap gui/$(id -u) ~/Library/LaunchAgents/com.sanctum.watchdog.plist
# Unload an agent
launchctl bootout gui/$(id -u) ~/Library/LaunchAgents/com.sanctum.watchdog.plist
# Check if an agent is running
launchctl print gui/$(id -u)/com.sanctum.watchdog