Skip to content
GitHub Download

Security model

What HeadlessOS stores and how it is encrypted, what reaches your server, the local API token, the command policy, and reporting a vulnerability.

HeadlessOS holds your credentials and runs commands over SSH. This page says what it does and where each protection stops. The formal policy is SECURITY.md.

HeadlessOS connects over standard SSH with the full rights of the user you log in as. It installs no agent and opens no ports. The server receives commands, SFTP requests and whatever you type in a terminal.

A few features leave something behind:

  • The Docker app can install Docker when you ask, using the script from get.docker.com.
  • Files moved to trash go to /tmp/.headlessos-trash on the server.
  • Saving a form in a generated view keeps a .bak copy of the file.

Everything stays in ~/.headlessos/ on your computer. The folder is created 0700 and files with secrets 0600. Windows ignores those modes.

WhatFileProtection
SSH passwordsservers.jsonAES-256-GCM
SSH private keys, passphrasesservers.jsonAES-256-GCM, never returned to the UI
OpenAI and Anthropic keysllm.jsonAES-256-GCM, never returned to the UI
Encryption secretenc-key.keychainHeld by the OS keychain in the desktop app
API tokenapi-tokenPlain text
Agent audit log, desktop logaudit/, logs/Plain text. The desktop log masks secrets.
Traces, sessionsobservatory/, sessions/Plain JSON

The key is derived with scrypt from a random secret and your OS user ID. The desktop app keeps that secret in your computer’s keychain. Where there’s no keychain, or when you run from source, it’s a plain file called enc-key. As a result:

  • Renaming the computer or changing networks doesn’t affect them.
  • Losing the secret, or copying servers.json to another computer without it, makes them unreadable. Your servers stay in the list. Type the password again at sign-in. A server that used an SSH key has to be removed and added again.
  • If servers.json itself can’t be read, the app starts with an empty list and keeps the damaged file as servers.json.broken.
ThreatmacOSWindowsLinux, with a secret storeLinux, without one
A copy of the folder aloneProtectedProtectedProtectedNot protected
Another account on the computerProtectedProtectedProtectedNot protected
A program running as youProtected: the Keychain asks, naming the programNot protectedNot protectedNot protected

On Windows and Linux, a program running as you can ask the system to decrypt, and no app can change that. If you install something malicious, it can also read your ~/.ssh keys and record what you type, whatever HeadlessOS does. Only run software you trust.

On a Mac, if any app other than HeadlessOS asks for “HeadlessOS Safe Storage”, click Deny.

  • Binding. The backend listens on 127.0.0.1 only.
  • API token. Every API and WebSocket request must carry the random token from api-token, except /health. A web page can’t read that file.
  • Host check. A Host header other than localhost, 127.0.0.1 or ::1 is refused, which blocks DNS rebinding.
  • WebSocket origin. Upgrades need a localhost origin, no origin, or null. The desktop app sends null, but so can a sandboxed iframe, so there the token is the real check.

These checks stop web pages, not local software: any program running as your user can read the token file. On a source run, the Vite proxy on port 3000 adds the token to each request it forwards, so treat source runs as development only.

Every command sent through the SSH manager’s exec() passes CommandPolicy.

LayerApplies toEffect
BlocklistEvery commandRefuses patterns such as rm -rf /, mkfs, reboot and piping into a shell
AllowlistClassic appsBy default an unlisted command runs and a warning is logged. HEADLESS_POLICY_MODE=enforce refuses it, but the list doesn’t yet cover every app command.
Action grantAgent runsOnly the command the action runner just built may run

A terminal is a real shell, so what you type isn’t checked. Outside agent runs, SFTP skips the policy, though File Explorer validates its paths. The blocklist is pattern matching, not a sandbox.

Separately, values from the UI, such as paths and container IDs, are validated and quoted before they enter a command.

HeadlessOS has no telemetry: no analytics, crash reporting or update checks. Traffic goes only here:

DestinationWhatWhen
Your serversSSH trafficWhen you connect
Open-MeteoThe city you search for, its coordinatesAfter you set a weather city
OpenAI or AnthropicPrompts and command outputIf you choose that provider
Your Ollama serverThe sameIf you choose it. A remote URL needs confirmation.
A plugin manifest URLOne requestIf you enter one in Settings → Plugins

Agents pick typed actions from a fixed catalog instead of writing commands, and changes wait for your approval. See AI safety.

Please don’t open a public issue. Use Report a vulnerability on the repository’s Security tab. Say what you found, how to reproduce it and what an attacker could do. Fixes go into the latest release.