Blog

Why a local daemon holds the keys on your desktop

BotPassword is built around one per-user process that holds keys and enforces policy, with separate human and agent endpoints. Here is the reasoning from ADR 0006.

BotPassword team4 min read

In BotPassword, one per-user background process, botpasswordd, is the only thing on a desktop that holds unwrapped keys. The app window, the command line, the MCP adapter, credential helpers and the browser bridge are all authenticated clients of it. This post explains ADR 0006 and why the split matters for agents.

What problem does a single key custodian solve?

A desktop password manager has many front doors. A graphical app, a command-line tool, an MCP server for agents, planned git and Docker credential helpers, and a browser extension all need vault access. If each one held its own copy of the keys, the attack surface would multiply with every client, and each would need its own unlock state.

The opposite design, keys held only in the app’s UI process, has its own failure: agents would stop working whenever the window was closed. A coding agent running a deploy overnight cannot depend on a visible window.

ADR 0006 resolves this with a daemon: a launchd agent on macOS, a per-user service on Windows and a systemd user unit on Linux. It holds keys, the local store, sync, policy and the broker. Everything else asks it.

What does the daemon expose?

Two separate local endpoints, each a Unix domain socket or Windows named pipe restricted to the current user:

Endpoint Clients What it can do
human The desktop app, and mobile apps over a paired channel Unlock, reveal, export, edit, enroll devices, create and edit grants, recover, approve
agent bpw, bpw mcp, planned credential helpers, the native-messaging host (fill only) The agent intents only

The important sentence in the design is that the agent endpoint has no code path to human-only operations. They are not merely forbidden by a policy check. A message on the agent socket that names a human-only operation is rejected by its type before any policy runs. An agent that has been tricked into asking for a reveal, an export or a grant change does not hit a “no”. It hits a wall that has no door.

That is why the rule “no intent returns a value” can be stated structurally. See intents, not values for the intent list that endpoint serves.

How does the daemon know which agent is calling?

Each harness installation is enrolled as its own client, with a key the daemon creates and an approval in BotPassword. On each connection the daemon also checks what it can about the peer process: on macOS the code signature and signing identity, on Windows the Authenticode publisher, plus the executable path and the working directory. The working directory maps to a project, so a grant can be bound to one repository.

The approval sheet shows the result in plain words, such as which signed application is asking and from which project directory. Self-reported names, like an MCP client’s own label or a model name, are recorded as unverified.

What are the honest limits?

The ADR records them, and so do the design notes.

  • Same-user containment is limited. Another process running as the same user can still try to impersonate a client. Peer checks give meaningful attribution, not strong isolation. Anything the operating system lets one of your processes do to another is outside what this layer can promise.
  • Lifecycle needs care. A background service has to survive crashes, handle updates and re-lock correctly. A bug in the custodian is a bug in the part that matters most, so the code that parses messages and enforces policy is kept small and shared.
  • Messages are strict. Frames are length-prefixed, deterministic CBOR with bounded sizes, and the design rejects unknown or non-canonical encodings rather than being liberal in what it accepts.

Why does this matter for AI agents specifically?

Because the thing on the other side of the agent socket is not trusted. An agent reads untrusted text, and the documented history of coding agents includes prompt injection that turned a helpful assistant into a data thief. Examples in the dataset include a Gemini CLI allowlist bypass (fixed in July 2025, see /agents/gemini-cli) and a Cline exfiltration through DNS (/agents/cline). A design that assumes the agent might be hostile belongs in a process that the agent cannot reach into.

The daemon also gives the agent a stable place to be useful. Because it is a long-running service, a rotation that begins at night can finish at night; the broker’s state machine lives in the same process and the same local store (agent-driven key rotation describes it).

How do the other pieces connect?

The design routes four things through the daemon:

  1. The human app for unlock, reveal and approvals.
  2. The browser extension through a native-messaging host with a paired identity, which gets fill data for one verified frame only.
  3. The command-line tool and MCP adapter, which hold no keys of their own.
  4. The sync client, which exchanges signed ciphertext with the cloud control plane. The server never decrypts.

The single unlock state is a user-visible benefit: unlock once, and every desktop surface agrees.

What would change this decision?

ADR 0006 is accepted, but not frozen. If peer-process verification proves too weak on a platform, or if the lifecycle cost outweighs the benefit, the alternative is to hold keys in the app and give agents a narrower, more restricted path. The recorded consequences make that trade-off explicit.

For background on why agents and secrets should be kept apart in the first place, read why agents should never see your API keys.

More from the blog

Give agents access. Keep the keys.

BotPassword is in early access. Request an invite and we'll email you when your spot opens.