Hermes agent bitwarden setup is two jobs, not one: bws feeds your API keys into Hermes at startup, and bw lets the browser sign in to websites with logins you already keep in Bitwarden.
Here is how I'd set both up, in seven steps, using only the commands and keys in the official Hermes Bitwarden Secrets Manager page and the Passwords and Logins page.
The example running through every step is a two-person design studio with Hermes on a laptop and a gateway on a small VPS, both needing the same OpenRouter and Anthropic keys.
Want a second pair of eyes on your own layout first? Book a free SEO strategy session with my team.
What You Are Actually Wiring Up
Bitwarden Secrets Manager is built for machines. You talk to it with the bws CLI and a machine-account access token.
The Bitwarden password manager is built for people. You talk to it with the bw CLI and your master password.
Hermes uses the first to set environment variables when a process starts, and the second when its browser reaches a sign-in page.
Keep that split in your head and every step below makes sense. Mix them up and you will paste the wrong credential into the wrong prompt.
| Piece | bws (Secrets Manager) | bw (password manager) |
|---|---|---|
| Holds | Provider keys such as OPENROUTER_API_KEY | Website logins and TOTP seeds |
| Hermes touches it | Every time hermes, the gateway or cron starts | The first time the agent needs a saved login |
| You turn it on with | hermes secrets bitwarden setup | Installing and signing in to bw |
| Off switch | hermes secrets bitwarden disable | hermes vault sources --disable bitwarden |
Step 1: Build The Project And Name Every Secret Like An Env Var
In the Bitwarden web app, open the product switcher and move to Secrets Manager.
Create a project for the studio, something like "Hermes keys".
Now add each provider key as a secret. The secret Name is what Hermes turns into the environment variable, so the name has to match exactly what Hermes reads.
For the studio that means two secrets: OPENROUTER_API_KEY and ANTHROPIC_API_KEY.
A typo here doesn't throw an error. Hermes sets a variable nobody reads, and the provider still looks unconfigured.
Step 2: Create The Machine Account And Copy The Token Once
Go to Machine accounts, create one (the docs use "My Hermes machine"), open its Projects tab and grant Read access to the project.
Then open Access tokens, create a token, choose an expiry or "Never expires", and copy it straight away.
Bitwarden will not show that token a second time, so put it somewhere safe before you close the dialog.
The Bitwarden Secrets Manager CLI docs describe the same token: bws signs in with it through the BWS_ACCESS_TOKEN variable or the --access-token flag.
🔥 Want the whole Hermes stack, keys and vault included, set up from a template? Inside the AI Profit Boardroom you get step-by-step video trainings, the installable Agent OS with Hermes, four coaching calls a week and 3,600+ members comparing how they store keys across machines. → Join the AI Profit Boardroom
Step 3: Run The Wizard On The Laptop
hermes secrets bitwarden setup
The wizard walks a fixed path.
It installs bws if the binary is missing, asks for the token with hidden input, then asks which region the machine account lives in: US Cloud, EU Cloud or a self-hosted URL.
Next it lists the projects that account can see, lets you pick one, test-fetches the secrets and shows which env vars will resolve.
Only after that does it set secrets.bitwarden.enabled: true.
The token lands in ~/.hermes/.env as BWS_ACCESS_TOKEN. The region and project id go into config.yaml.
Step 4: Script The VPS With Flags
The gateway box has no one sitting at it, so use the non-interactive form documented on the page and in the CLI reference:
hermes secrets bitwarden setup --access-token "YOUR_TOKEN" --server-url https://vault.bitwarden.eu --project-id PROJECT_UUID
Swap in your own token and project UUID, and drop --server-url if the account is on US Cloud, because an empty value means the US default.
Two rules bite here. The project id has to be UUID-shaped or Hermes rejects it, and the server URL must be https://; plain http:// is refused except for localhost.
The full flag list is in the Hermes CLI commands reference.
Step 5: Check Status, Then Do A Dry Run
hermes secrets bitwarden status
hermes secrets bitwarden sync
status reports the current config, the bws version, and whether a valid token is in place.
sync pulls the secrets now and shows what would be applied without changing anything.
When you want the values in your current shell, sync --apply exports them.
From here on, every hermes start pulls fresh secrets, and the first time secrets are applied in a process you get a one-line summary on stderr.
Step 6: Decide Who Wins, Bitwarden Or .env
By default override_existing is true, which makes Bitwarden the source of truth.
That is what you want for rotation: change a key once in the web app and both studio machines pick it up on their next start.
If one machine needs a local value to stick, list that variable under secrets.preserve_existing instead of flipping the whole switch.
Flip override_existing: false only if you want every .env or shell export to beat the vault.
The Hermes secrets overview lays out the full precedence ladder when more than one source is enabled.
Step 7: Hook Up bw For Website Logins
The second half needs no Hermes command at all.
Install the Bitwarden bw CLI and sign in. Hermes detects it and your website logins become fillable next to any logins in the local Hermes vault.
The first time the agent needs one, you get a masked prompt for your master password. Hermes passes it to bw unlock --passwordenv and keeps only the session token in memory.
You unlock once per session, and 30 idle minutes locks it again.
The agent drives it through the browser_vault tool, whose actions are list, fill, save_login, enter_code and unlock, as listed in the tools reference.
A fill only goes through when the page origin matches the item's saved site, and the model never sees the password.
📞 Running Hermes on more than one machine and not sure how to split the keys? Book a free SEO strategy session and my team will look at your setup with you. → Book your free call
Sharing One Project Across Several Profiles
If the studio runs a separate profile for each client chat bot, one Bitwarden project can still feed all of them.
Profile aliasing is on by default. A secret named TELEGRAM_BOT_TOKEN_MILLA fills TELEGRAM_BOT_TOKEN when Hermes runs as the milla profile.
Only credential-shaped suffixes count, such as _API_KEY, _TOKEN, _SECRET, _KEY and _PASSWORD.
A secret stored under the plain name always beats an alias, so don't keep both unless you mean to.
Rotating A Dead Token Without Re-running Setup
When a token expires, gets revoked or belongs to the wrong region, startup prints a warning and a second line pointing at the fix.
The fix is one command:
hermes secrets bitwarden token
It probes Bitwarden with the new token before it writes anything, so a bad paste leaves the current .env alone.
On success it saves the token, clears the fetch caches and warns you if the configured project isn't visible to the new machine account.
If the warning mentions a region mismatch, re-run setup and choose EU or self-hosted, or set secrets.bitwarden.server_url.
Gotchas I'd Watch For
- The agent can't run bws for you. Hermes strips
BWS_ACCESS_TOKENfrom the terminal,execute_code, background processes and cron scripts, andterminal.env_passthroughcan't add it back. Runbwsfrom your own shell. - The token is the whole key. The docs point out machine accounts can't be 2FA-gated. Keep it in
.env, never inconfig.yaml, and revoke it in the web app if it leaks. - Don't store the token inside the project. Hermes silently skips
BWS_ACCESS_TOKENif it shows up as a secret. - Locked bw in headless runs. Cron jobs, webhooks and the API server can't answer an unlock prompt, so a locked manager reports
unavailable_in_this_session. - Cache timing. The default
cache_ttl_secondsof 300 lets one process reuse a single fetch for up to five minutes.
Running More Than One Secret Source
Some teams pair the studio Bitwarden project with a personal vault plugin. Hermes allows several sources at once and resolves them with a fixed ladder.
Your .env or shell wins unless a source sets its own override_existing: true, which Bitwarden does by default.
A source that maps named variables to references beats a source that injects a whole project, whatever order they load in.
Within the same shape, the first source wins, and a later claim on the same variable is skipped with a startup warning rather than silently.
If you want to pin the order, list it under secrets.sources, for example with bitwarden first.
Repairing The bws Binary
auto_install is on by default, so a missing bws gets requested from the pinned package the first time it is needed.
If the binary goes missing or looks broken later, run hermes secrets bitwarden install. It needs no Bitwarden sign-in.
install --force checks and repairs the managed copy, reusing valid entries without another download.
The managed archive is checked against a SHA-256 hash in a lock file. If that check fails, stop and look at the download source; the docs say never bypass it.
A bws already on your PATH is used first, before any managed copy.
Optional: An Encrypted Fallback Cache
If the VPS sometimes loses its connection, set encrypted_cache.enabled: true.
Hermes then keeps the last good fetch in an AES-GCM encrypted file at ~/.hermes/bws_cache.enc.json.
Pair it with encrypted_cache.max_stale_seconds to allow that copy only after network or timeout failures, up to the age you set.
Authentication failures never fall back to stale secrets, which is the right call.
Using 1Password instead of Bitwarden? The Hermes 1Password walkthrough covers that manager.
My Verdict On This Setup
For a studio with a laptop and a VPS, this is the cleanest way to stop copying keys between machines.
Startup never hangs on Bitwarden: if the fetch fails, Hermes warns once and carries on with the keys in .env.
The docs themselves say a single machine with a working .env gains little, so skip the bws half if that is you and just sign in to bw for logins.
Members of the AI Profit Boardroom get the installable Agent OS this all plugs into.
Also On Our Network
- 🌐 Whether central Bitwarden keys and agent logins pay off for a small business
- 🌐 An eight-point scorecard on Hermes and Bitwarden, from setup to unattended runs
- 🌐 A quick start and five agent prompts for Bitwarden keys and logins
- 🌐 Which model keys belong in your Bitwarden project, using live GoldieBench scores
FAQ: Hermes Agent Bitwarden
What is the difference between bws and bw in Hermes?
bws is the Bitwarden Secrets Manager CLI that Hermes uses to load API keys at startup. bw is the password manager CLI that Hermes uses to fill website logins in its browser.
Which command starts the Hermes Bitwarden setup?
hermes secrets bitwarden setup. It installs bws if needed, takes the machine-account token, asks for the region and project, test-fetches and then enables the integration.
Can I set up Bitwarden on a server without the wizard prompts?
Yes. Pass --access-token, --server-url and --project-id to hermes secrets bitwarden setup on one line.
Why does my agent say BWS_ACCESS_TOKEN is missing in its terminal?
That is by design. Hermes strips the token from every process the agent spawns, so run bws yourself from your own shell.
How long does a bw unlock last?
Once per session, with a 30-minute idle timeout, according to the Hermes Passwords and Logins docs.
How do I swap in a new machine-account token?
Run hermes secrets bitwarden token. Hermes checks the new token with Bitwarden first and leaves .env unchanged if it is rejected.
📺 Video notes + links to the tools 👉
🎥 Learn how I make these videos 👉
🆓 Get a FREE AI Course + Community + 1,000 AI Agents 👉
About Julian
I'm Julian Goldie, an SEO entrepreneur, author and founder of the AI Profit Boardroom, which has 3,400+ members.
I help business owners scale with AI agents, automation and SEO.
- I've built a 7-figure SEO and link building agency, Goldie Agency, with a team of 70+ SEO experts.
- I've grown a YouTube channel to 400,000+ subscribers.
- I wrote "Link Building Mastery".
- My Udemy courses have taught over 29,000 students.
→ Get my best AI training inside the AI Profit Boardroom
Name your secrets, create the machine account, run the wizard on each machine, sign in to bw, and if you want my team to check the plan, book a free strategy session or join the AI Profit Boardroom for your hermes agent bitwarden setup.











