- Docs
- Concepts
- Security model
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.
What reaches your server
Section titled “What reaches your server”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-trashon the server. - Saving a form in a generated view keeps a
.bakcopy of the file.
What is stored, and how
Section titled “What is stored, and how”Everything stays in ~/.headlessos/ on your computer. The folder is created 0700 and files with secrets 0600. Windows ignores those modes.
| What | File | Protection |
|---|---|---|
| SSH passwords | servers.json | AES-256-GCM |
| SSH private keys, passphrases | servers.json | AES-256-GCM, never returned to the UI |
| OpenAI and Anthropic keys | llm.json | AES-256-GCM, never returned to the UI |
| Encryption secret | enc-key.keychain | Held by the OS keychain in the desktop app |
| API token | api-token | Plain text |
| Agent audit log, desktop log | audit/, logs/ | Plain text. The desktop log masks secrets. |
| Traces, sessions | observatory/, sessions/ | Plain JSON |
How encryption works
Section titled “How encryption works”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.jsonto 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.jsonitself can’t be read, the app starts with an empty list and keeps the damaged file asservers.json.broken.
What the keychain protects
Section titled “What the keychain protects”| Threat | macOS | Windows | Linux, with a secret store | Linux, without one |
|---|---|---|---|---|
| A copy of the folder alone | Protected | Protected | Protected | Not protected |
| Another account on the computer | Protected | Protected | Protected | Not protected |
| A program running as you | Protected: the Keychain asks, naming the program | Not protected | Not protected | Not 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.
The local API
Section titled “The local API”- Binding. The backend listens on
127.0.0.1only. - 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
Hostheader other thanlocalhost,127.0.0.1or::1is refused, which blocks DNS rebinding. - WebSocket origin. Upgrades need a localhost origin, no origin, or
null. The desktop app sendsnull, 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.
The command policy
Section titled “The command policy”Every command sent through the SSH manager’s exec() passes CommandPolicy.
| Layer | Applies to | Effect |
|---|---|---|
| Blocklist | Every command | Refuses patterns such as rm -rf /, mkfs, reboot and piping into a shell |
| Allowlist | Classic apps | By 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 grant | Agent runs | Only 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.
What leaves your computer
Section titled “What leaves your computer”HeadlessOS has no telemetry: no analytics, crash reporting or update checks. Traffic goes only here:
| Destination | What | When |
|---|---|---|
| Your servers | SSH traffic | When you connect |
| Open-Meteo | The city you search for, its coordinates | After you set a weather city |
| OpenAI or Anthropic | Prompts and command output | If you choose that provider |
| Your Ollama server | The same | If you choose it. A remote URL needs confirmation. |
| A plugin manifest URL | One request | If 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.
Report a vulnerability
Section titled “Report a vulnerability”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.