r/Bitwarden • • 2d ago

Managing API keys for AI agents

I've recently been connecting my AI to a bunch of services that I use.

It's been interesting figuring out how to get Claude to use an API directly. While many services offer hosted MCPs to make this easy, not all do. Garmin is a good example: they provide an API to access your personal training data, but they don't have an MCP server.

There are also potential advantages to using APIs directly -- it's faster and less token-hungry than MCP.

However, it's trickier. For example, MCPs handle secure authentication; with APIs you have to handle this yourself.

I've read that it's possible to use password managers for API keys, and 1Password seems to be set up quite well for this. With Bitwarden, I've heard it's much clunkier than other options (see below). I was just wondering if other Bitwarden users had encountered this situation and what they thought about it. Is it something that has tempted people away from Bitwarden to 1Password?

Here's what I've read:

1Password. This is the cleanest password-manager option. You put a reference like op://Personal/Garmin/credential in the config and launch the connector with op run. 1Password fills in the key when the connector starts, unlocked with Touch ID.

Bitwarden. It works, but it's clunkier. Its command-line tool needs to be unlocked first, and Bitwarden Secrets Manager needs its own access token, which you'd then have to store somewhere. That just moves the problem one step along.

0 Upvotes

3 comments sorted by

•

u/dwbitw Bitwarden Employee 1d ago

Hey there, let me know if you've checked out this section on the blog: https://bitwarden.com/blog/tag/agentic-ai/

It covers the following:

  • Bitwarden Secrets Manager - Provision AI agent access to pre-determined development secrets to use in scripts and CI/CD pipelines.
  • Bitwarden Access Intelligence - Uncover shadow AI. Identify AI applications being used within the organization and by whom. 
  • Agent Access SDK - Enable just-in-time, human-in-the-loop credential access to approved agents with this development toolkit. 
  • Bitwarden MCP server - Access, generate, retrieve, and manage passwords via self-hosted AI assistants while maintaining zero-knowledge encryption. 

2

u/m4uri 2d ago

The "moves the problem one step along" part is true, but you can make that step a lot smaller.

Secrets Manager: create a machine account that only has read access to one project with just the Garmin key in it. Then bws run -- your-connector injects the secrets as env vars when it starts, same idea as op run. The access token itself I'd keep in the macOS keychain and pull it at launch, something like

BWS_ACCESS_TOKEN=$(security find-generic-password -s bws -w) bws run -- node garmin.js

If that token leaks, the damage is one read-only project and you revoke the token in the Secrets Manager web app. Way smaller blast radius than your whole vault.

The normal password manager CLI works too: export BW_SESSION=$(bw unlock --raw) and then bw get password garmin-api. Downside is that session key unlocks everything until you run bw lock, so I wouldn't leave it sitting in a long running agent's environment.

What you don't get is the Touch ID prompt per launch like with 1Password. Is the agent running locally on your Mac or somewhere headless?

1

u/Kondics-Sephora80 1d ago

yeah scoping the machine account to just that one project definitely keeps the blast radius manageable