# Keychain

> What the desktop app keeps in your system's keychain, and what it can read from it.

The desktop app keeps database passwords and secret variable values in your system’s keychain: the macOS Keychain, Windows Credential Manager or the Secret Service on Linux. They are never saved in Xerlock’s settings, and they stay on your computer.

## What’s stored

| Entry                          | Saved when                                                                 | Removed when                                                                                         |
| ------------------------------ | -------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- |
| Database password              | You save a [connection](/docs/desktop/database/) with a password           | You delete the connection, or check **Don’t save password, ask on connect**                          |
| SSH password or key passphrase | You save a connection that uses SSH with one                               | You delete the connection, remove its SSH settings, or check **Don’t save password, ask on connect** |
| Secret variable value          | You save a [secret variable](/docs/desktop/settings/environments/#secrets) | You delete the variable or its environment, or turn **Secret** off                                   |

Entries are saved under the services `dev.xerlock.database` and `dev.xerlock.variables`, so you can find them in your keychain app.

## What isn’t stored there

Connection details, such as the host, port, user, database and the paths to SSH keys and certificates, are kept in Xerlock’s settings on your computer. So are variable names and the values of variables that aren’t secret. Key and certificate files are never copied.

With **Don’t save password, ask on connect**, nothing is stored. Xerlock asks for the password each time it connects.

## What Xerlock reads

Xerlock only reads its own entries, by name. It never lists or searches your keychain, so it can’t reach entries saved by other apps.

* A database or SSH password is read only to open the connection.
* A secret variable is read only when a value that uses it is sent to your app, and the value then reaches your app. See [Using variables](/docs/desktop/settings/environments/#using-variables).

## Agents

The [MCP server](/docs/desktop/settings/mcp/) is off by default. No tool returns a password or a secret value: agents can list secret variables, but not their values.

With **Variables › Allow secret variables** on, agents can use `{{name}}` references to secret variables. Xerlock fills the value in before the tool runs, so it reaches your app, then hides it in what the agent gets back. If your app changes the value first, for example by encoding it, it can’t be hidden. See [Permissions](/docs/desktop/settings/mcp/#permissions).

## Error reports and analytics

Keychain values are never included in [error reports](/docs/desktop/settings/general/#error-reporting) or [usage analytics](/docs/desktop/settings/general/#usage-analytics).

## Your app’s SecureStore

SecureStore is your app’s storage on the device, not your computer’s keychain. The Storage panel only reads the SecureStore keys you look up, and hides their values until you reveal them. Agents see those values masked unless **Storage › Reveal SecureStore values** is on. See [Looking up SecureStore keys](/docs/desktop/storage/#looking-up-securestore-keys).
