Authentication and credentials
CaberOS separates operator authentication from external-service credentials. Operator sessions control access to the management API; encrypted credentials let the gateway contact providers, MCP servers, and messaging platforms without placing their stored plaintext values in agent configuration or normal API responses.
Operator authentication
Section titled “Operator authentication”The current release has one operator security role. Any authenticated operator can manage all agents, providers, memory, documents, integrations, traces, and backups.
There is no tenant isolation, per-agent operator authorization, or role-based access control.
Password storage
Section titled “Password storage”Operator passwords are hashed with bcrypt and an automatically generated salt. CaberOS stores the hash, not the plaintext password.
The first launch seeds:
username: adminpassword: adminThe account is marked must_change_password. Change it immediately, especially before exposing any part of the gateway beyond loopback. Do not treat the default credential or UI reminder as a deployment control.
Changing the password creates an operator-audit record.
Session tokens
Section titled “Session tokens”A successful login creates a random URL-safe token from 32 random bytes. CaberOS:
- returns the raw token to the client;
- stores only its SHA-256 hash in the database;
- associates it with the operator and expiry;
- updates a bounded
last_seen_atvalue; - deletes the persisted session on logout.
Sessions expire after seven days. Expired session rows are cleaned up at gateway startup.
Browser authentication
Section titled “Browser authentication”Browser clients receive the token in the agentos_session cookie with:
HttpOnlyenabled;SameSite=Lax;- a seven-day max age.
The current cookie configuration does not set the Secure attribute. Keep browser deployments on loopback during local development or terminate HTTPS at a trusted reverse proxy before using CaberOS remotely.
Desktop authentication
Section titled “Desktop authentication”The Tauri WebView and loopback gateway have different origins, so the desktop client uses:
Authorization: Bearer <session-token>The login response contains the token in JSON so the desktop client can store and reuse it. A process with access to the local user’s browser/WebView storage or memory may be able to steal that bearer token.
Bind the desktop gateway to loopback and protect the operating-system account.
Authentication boundaries
Section titled “Authentication boundaries”Most /api management routes require an authenticated operator. Two intentional exceptions are:
- the minimal
/healthreadiness endpoint; - external channel webhook endpoints, which authenticate with the configured webhook secret instead of an operator session.
OAuth callback routes also receive browser redirects from external authorization servers and validate their pending flow state.
CORS permits only the configured Vite development and Tauri origins. CORS is a browser policy, not a replacement for authentication or network isolation.
Credential inventory
Section titled “Credential inventory”| Secret or sensitive value | Storage | Returned by normal API | Notes |
|---|---|---|---|
| Operator password | Bcrypt hash in database | No | Plaintext exists only during login/change requests |
| Operator session token | SHA-256 hash in database | Raw token returned at login | Cookie or desktop bearer token |
| Provider API key | Fernet ciphertext in database | Only has_key |
Decrypted for provider requests |
| MCP API/bearer credential | Fernet ciphertext in database | Metadata only | Injected into environment or HTTP headers |
| MCP OAuth access/refresh token | Fernet ciphertext in database | Metadata/status only | Refresh replacements are persisted |
| Channel bot token | Fernet ciphertext in database | Only has_token |
Decrypted when constructing the channel adapter |
| Channel webhook secret | Plaintext database field | Only has_webhook_secret |
Needed for direct request comparison |
| Fernet key | Local secret.key file |
Included only in full backup/export | Best-effort 0600 permissions |
Agent prompts and MEMORY.md |
Database/filesystem plaintext | Available to authenticated operator | Included in model context as configured |
| Workspaces, documents, messages, traces | Database/filesystem plaintext | Available to authenticated operator | Protect with OS permissions and disk encryption |
CaberOS does not encrypt the entire database or application directory.
Fernet secret store
Section titled “Fernet secret store”On first use, CaberOS generates a Fernet key and writes it to AGENTOS_SECRET_KEY_PATH. The default development path is:
data/secret.keyThe desktop shell overrides this to its application-data directory. On creation and later reads, CaberOS attempts to enforce file mode 0600.
Fernet provides authenticated symmetric encryption for stored credential values. It detects ciphertext modification and prevents someone who has only the database from immediately reading encrypted fields.
It does not protect against a process that can read both the database and key file.
Key loss and compromise
Section titled “Key loss and compromise”If the key is lost
Section titled “If the key is lost”Existing encrypted provider, MCP, OAuth, and channel-token values cannot be decrypted. Re-enter or reauthorize each affected integration.
Do not generate a replacement key and expect old ciphertext to continue working.
If the key is copied
Section titled “If the key is copied”Anyone with both the key and database can decrypt stored credentials. Revoke and rotate credentials at every upstream provider; replacing only the local key does not revoke copied tokens.
Key rotation
Section titled “Key rotation”The current product does not expose an automatic re-encryption/key-rotation workflow. A safe rotation requires decrypting all values with the old key, generating a new key, and re-encrypting each value atomically—or revoking and re-entering credentials.
Provider credentials
Section titled “Provider credentials”Provider keys are encrypted when a provider is created or updated. Agents store a provider ID and model name, not the key.
At model-request time, the provider adapter loads and decrypts the key. The request then goes directly from the gateway to the configured provider endpoint.
Deleting a provider removes its stored key and clears the provider/model selection from affected active agent configurations. It does not revoke the key at the provider.
Always revoke unused or exposed keys through the provider account.
MCP credentials
Section titled “MCP credentials”MCP credentials can contain:
- an API key;
- a bearer token;
- OAuth token JSON;
- OAuth client information.
CaberOS decrypts the selected contact/server credential at mediated execution time and renders server templates such as:
{ "SERVICE_API_KEY": "{{credential_value}}"}or:
{ "Authorization": "Bearer {{credential.access_token}}"}The rendered environment or headers are passed to the MCP client. They are not added to the model-controlled tool arguments.
A local stdio server receives the rendered environment and runs as local code. Only install servers you trust with that credential and the privileges of the gateway’s OS user.
OAuth security
Section titled “OAuth security”The MCP OAuth flow:
- creates an in-memory pending flow;
- captures the authorization URL and expected
state; - opens the provider authorization page;
- receives the loopback callback;
- rejects a mismatched state;
- exchanges the code through the MCP OAuth provider;
- stores access and refresh tokens encrypted;
- refreshes and persists replacement tokens when supported.
Pending authorization waits time out after five minutes. The current pending-flow registry is process-local, so restarting the gateway invalidates an in-progress flow.
Review requested scopes at the provider. CaberOS cannot narrow an OAuth token below the scopes the external authorization server grants.
Channel credentials and webhooks
Section titled “Channel credentials and webhooks”Channel bot tokens are encrypted. Webhook secrets are stored as plaintext in the local database because the webhook route performs direct constant-time comparison against the supplied value. Normal channel API responses return only presence flags for both values.
If a webhook secret is configured, the route accepts it from:
X-Webhook-Secret;X-Bot-Api-Secret-Token;- the
webhook_secretquery parameter.
If no secret is configured, the application-level route does not require one. Protect every public webhook with a strong secret and, where possible, reverse-proxy allowlists, rate limits, TLS, and platform-native signature verification.
A secret in a query parameter may be captured by proxy or access logs. Prefer a supported header whenever the platform allows it.
Backup archives
Section titled “Backup archives”A full CaberOS export includes:
agentos.db;secret.key;- agent homes and
MEMORY.md; - workspaces and attachments.
Because the archive contains both encrypted credential ciphertext and the key required to decrypt it, possession of the archive should be treated as equivalent to possession of the stored credentials and private data.
The ZIP itself is not encrypted by CaberOS. Store it in an encrypted volume or encrypted backup system, restrict access, and never upload it publicly.
Before import, CaberOS validates ZIP structure, path containment, file count, uncompressed size, required database tables, and SQLite integrity. Replace and merge imports create an automatic restore point before modification.
Local restore points also copy the database, secret key, agent homes, and workspaces into the application data directory. They are protected only by local filesystem and disk controls.
Logs and traces
Section titled “Logs and traces”The desktop gateway writes bounded rotating logs. Run traces and audit records persist model messages, capability arguments, results, errors, source URLs, and filenames.
Credential APIs avoid returning plaintext values, but there is no universal guarantee that a third-party provider error, MCP server output, command output, or user-created file never contains a secret.
Before sharing logs or traces:
- inspect the complete file, not only the visible UI excerpt;
- remove tokens, URLs with credentials, personal paths, document excerpts, and identifiers;
- revoke any credential that may already have been exposed.
Deployment guidance
Section titled “Deployment guidance”Local desktop
Section titled “Local desktop”- Keep port
51718bound to127.0.0.1. - Use OS login protection and full-disk encryption.
- Do not share the application-data directory.
- Lock the screen when leaving the machine.
Docker or remote host
Section titled “Docker or remote host”- Change the default password before exposing the service.
- Place the gateway behind HTTPS and a trusted reverse proxy.
- Do not publish the backend port directly unless required.
- Restrict webhook paths separately from authenticated management paths.
- Protect volumes, environment files, and container logs.
- Do not assume the single-operator authentication model is suitable for untrusted shared users.
Credential incident checklist
Section titled “Credential incident checklist”- Revoke the token at its upstream service.
- Disable the affected provider, MCP server, or channel.
- Replace the stored credential or repeat OAuth authorization.
- Search run traces, messages, workspaces, logs, and backups for copies.
- Rotate related webhook secrets and session credentials.
- Review audit records for unexpected use.
- Remove or encrypt exposed backup copies.
Local deletion without upstream revocation is insufficient after a credential has leaked.