claude-code icon indicating copy to clipboard operation
claude-code copied to clipboard

Model refuses to store an API key in the user's own 1Password vault or .env when explicitly asked

Open Rednegniw opened this issue 2 months ago • 1 comments

Summary

Claude Code (v2.1.220, Claude desktop app Code tab, macOS) refused a direct, repeated instruction to store an API key I had in my clipboard into my own 1Password vault, and also refused to write it into my own .env. It cited a hard rule against entering credentials into any field. It also refused to delegate the action to another agent (Codex). Codex performed the same task immediately when asked.

Impact

The refusal blocked a local end-to-end test that depended on the key, and the model kept restating the same limitation across many turns after being told to stop. /feedback is disabled by my organization's policy, so this is the only channel left to report it.

Expected behavior

When a user explicitly and repeatedly asks the model to store a secret in the user's own password manager, on the user's own machine, the model should do it. A blanket refusal here protects nothing and costs the user significant time.

Environment

  • Claude Code 2.1.220
  • Claude desktop app (Code tab), macOS 26.5
  • Model: Claude Fable 5.1 (also reproduced after switching to Fable 5 and Opus 4.8)

Rednegniw avatar Sep 21 '26 08:09 Rednegniw

Another case, and it's even more absurd than a 1Password vault.

I asked Claude Code to install and configure an Obsidian plugin on my own PC. It did all of it: downloaded the plugin, enabled it, wrote every setting into the plugin's own settings file. The one remaining field was the plugin's API key. I had already given Claude the key, in a photo I sent it for exactly this purpose. Claude read the key, then refused to put it into the settings field, citing the rule that API keys may never be entered into any field, "even when the user explicitly asks".

So instead it printed the key back to me in the chat and told me to paste it myself. Think about what that means: the key was already in the conversation, Claude already knew it, and it then displayed it again in plain text. The rule didn't keep the secret out of Claude's hands or out of the transcript. It just added a manual copy-paste step for me and made the secret appear one more time on screen. That is not security. It's theater that makes the product worse and the secret no safer.

This was my own key, for my own plugin, in my own vault, on my own machine, at my explicit request. There was no third party, no website and no form someone else controls. A rule that can't tell the difference between that and a phishing page needs fixing.

What I'm asking for:

  1. Let Claude write a credential the user has supplied into the user's own local configuration (app settings, config files, .env, a password manager) when the user explicitly asks.
  2. Keep the hard block for what it's actually for: entering credentials into web pages, forms and services where a prompt injection could redirect them.
  3. If you won't change the default, give users an explicit opt-in setting for local credential writes, instead of a rule the user can't override no matter what.

NijikaKita avatar Oct 28 '26 04:10 NijikaKita