Hermes Agent Bitwarden: Load API Keys and Logins From Your Vault
Hermes Agent Bitwarden support lets your agent pull its API keys from Bitwarden instead of a plain .env file, and lets its browser fill website logins without the model ever seeing your passwords. There are two separate tools involved, and mixing them up is the most common mistake. Here’s how each one works, straight from the Hermes and Bitwarden docs.
Key takeaways
bws (Secrets Manager) loads API keys when Hermes starts.
bw (the password manager) fills website logins in the browser.
Setup wizard: hermes secrets bitwarden setup.
Bitwarden never blocks startup, and the agent never sees the token.
According to the Hermes secrets docs, Hermes can load API keys from an external secret manager at startup. Bitwarden Secrets Manager is one of the supported sources, alongside 1Password and a command helper. Website logins are a different feature that uses Bitwarden’s password manager.
Tool
What Hermes uses it for
Command
Bitwarden Secrets Manager
API keys loaded at every startup
bws
Bitwarden password manager
Website logins and 2FA codes in the browser
bw
1. How the API key sync works
Create a Bitwarden machine account with read access to a project, and generate an access token.
Hermes stores that one token in ~/.hermes/.env as BWS_ACCESS_TOKEN.
Each time hermes, the gateway or a cron job starts, Hermes calls bws secret list <project_id>.
Each secret’s Name becomes the environment variable, for example OPENROUTER_API_KEY.
Bitwarden’s own Secrets Manager CLI docs confirm that bws signs in with a machine-account access token. Hermes only reads from the vault. It never writes back.
Want AI agents that keep your passwords safe? Inside the AI Profit Boardroom you get the Agent OS — Hermes, OpenClaw, OpenCode, Claude and Codex in one place — plus step-by-step Hermes training and four live coaching calls a week.
The wizard installs bws if it’s missing, asks for the token with hidden input, asks for your region (US Cloud, EU Cloud or a self-hosted URL), lets you pick a project, test-fetches, and then turns on secrets.bitwarden.enabled. For scripts there’s a non-interactive form:
Rotates the token, and only saves it if Bitwarden accepts it
hermes secrets bitwarden sync
Dry run of what would load
hermes secrets bitwarden sync --apply
Loads the secrets now
hermes secrets bitwarden disable
Turns the integration off
Setup flows and hermes model label each injected key “(from Bitwarden)”, so you can see where a key came from.
4. Settings worth knowing
override_existing is true by default, so Bitwarden values win over .env. Rotate a key in the Bitwarden web app and it takes effect on the next start. Set it to false if you want .env to win.
cache_ttl_seconds defaults to 300.
server_url must be https://. Plain http:// is refused except for localhost.
secrets.preserve_existing keeps chosen variables from .env per profile.
Bitwarden never blocks startup. If it fails, Hermes prints a one-line warning naming the fix command and carries on with the existing .env.
Hermes strips BWS_ACCESS_TOKEN from every process the agent spawns: the terminal, execute_code and cron scripts. env_passthrough can’t put it back.
Bitwarden can never overwrite the token itself.
6. Browser logins with the bw CLI
If the Bitwarden password-manager CLI bw is installed and signed in, Hermes picks it up automatically. The credential vault docs explain the flow:
The first time it needs a login, Hermes asks for your master password in a masked prompt.
Unlock lasts for the session, with a 30-minute idle timeout.
The browser_vault tool can list, fill, save_login, enter_code and unlock.
It refuses a fill unless the page matches the saved item’s site, and the model never sees the password.
Items with a TOTP seed let Hermes enter 2FA codes for you.
In cron, webhooks and the API server, a locked vault reports unavailable_in_this_session.
To stop using it, run hermes vault sources --disable bitwarden.
My verdict
If you already keep your keys in Bitwarden, this is the cleanest setup: one machine-account token in .env, every other key in the vault, and rotation that just works on the next restart. Add the bw CLI if you want the browser to log in for you. Hermes Agent Bitwarden keeps your keys and passwords out of the agent’s reach.
Run hermes secrets bitwarden setup. Paste a machine-account access token, pick your region and project, and Hermes turns the integration on.
Where does Hermes store the Bitwarden token?
In ~/.hermes/.env as BWS_ACCESS_TOKEN. The project id and region go in config.yaml under secrets.bitwarden.
Does Bitwarden override the keys in my .env file?
Yes, by default, because override_existing is true. Set it to false if you want .env to win.
What happens if Bitwarden is down when Hermes starts?
Hermes still starts. It prints a one-line warning with a fix command and uses the keys already in .env.
Can Hermes log into websites with my Bitwarden logins?
Yes, if the bw CLI is installed and signed in. Hermes asks you to unlock it once per session, then fills logins on the matching site without the model seeing the password.
How do I rotate an expired Bitwarden token in Hermes?
Run hermes secrets bitwarden token. Hermes checks the new token first and only saves it if Bitwarden accepts it.
Ready to put Hermes to work in your business? Join the AI Profit Boardroom for the Agent OS, setup training and daily updates.