Free full scan for Mac. No account. Nothing leaves your device. Download free
Prycheck Download free
Security guide

What to Do After Pasting a Secret Into an AI Chat

Pasted a password or API key into an AI chat? Change the secret first, then clean up the chat, memory and shared links. Here is the order that works.

If you pasted a password, API key or token into an AI chat, change or revoke it first, then check for misuse. After that, delete the chat, remove any saved memory, and check shared links. Deleting the chat alone is not enough, because the provider may keep a copy for a while and you cannot confirm who else saw it.

This is a common mistake, and it usually happens in a hurry. A log file with a token in it, a config you wanted explained, a screenshot with a password on it. Do not panic and do not hide it. If you act quickly, this is normally a small, fixable problem.

Why deleting the chat is not enough

When you press delete, the chat leaves your screen right away, but deletion on the provider's systems takes longer. Published retention rules at the time of writing include:

  • ChatGPT: OpenAI says deleted chats are scheduled for permanent removal within 30 days, unless security or legal reasons require longer. Temporary Chats may also be kept for up to 30 days.
  • Claude: Anthropic says deleted chats leave its back-end systems within 30 days. If you allowed chats to improve its models, de-identified data may be kept for up to 5 years. Flagged chats can be kept longer.
  • Gemini: With Keep Activity off, Google says chats are still kept for up to 72 hours.

Work plans and API use have different terms, and policies change. So assume that a copy may exist for some time, and make the secret useless.

Step 1: Work out what you pasted

Look back at the message and list everything sensitive in it. Long pastes often hold more than you meant to share. Check for:

  • Passwords and recovery codes
  • API keys and access tokens
  • Database connection strings, which often include a password
  • Private keys and certificates
  • Session cookies, and tokens in copied web addresses
  • Customer records and other people's personal details
  • Screenshots or files that were attached

Do not paste the secret into a new chat to ask for advice about it.

Step 2: Change or revoke the secret

Do this before anything else, even if it means something breaks for a few minutes.

API keys and tokens

  1. Open the provider's console and create a replacement with the smallest scope that works.
  2. Revoke the old key.
  3. Update your apps and confirm they work.

Our API key guide has more detail. If the key is very sensitive and an outage is acceptable, revoke it first and replace it after.

Passwords

  1. Change the password on the real service, from a device you trust.
  2. Change it anywhere else you reused it.
  3. Sign out of other sessions, if the service offers that.
  4. Turn on multi-factor sign-in.

Private keys and connection strings

Generate a new key pair, install the new public key, and remove the old one from every server. For a database, change the password, and restrict where connections can come from.

Session cookies

Sign out of the service to end the session, and use any option to sign out everywhere. A session token can work without your password.

Payment or identity details

Contact your bank or card issuer and follow their advice. For ID numbers, follow your local guidance. These can't be rotated like a key, so do not wait.

Step 3: Check for misuse

Look at activity from the moment of the paste onward.

  1. Check usage and billing for the affected API key.
  2. Review the sign-in history for the account.
  3. Look for new users, keys, forwarding rules or connected apps.
  4. If you find anything you do not recognize, follow your incident process and contact the provider.

Step 4: Clean up the AI tool

Delete the chat

Find the chat in your history and delete it. Check for a Project or folder holding the same content, and any files you uploaded.

Remove saved memories

Assistants may have saved details from the chat, and deleting a chat does not always remove them.

  • In ChatGPT, go to Settings > Personalization > Memory. OpenAI notes that to fully remove something, you should delete both the saved memory and the chat where you shared it.
  • In other assistants, look for memory or personalization settings and read what is stored.

Remove shared links

If you shared the chat, the secret may be readable by anyone with the link.

  • In ChatGPT, look under Settings > Data controls > Shared links. Menus can vary by version.
  • In Claude, go to Settings > Privacy and select Manage next to Shared chats. Anthropic says unsharing cannot remove copies other people already made.

Check connected tools

If an agent or coding tool had the chat open, it may have written the secret to a local log or history file. Search your project and tool folders. Check any note-taker, screen recorder or Recall snapshots that were running as well.

Step 5: Tell the right people

  • If the secret belongs to your employer or a client, tell your security contact now. This is usually a required step, and early reports are easier to handle.
  • If personal data about other people was in the paste, ask whoever handles privacy in your organization. There may be legal duties to consider.
  • Write down what was pasted, when, into which tool, and what you changed.

How to avoid it next time

  • Replace real values with placeholders before you paste, such as API_KEY=REDACTED.
  • Scrub logs before you share them.
  • Keep keys in a password manager, so they rarely sit on your clipboard.
  • Use a company plan with clear data terms for work content.
  • Use temporary chats for sensitive drafts, and remember they are not a safe place for secrets.
  • Add scope limits, expiry dates and spending limits to keys, so a mistake costs less.

Prycheck can show plain text keys on your device, which is a useful check if your secret also sits in a file.

Frequently asked questions

Can the AI company see my secret?

Assume it could be seen. Providers describe limited staff access, safety reviews and retention periods, which vary by plan. You cannot confirm from your side who or what saw it, so change the secret.

Will my secret be used to train a model?

That depends on your plan and settings. Personal plans may use chats for training unless you opt out. Turning this off generally affects future chats, so treat the pasted secret as exposed.

Is it fine if I pasted it into a temporary chat?

It is better, but it does not remove the risk. Temporary chats can still be kept for a period under provider rules. Change the secret anyway.

Find out what AI can reach on your computer.

The full scan is free. It takes minutes, needs no account, and stays on your device.

Download free for Mac
Download free