Where secrets live
HQ tokens
When Desktop spawns the HQ, it generates management and chat tokens and stores them in the OS keychain — never in plaintext files. When Desktop relaunches, it reads the tokens from the keychain to reconnect to the existing HQ.Provider keys and messaging tokens
Everything else — your Anthropic/OpenAI/Google/Moonshot/OpenRouter keys, and Telegram/WhatsApp credentials — is encrypted in the HQ’s credential store at~/.dash/gateway/credentials.enc. You set these through Desktop; you never edit the file by hand.
The encrypted credential store
The HQ encrypts the credential store with a random key it generates on first run:
There is no password to remember and nothing to unlock — the HQ loads its key from
secret.key automatically at startup. Both files sit in ~/.dash/gateway/ with 0600 permissions, so protect that directory the way you would any local secret.
Writes are atomic
Every write goes through a temporary file first: the encrypted payload is written tocredentials.enc.tmp, then atomically renamed. If the process crashes mid-write, the previous version stays intact.
How secrets reach your agents
When you add a provider key in Desktop, here’s the handoff:1
You enter a key in Desktop
On the AI Providers page (or the setup wizard), you paste a provider API key.
2
Desktop sends it to the HQ
The key is sent to the HQ’s Management API and written to the encrypted credential store. It is never written to a plaintext file.
3
The HQ reads it on each run
When an agent runs, the HQ reads the current keys straight from the encrypted store. Rotating or deleting a key takes effect on the agent’s next message — no restart needed.
Standalone HQ
When you run the HQ without Desktop, supply provider keys as environment variables (for example in an.env file or your Docker environment):
--token and --chat-token flags (see Configuration).
What’s stored
Desktop uses well-known key names for credentials:
The HQ collapses
<provider>-api-key:* entries into one key per provider when an agent runs, so you can keep more than one key per provider and the first non-empty one is used.
Security properties
A summary of what the encrypted store protects against and what it doesn’t. Protected:- Reading secrets from disk without the key (AES-256-GCM)
- Tampering with the encrypted file (the GCM authentication tag detects modifications)
- Data loss from crashes during writes (atomic rename)
- An attacker who can read both
secret.keyandcredentials.enc(the key decrypts the store) — keep~/.dash/gateway/private - Memory-resident secrets in a running HQ process
- A compromised machine with the user’s privileges