Skip to content

Identity & credential storage

The Identity & Accounts page covers the feature: accounts and how they’re linked to agents. This page covers the security model: where every credential and key lives at rest, how credentials reach agent processes, and what protects them.

Everything lives under one root, ~/.agentmux (%USERPROFILE%\.agentmux on Windows); dev builds use ~/.agentmux/dev/<branch>/ for their per-channel part. See Data layout for the full tree. The parts that matter for security:

PathContents
channels/<channel>/versions/<version>/data/db/objects.dbPanes and their settings, agents’ HMAC and LAN signing keys and identity tokens, held messages
channels/<channel>/versions/<version>/data/db/filestore.db, sagas.dbPane output and terminal scrollback; the operation log
channels/<channel>/versions/<version>/data/authkey.dev, ipc-port-<hash>The current launch’s auth key and host IPC token (see below)
channels/<channel>/versions/<version>/cef-cache/Chromium profile for browser panes: cookies, site storage, cache
channels/<channel>/wan-identity/wan.dbThe install’s WAN instance keypair, agents’ WAN signing keys, and WAN verification state. Shared by every version of the channel, so upgrades keep them
shared/store.dbAccounts, bundles, drone definitions, MuxBus credential metadata, per-agent MuxBus machine credentials
shared/identity-store.dbAgent-to-account links, skills, MCP servers, the task queue behind the Kanban, and the Vault’s entries, with their secret parts encrypted
shared/agents/transcripts/filestore.dbAgent conversation transcripts, continuity summaries, and AgentMux’s record of agents’ memory and of Global Memory. The folder and every file in it are owner-only (see below)
shared/providers/<provider>/, shared/identities/<account>/<provider>/Agent CLIs’ own login directories (see provider CLI logins)
agents/<slug>/Default agent working directories, each with an .mcp.json listing the agent’s MCP servers
agents/<name>.json, shared/agents/reactive/Registries of running agents, each entry including its instance’s auth key

On channels other than stable, shared/store.db and shared/identities/ are replaced by per-channel copies (channels/<channel>/identity-store.db, channels/<channel>/identities/) unless AGENTMUX_ISOLATED_AUTH=0 is set (isolated_auth_enabled in crates/common/src/data_paths.rs).

Unix: at each launch, AgentMux makes the data root ~/.agentmux owner-only: it creates it with mode 0700, or removes group and other permissions from an existing one, keeping the owner’s bits (ensure_owner_only_dir, called from DataPaths::ensure_dirs in crates/common/src/data_paths.rs). The subdirectories and most files inside are still created with your umask, but other users can’t reach them through the closed root. This is best effort: if the mode can’t be changed (for example, the directory belongs to another user or sits on a read-only mount), AgentMux logs a warning and starts anyway. It is also skipped when the data root has been pointed at your home directory itself.

These are restricted on their own as well:

File or directoryMode
authkey.dev0600
Registry files agents/<name>.json and shared/agents/reactive/<agent>/<channel>.json0600, set at creation
.mcp.json in an agent’s working directory, and AgentMux’s manifest of the entries it wrote (.claude/.agentmux-managed-mcp-servers.json)0600, written to a temporary file and renamed into place
The conversation store’s folder (shared/agents/transcripts/) and every file in it, including the logs and copies a repair or a space reclaim leaves beside it0700 and 0600, set again at every start
channels/<channel>/wan-identity/ and its wan.db0700 and 0600
The launcher’s IPC socket directory ($XDG_RUNTIME_DIR/agentmux/ or /tmp/agentmux-<uid>/)0700, and refused if owned by another user
The macOS sign-in helper script, a self-deleting temp file0700, set at creation

An agent working directory outside ~/.agentmux keeps its own permissions; of the files AgentMux writes there, only .mcp.json and its manifest are restricted. To confirm the root is closed, run ls -ld ~/.agentmux.

Windows: files inherit the access control of your profile folder, which by default admits only you, SYSTEM and administrators. authkey.dev additionally gets an owner-only access list that doesn’t inherit from its folder, and so do the conversation store’s folder and every file in it (an access list of you and the system, set again at every start).

A credential attached to an identity account is stored as a SecretRef, a pointer that says where the value is (crates/srv-core/src/backend/storage/identities.rs). Resolution is in resolve_secret (crates/srv-core/src/identity/resolver/secret.rs).

Accounts whose key is kept in the OS secret store (a key or token that an account keeps outside the Vault, such as the key of an account connected with OAuth) are stored through the keyring crate: macOS Keychain, Windows Credential Manager, or Linux Secret Service. The entry uses service agentmux and account acct:<account id>; the database holds only this pointer and non-secret metadata (crates/srv-core/src/identity/secret_store.rs). The value is read at agent launch.

On Linux you need a running Secret Service (GNOME Keyring, KWallet or similar). Without one, saving the key fails with an error; AgentMux has no plaintext fallback.

An API key you add to a new account in Connectors → Accounts with Save and validate is kept as an API key entry of the Vault, labelled provider account key: name and tagged account-key. The account row holds only the entry’s id; the key is sealed in the entry like any other, you can copy or replace it in the Vault, and deleting the account deletes the entry. Replacing the key of an account keeps it where it is.

AgentMux stores only the variable name and reads the value at launch from the AgentMux server’s own environment. That is the environment AgentMux itself was started with, which for an app started from the Start menu, Dock or a desktop launcher is not your shell’s. The value is never written to disk by AgentMux.

For Claude Code, Codex, Gemini and Copilot logins, AgentMux stores only a directory path, and points the CLI at it with the CLI’s config-directory variable (CLAUDE_CONFIG_DIR, CODEX_HOME, GEMINI_CLI_HOME, COPILOT_HOME). The CLI writes and refreshes its own tokens there, in its own format; AgentMux does not encrypt them. The directories are:

  • shared/providers/<provider>/, the default login shared by every agent of that provider, on every channel;
  • shared/identities/<account>/<provider>/, one per account;
  • the CLI’s usual location in your home directory (for example ~/.claude), for an agent set to use the ambient login.

AgentMux reads one of these tokens itself: at each launch it uses the Claude login from shared/providers/claude/ to fetch the current model list from Anthropic. See Data sovereignty.

The value is stored as-is in the database. resolve_secret returns it only in debug builds (cfg(debug_assertions)); release builds refuse it with an error.

AgentMux stores the secret’s name or ARN and, for a JSON secret, the path of one field in it. The value is read from AWS Secrets Manager at agent launch, with this computer’s own AWS login, and is never written to disk by AgentMux. A read that fails refuses the resolution with the reason.

CredentialWhereAt rest
MuxBus Cloud sign-in (access, refresh and ID tokens)OS secret store; email and expiry in shared/store.db. On Windows the tokens are split into chunks across several Credential Manager entries, because one entry holds at most 2,560 bytes (crates/srv-core/src/backend/storage/muxbus.rs)OS secret store
Per-agent MuxBus machine credentials (client id, client secret, cached access token)shared/store.db, table db_agent_credentialsPlaintext
Passwords saved for HTTP Basic auth in browser panesOS secret store, one entry per identity and site (crates/srv-core/src/identity/browser_credential_store.rs)OS secret store
Browser-pane cookies and site storagecef-cache/Chromium is started with --password-store=basic (and, on macOS, --use-mock-keychain) so it never touches the OS keychain; by the code’s own description the cookie store then has only obfuscation-level encryption. Treat it as plaintext.
Agents’ signing keys: HMAC key, LAN and WAN Ed25519 private keysobjects.db (HMAC, LAN, and WAN keys minted before wan.db existed) and wan.db (WAN). They are in no file of the agent’s working directoryPlaintext
The install’s WAN instance private key, which certifies its agents’ WAN keyswan.dbPlaintext
Agents’ identity tokens (AGENTMUX_AGENT_TOKEN)objects.dbPlaintext
KEY=VALUE lines in an agent definition’s environmentobjects.db, and copied into the pane’s settingsPlaintext
Instance auth key and host IPC tokenauthkey.dev (0600), ipc-port-<hash> (default permissions, inside the owner-only data root on Unix), registry files (0600)Plaintext; regenerated at every launch

An agent’s MCP server fetches its HMAC key and LAN private key from AgentMux with its identity token (GET /agentmux/agents/self/keys, served only to the agent the token names) and asks again when the HMAC key expires or a signature is rejected. The WAN key stays in wan.db: AgentMux signs WAN messages itself. No signing key is written into .mcp.json or any other file of the agent’s working directory: the file holds references, not values, and AgentMux removes any signing key it finds in it when it starts (inject_jekt_signing_keys_into_mcp_json and write_mcp_json_respecting_user_servers in crates/srv-core/src/backend/agent_config.rs). The file is still written owner-only (0600 on Unix). An existing .mcp.json is merged, not replaced: MCP server entries AgentMux didn’t write, and other top-level keys, are kept; the agentmux entry is always AgentMux’s. A file that can’t be read or isn’t a JSON object is left untouched, and the agent’s MCP servers aren’t written for that launch.

The Vault holds the secrets you keep for agents to use: ID numbers, cards and bank accounts, API keys, logins and notes. Its storage:

  • One Vault key, 256 random bits made with the first entry. The desktop app keeps it in the OS secret store. A headless server keeps it in a file of its own under shared/secrets/ that only the server’s account can read (mode 0600, in a 0700 folder), unless the server was set up with --secret-store keychain. One item rather than one per value: Windows Credential Manager caps an item’s size, and macOS asks about each item separately. If the key goes missing while entries exist, AgentMux says so and doesn’t make a new one, which couldn’t open them.
  • Each entry is one row in shared/identity-store.db, which every AgentMux on the computer shares, whatever its channel. The row holds the id, kind, label, plain details and tags as they are, and the secret parts sealed together with the Vault key: ChaCha20-Poly1305, a random nonce each time, and the entry’s id as associated data, so sealed parts copied to another row don’t open. No column holds a value.
  • Activity records who did what to which entry, and where; never a value.
  • A .vault export, the Vault’s own format, is an age file encrypted to a passphrase you choose. A .kdbx export is a KeePass database protected by a password, and the CSV and JSON exports are not encrypted. Only you export or import, from the Vault; no agent route starts either or chooses the file.

An agent can add an entry or change one, through the Vault tool, Browser capture or Terminal run with capture, with a reason: each such change is a line in the entry’s history, the value it replaced is kept for 7 days, and the Vault shows you what agents changed so you can undo it (see Changes by agents). Each agent is held to a pace of 30 changes an hour. Only you delete an entry, reveal or copy a value, or export, and no route returns a value to an agent. A value reaches a web page or a command only after you allow it for that site, or for that agent’s commands. Reveal and Copy confirm it’s you each time: with Windows Hello on Windows, and with Touch ID or your Mac’s password on macOS. On Linux they are off for now.

The Vault is kept off agents’ screens. An agent’s UI screenshot blacks out the Vault, and its UI window capture of an AgentMux window blacks out the Vault, the Audit, Memory and your own profile’s browser panes, from rectangles that only AgentMux’s own window can report. If the window can’t report them, or its layout changes while the frame is taken, the capture is refused.

The same limits as the rest of this page apply: a process running as your user can read the OS secret store and the database, and so open the Vault.

AgentMux keeps the secrets it holds out of an agent’s conversation record. A value that AgentMux itself keeps secret (its keys, an agent’s token, a value of the Vault it handed to an agent’s process, the sign-in values of an account, the keys in the OS secret store, the cloud sign-in, a messaging bridge’s token, a key in an agent’s environment lines) is never written into the stored conversation and never shown from it to a paired device: a line that holds one is stored with [withheld] in its place, whatever form the value is spelled in (as it is, base64, URL-encoded, hex or as JSON holds it). A value stays hidden while it can still be used, including after a newer one replaced it, until it expires or is revoked. The same holds for a conversation read back from the record and for a session exported with an agent. The list is bounded and never turns hiding off: a value too large for it is matched by an exact search, and if the list can’t be used every line is shown as [withheld]. Tokens under 8 characters aren’t hidden. A value that isn’t in AgentMux’s list isn’t hidden.

At each agent launch (inject_identity_env in crates/srv-core/src/identity/resolver/inject.rs):

  1. AgentMux looks up the accounts linked to the agent’s definition.
  2. For an API-key account it resolves the SecretRef and sets the provider’s variables in the process environment: GITHUB_TOKEN and GH_TOKEN for GitHub, ANTHROPIC_API_KEY, OPENAI_API_KEY, AWS_ACCESS_KEY_ID. A failed resolution is logged and skipped.
  3. For an OAuth account it sets the CLI’s config-directory variable. If the account can’t be resolved, the launch is refused, unless the agent is set to use the ambient login.
  4. Credentials go into the process environment, never onto the command line. Container agents receive them through the Docker API, not docker exec -e.
  5. The log records account ids, providers and the number of variables injected, not the values.

AgentMux adds its own variables to every agent process as well: AGENTMUX_AUTH_KEY (full control of the local AgentMux server; a container agent gets a narrower per-agent token in it instead) and AGENTMUX_AGENT_TOKEN. Your MuxBus Cloud login is not passed to agents: MUXBUS_TOKEN and the variable that names the sign-in service’s domain are removed from every agent’s environment. See the trust model.

It also sets GH_CONFIG_DIR in every Native agent process (not in container agents), and in commands run on an agent’s behalf, to a per-agent directory under AgentMux’s config directory that holds no gh login; a login made there is removed at the next spawn (crates/srv-core/src/backend/gh_guard.rs). A plain gh command in an agent therefore can’t act as the gh login you made on the machine. A GitHub token from the agent’s own account (GH_TOKEN) still works.

  • Keychain: update the account’s key; AgentMux rewrites the OS secret-store entry. Agents pick it up at their next launch.
  • Env: change the variable in the environment AgentMux is started from, then restart AgentMux, not just the agents: the value is read from the server’s own environment.
  • OAuthConfigDir: sign in again through the CLI, or the account’s sign-in flow in AgentMux. The CLI refreshes tokens itself.
  • Agent signing keys: the HMAC key is replaced once it is 24 hours old, when the agent’s MCP server next fetches its keys (at startup, and again when the key expires). LAN and WAN keys are not rotated. All three are deleted with the agent, unless another agent still uses that name. The install’s WAN instance key is not rotated either.
  • Instance auth key, host IPC token, lan_key: new at every launch.
  • Anything running as your OS user can read the database files, the CLI login directories, and the environment of agent processes (for example /proc/<pid>/environ on Linux). On Windows and Linux it can also read AgentMux’s OS secret-store entries; on macOS the Keychain may prompt first. The OS secret store protects against other users and offline disk access, not against your own processes.
  • A credential in an agent’s environment is available to everything that agent runs. If you give an agent a GitHub token and it runs npm install, every install script gets GH_TOKEN too.
  • The Env variant trusts AgentMux’s environment. Whatever set that variable before AgentMux started decides what gets injected.
  • Root or an administrator can read all of the above.

These follow from running agents as you. If you need stronger isolation, use OS-level separation: a separate user account, a VM, or a container agent.


Source-of-truth references:

Related: Identity & Accounts (the feature), Data sovereignty, Trust model.