Guides · 26 November 2026

Is it safe to paste an API key into ChatGPT or Claude?

What actually happens to a password or API key you paste into an AI chat, the real risks, and what to do if you already did it.

Short answer

It is not a catastrophe, but it is not safe either. A key pasted into an AI chat becomes part of a conversation that is stored, synced across your devices, sometimes shared or exported, and kept according to the provider's retention rules. Treat any key you pasted as exposed.

Where the key ends up

  • Conversation history: visible to anyone who gets into your account, and on every device where you are logged in.
  • Provider systems: conversations are stored server-side; depending on your plan and settings they may be reviewed for safety or used to improve models. Read your provider's data controls and retention settings.
  • Shared links and exports: a shared conversation shares the key with it.
  • The model context: during the session, an agent may copy the key into code, a commit, a log or a test file.

What to do if you already pasted a key

  1. Rotate it: create a new key in the service dashboard and revoke the old one. This is the only real fix.
  2. Delete the conversation, knowing that it does not guarantee removal from backups.
  3. Search your repository and logs for the key (git log -p | grep the first characters) in case an agent wrote it somewhere.

How to avoid it next time

Use restricted keys whenever the service allows it (read-only, limited scope, test mode). And give keys to agents through a channel that keeps them out of the chat: with the Shredkey MCP server, the agent asks, you paste the key in a one-time encrypted page, and it is written to your .env without appearing in the conversation. Step by step in this guide.

Share a secret now: encrypted in your browser, destroyed after reading.

Create a secret link Connect an AI agent