The checklist at a glance
- NowRevoke and replace the secretOnly this makes the old value worthless.
- NowCheck access and logsSpot misuse early.
- TodayDelete the chat, check trainingLimit the copy held by the provider.
- TodayDelete shared linksNobody else should open the chat.
- TodayTell ITAssess the impact together.
- If neededCheck reporting dutiesIf personal data may be affected.
1. Rotate the leaked secret now
GitHub's documentation is blunt: consider any leaked secret immediately compromised. Removing it does not stop misuse; revoking it with the provider does. The OWASP Secrets Management Cheat Sheet gives the same order: revoke, rotate, remove from the exposed system.
- API key or token: revoke it in the service's portal and create a new one. If a running service depends on it, deploy the new key first, then revoke the old one.
- Password: change it now, and anywhere else you used it. The Swiss Federal Office for Cyber Security (FOCS) also recommends one password per service and two-factor authentication.
- Connection string with a database password: set a new password for the database user and update every application that uses it.
Give the new key only the permissions it needs, as OWASP recommends.
2. Check access and logs
Next, check whether anyone used the old secret. GitHub recommends reviewing the audit logs of the service it belongs to. Look for:
- sign-ins from unfamiliar devices or locations,
- unusual API calls, or new keys and users you did not create,
- for email accounts: forwarding rules you did not set up. The FOCS advises removing them immediately.
3. Delete the chat – and know what that does
According to OpenAI, a deleted chat disappears from your account immediately and is permanently deleted within 30 days – unless it was already de-identified and disassociated from your account, or OpenAI must keep it longer for security or legal reasons. In business workspaces, authorised compliance tools may still access it under the retention policy.
Archiving is not deleting. An archived chat stays saved and searchable. And even deleting the chat does not replace rotating the secret.
On training: with a personal account, turn off "Improve the model for everyone" under Settings › Data controls; OpenAI says this applies to new conversations. Do not give the affected chat a thumbs up or down: according to OpenAI, the whole conversation may then be used for training even if you have opted out. More in How to turn off AI training.
4. Delete shared links
A link shared from a personal account can be opened by anyone who has it. OpenAI says shared pages are not intended for search engines, but that does not make them private: links can be forwarded.
- Under Settings › Data controls › Shared links › Manage, delete single links or all of them.
- Deleting the conversation also removes its shared link.
- If someone already continued the shared conversation, their separate copy remains in their account.
5. Tell IT or your security lead
Report it quickly and factually. GitHub recommends involving the secret's owner and security leads, and documenting the incident. Useful details:
- Which credential, for which service, with which permissions?
- When, in which AI service, with a personal or company account?
- Was the chat shared?
- What is already done (rotated, deleted, logs checked)?
6. Check whether you must report it
A leaked password is not automatically reportable. What matters is whether personal data became accessible to unauthorised parties through it.
- Switzerland: under Art. 24 FADP, the controller reports a data security breach to the FDPIC as soon as possible if it is likely to result in a high risk for the people concerned, using the FDPIC's online DataBreach form. Affected people must be informed if their protection requires it or the FDPIC asks.
- EU: under Art. 33 GDPR, the controller notifies the supervisory authority without undue delay and, where feasible, within 72 hours, unless the breach is unlikely to result in a risk. Every breach must be documented. If the risk is high, Art. 34 also requires informing the people affected.
Leave the assessment to your data protection officer or legal team. This section is not legal advice.
How to prevent it next time
- Never put secrets in prompts. For debugging, a placeholder such as
DB_PASSWORD=[REMOVED]does the job. - Keep secrets out of code. GitHub recommends environment variables and secret management tools; OWASP warns against hardcoded secrets.
- Clean code and logs before pasting. Config files, error messages and logs can contain credentials. OWASP says secrets should never be logged.
- Use a password manager, as the FOCS recommends.
- Catch slips automatically. AImori checks locally in the browser what you paste into ChatGPT, Claude, Gemini, Copilot or Perplexity, and detects API keys and tokens for many services, private keys and passwords in connection strings. On paste it replaces them before the text reaches the field; Alt+Shift+L turns every detected value into a placeholder. Typed characters can be read by the page before you send, which is why the paste check matters.
Check whether a text contains credentials with the free test, right in your browser.
Frequently asked questions
Is deleting the chat enough?
No: according to OpenAI, deleted chats are permanently removed only within 30 days, with exceptions, and the secret has already reached the provider, so it must be revoked and replaced.
I pasted the key but never sent it. Do I still need to rotate it?
If in doubt, yes: a web page can technically process input before it is sent, and a new key is quicker to create than misuse is to rule out.
Do I have to report a leaked API key to the data protection authority?
Only if personal data may have been exposed through it and the breach is likely to result in a risk (GDPR Art. 33) or a high risk (Swiss FADP Art. 24) for the people concerned; ask your data protection officer, as this guide is not legal advice.
Will ChatGPT train on my password?
According to OpenAI, content from personal accounts can be used for training while "Improve the model for everyone" is on, whereas ChatGPT Business, Enterprise and Edu content is not used for training by default.
Sources
Information as of 21 October 2026. This guide is not legal or security advice.
- GitHub Docs: Remediating a leaked secret in your repository
- OWASP: Secrets Management Cheat Sheet
- Swiss Federal Office for Cyber Security: Account hacked or data leaked – What should you do? · One password for multiple accounts (21 April 2026)
- OpenAI: Deleting and archiving chats in ChatGPT · Sharing conversations in ChatGPT · Data controls in ChatGPT
- Swiss Federal Act on Data Protection (FADP), SR 235.1, Art. 5 let. h and Art. 24
- FDPIC: DataBreach – reporting data security breaches (in German)
- GDPR (Regulation (EU) 2016/679), Art. 4(12), 33 and 34