A secret in an AI chat is a password or key typed or pasted into a chatbot.
This guide is for anyone who uses AI chat tools, at home or at work. You do not need to write code to be affected: if you paste a settings file, an error message or an email into a chatbot, a password or key can come along with it.
In short
- What you type into an AI chat goes to the company that runs it, and is often stored.
- Depending on the tool and its settings, chats may be kept for a long time, read by reviewers or used to train the AI.
- Deleting the chat may not remove every copy. If a password or key went in, change it.
- Swap real values for placeholders such as FAKE-KEY before you paste anything.
What you will learn
- Explain where a message goes after you send it to an AI chat tool.
- Spot passwords and keys hiding in text you are about to paste.
- Check the settings of the AI tools you use.
- Know what to do if you have already pasted a secret.
- Software password (secret)
- a password, key or token that a program uses to prove who it is to another program.
- Your message to the AI (prompt)
- the text, files or pictures you send to an AI chat tool.
- Stand-in value (placeholder)
- a made-up value, such as FAKE-KEY, that takes the place of the real one.
What is a secret in an AI chat?
Think of handing your house keys to a busy hotel reception desk while you ask for directions. The staff may be honest. But your keys now sit in their drawer, where other people may see them, and you do not control when they come back.
An AI chat tool is a program you talk to by typing, such as a chatbot. What you type is called a prompt. Each prompt is sent to the company that runs the tool, where the AI reads it and writes a reply.
A secret is a password, key or token that one program uses to prove who it is to another. Many secrets belong to non-human identities (NHIs). An NHI is a digital identity, or the credential behind it, that represents a machine, app, service or AI agent. It lets them connect to other systems without a person. An API key is a common example: a secret code that lets one program use another.
People rarely mean to share a secret. It usually rides along inside something else, like a settings file, an error message or a copied email thread.
Where the comparison stops working: you can ask the hotel for your keys back. Once a prompt is sent, you cannot reach every copy that may have been made.
Why does it matter?
A password or key works for whoever holds it. Once it leaves your hands, you depend on someone else's storage and settings to keep it safe.
The UK's National Cyber Security Centre says the company running an AI chat tool can see the prompts. It says prompts are stored and will almost certainly be used to develop the service at some point.[1]
If you use AI tools at work
What could happen: you paste a config file to fix an error, and a live key to a customer database goes with it.
Check this: use the AI tool your employer has approved, and strip out passwords and keys first.
If you are learning to code
What could happen: you ask a chatbot why your app will not connect, and you paste the app's API key to show it.
Check this: replace the key with FAKE-KEY. The AI can still help with the problem.
If you manage a team
What could happen: staff use personal AI accounts for work, where your company has no say over how chats are kept.
Check this: agree which tools are approved and write down that secrets stay out of all of them.
Next: Shadow AI for Beginners
What does it look like?
Here is a made-up chat. A developer wants help with an error and pastes the whole settings file.
Example only. All values are made up.
You: My app won't connect. Here's my settings file, what's wrong? DB_HOST=db.example.invalid DB_USER=shop_app DB_PASSWORD=FAKE-Summer-0000 (1) MAIL_API_KEY=EXAMPLE-KEY-0000-FAKE (2) Error: connection refused on port 0000 (3) AI: The host name looks wrong. Try ...
- In a real file, this line would contain the database password.
- In a real file, this line would contain the email service's API key. The question did not need it.
- The error message is what the AI actually needed to see.
Why this is risky: both secrets are now stored by the AI company, in the chat history, and in any shared link to the chat. The answer did not need either of them.
The safer way: send only the error and the lines that matter, with stand-in values. The AI can still spot the wrong host name.
Example only. All values are made up.
You: My app won't connect. Settings (values replaced): DB_HOST=db.example.invalid DB_PASSWORD=<REDACTED> Error: connection refused on port 0000
How does it work?
Here is where a pasted secret can travel after you press send. What happens depends on the tool, your account type and your settings.
- It leaves your device. The prompt goes to the company that runs the AI, which can see it.[1]
- It is saved in your chat history. Anyone who gets into your account later may be able to read it.
- It may be read by people. Google says trained reviewers read some Gemini chats, and asks users not to enter confidential information they would not want a reviewer to see.[4]
- It may be used to train the AI. OpenAI says it may use ChatGPT chats from personal accounts for training unless you opt out. It says it does not train on content from its business products by default.[2]
- It may be shared. If you share a link to the chat, OpenAI says anyone with the link can view the conversation.[5]
- It may outlast your delete. Google says chats picked for review are kept for up to three years, even if you delete your history.[4]

Settings can lower the risk, but they do not remove it. OpenAI says Temporary Chats are not used for training and are deleted from its systems within 30 days.[3] The prompt is still sent to the company first.
A list of common AI risks from OWASP, a non-profit security community, names security credentials as sensitive data. It says users need to understand the risk of sharing such data with AI tools.[6]

A worked example
Jana Varga is a junior developer at a fictional travel booking firm. On a busy Friday, the booking app stops sending confirmation emails.
She copies the app's settings file and the error message into a personal AI chat account. The AI spots a typo in the mail server name, and the emails start working again.
Later she remembers that the file also held the email service's API key. That key belongs to the booking app, which is a non-human identity. Anyone holding the key may be able to send email as the firm.
Jana thinks of the hotel desk. Her key is in someone else's drawer now. She tells her team lead, Bruno Jovanovic, straight away.
Bruno does not blame her. He asks her to change the key first, at the email service that issued it. Once the new key is in place, the old one should no longer work.
Next, Jana puts the new key in the firm's secrets store, so the app reads it from there. She deletes the chat, knowing some copies may remain for a while.
Bruno checks the email service's records. He finds no messages sent by anyone else in the records available to him.
On Monday, Bruno reminds the team which AI tool the firm has approved. He adds one line to the team guide: "Swap real values for FAKE before you paste."
A real case shows why firms take this seriously. In 2023, a news report said Samsung restricted staff use of AI chat tools after sensitive internal data was leaked to ChatGPT.[7]
Myths and mistakes
| What people think | What is true |
|---|---|
| Deleting the chat removes the secret. | Some copies may be kept, for example chats picked for review.[4] Change the secret instead. |
| The AI needs my real settings to help me. | It usually needs the error and the shape of the file, not the values. Placeholders work. |
| Turning off training makes pasting secrets safe. | It changes one thing. The prompt is still sent to and stored by the company for a time.[3] |
| Only passwords count as secrets. | API keys, tokens, private keys and connection strings are secrets too, and they often hide inside files and logs. |
| A work AI tool means anything goes. | Approved tools often have better data terms, but secrets still belong in a secrets store, not a chat. |
What can I do this week?
- Check the data and training settings of each AI tool you use.
- Look back through your chat history for pasted passwords or keys, and change any you find.
- Practise swapping real values for FAKE before you paste.
- Ask your employer which AI tools are approved for work.
Checklist
- I check text for passwords, keys and tokens before I paste it into an AI tool.
- I use placeholders such as FAKE-KEY instead of real values.
- I use only the AI tools my employer has approved for work.
- I know the data and training settings of the tools I use.
- If a secret goes into a chat, I change it at the service that issued it.
- I report a pasted work secret to my team straight away.
- I do not share links to chats that hold private details.
Common questions
Can AI companies see what I type?
Yes, in most cases. Your prompt is sent to the company that runs the tool so the AI can answer it. The UK's National Cyber Security Centre says the company can see prompts and that they are stored. Read each tool's privacy terms to see what applies.
I pasted a password into a chatbot. What should I do?
Change the password or key at the service that issued it, as soon as you can. Then delete the chat and any shared link to it. If it was a work secret, tell your team or security contact, and check the service's records for unusual use.
Is it safe if I turn off training?
It is safer, but not safe for secrets. Turning off training stops new chats being used to improve the AI. The prompt is still sent to the company, may be stored for a time and may be checked for abuse. Keep secrets out either way.
Will the AI repeat my password to other people?
It is unlikely, but you cannot rule it out. Security groups list leaks of sensitive data through AI answers as a known risk. The bigger worries are simpler: the secret is stored, may be read by reviewers and sits in your chat history.
Are business AI tools safer for secrets?
They often come with better data terms, such as no training on your content. That helps for work documents. A password or key still does not belong in a chat, because it can be copied, shared and kept outside your control.
Where next?
Ready for the detail? Read the practitioner guide: How to Find Secrets in AI Agent Transcripts and Traces. It goes further into where secrets come to rest in AI logs and transcripts, how to scan for them safely and how to clean up afterwards.
Also useful:
- Secrets in Prompts
- Generative AI Data Loss Prevention Guide
- Leaked Secret Response for Beginners
- Secrets in Code for Beginners
- NHI Foundation Level Training
Related NHI Mgmt Group resources: Secrets Management for Beginners · API Keys for Beginners · Non-Human Identities for Beginners
Key terms
- Secret
- A password, key, token or certificate that software uses to prove who it is.
- API key
- A secret code one program uses to prove it may use another.
- Prompt
- The text, files or pictures you send to an AI tool to get a reply.
- Chatbot
- A program you talk to by typing, which writes replies in plain language.
- Shadow AI
- AI tools used for work without the organisation's approval.
- Secrets manager
- A tool that stores secrets locked away, controls who can read them and records each use.
- Credential rotation
- Replacing a password or key with a new one, so old copies stop giving access.
Sources and further reading
- ChatGPT and large language models: what's the risk? D. Chismon and Paul J, National Cyber Security Centre (UK), 14 March 2023. https://www.ncsc.gov.uk/blog-post/chatgpt-and-large-language-models-whats-the-risk, accessed 28 Nov 2026.
- How your data is used to improve model performance. OpenAI Help Center, OpenAI. https://help.openai.com/en/articles/5722486-how-your-data-is-used-to-improve-model-performance, accessed 28 Nov 2026.
- Data Controls FAQ. OpenAI Help Center, OpenAI. https://help.openai.com/en/articles/7730893-data-controls-faq, accessed 28 Nov 2026.
- Gemini Apps Privacy Hub. Gemini Apps Help, Google. https://support.google.com/gemini/answer/13594961, accessed 28 Nov 2026.
- ChatGPT Shared Links FAQ. OpenAI Help Center, OpenAI. https://help.openai.com/en/articles/7925741-chatgpt-shared-links-faq, accessed 28 Nov 2026.
- LLM02:2025 Sensitive Information Disclosure. OWASP Top 10 for LLM Applications 2025, OWASP Foundation. https://genai.owasp.org/llmrisk/llm022025-sensitive-information-disclosure/, accessed 28 Nov 2026.
- Samsung bans use of generative AI tools like ChatGPT after April internal data leak. K. Park, TechCrunch, 2 May 2023 (news report). https://techcrunch.com/2023/05/02/samsung-bans-use-of-generative-ai-tools-like-chatgpt-after-april-internal-data-leak/, accessed 28 Nov 2026.