The exposure of credentials or sensitive values while a user is composing or submitting an AI prompt. This matters because the secret can leave the workstation before code is committed, reviewed, or scanned by downstream security tooling.
What prompt-time secret leakage means
Prompt-time secret leakage happens when a password, API key, token, certificate, or other sensitive value is exposed while someone is composing or submitting an AI prompt. The key issue is timing: the secret can leave the workstation before normal code review, repository scanning, or secret-detection controls have a chance to intervene.
This is different from a classic source-code secret leak because the exposure often occurs in the chat layer, browser, IDE assistant, or copy-paste path rather than in a commit. The secret may never be intentionally persisted by the user, which makes the event easy to underestimate and harder to notice in standard review workflows.
Where prompt-time leakage occurs
The exposure usually starts with convenience behavior: a user pastes logs, configuration, stack traces, terminal output, or sample code into a prompt and inadvertently includes live credentials. It can also happen when an AI assistant is asked to transform code or troubleshoot an issue, and the user includes values that should have been redacted first. NHIMG’s Guide to the Secret Sprawl Challenge is relevant here because prompt-time leakage is often just another path by which secret sprawl becomes visible.
The problem is broader than one application or one model. Any place where users can paste sensitive material into an AI prompt becomes a potential exposure point, especially where chat histories, telemetry, browser sync, or prompt logs retain the content after submission.
Why it matters for security and governance
Prompt-time secret leakage matters because it can bypass the controls organisations rely on to find secrets later. A secret exposed in a prompt may be copied into third-party systems, retained in chat logs, surfaced in support tooling, or reused by the model in follow-up interactions. NHIMG’s Secrets Management Guide is useful background because the safest handling of secrets depends on keeping them out of ad hoc text flows in the first place.
It also creates governance friction. Teams may believe that a secret is “safe” because it was not committed to source control, but prompt-time leakage can still produce a real incident if the value was exposed to an external service, retained in logs, or copied into a shared AI workspace. That makes prompt hygiene part of the broader secret-handling lifecycle, not an informal user habit.
How to recognise and reduce the blast radius
The practical signal is any prompt that contains live credentials, production tokens, private keys, connection strings, or unredacted environment variables. In practice, the highest-risk cases are troubleshooting, code review, and automation workflows where people feel pressure to “just paste the error” and move on. NHIMG’s Code Formatting Tools Credential Leaks shows the same user-behaviour pattern in another workflow: developer convenience can turn into broad credential exposure very quickly.
When leakage happens, the effective response is to treat the prompt as an exposure event, not merely a bad habit. That means assuming the secret may have been copied, retained, or indexed outside the workstation, which can require rotation, revocation, and a review of where the prompt content was stored or forwarded.
Practical implications for AI use
Why practitioners should care: Prompt-time leakage is a front-door problem, not just a downstream data-loss problem. If users can paste live secrets into prompts, the organisation has already lost control of where that sensitive value travels next.
Common misunderstanding: Teams often focus on whether the AI model “trained on” the secret, but the immediate risk is usually simpler, the secret may have been exposed to logging, retention, human viewers, or connected services before any model-specific concern even arises.
Practical takeaway: Organisations should treat prompt handling as part of secret governance and user training, with redaction or secret-aware workflows applied before prompts are submitted.
Standards & Framework Alignment
This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.
OWASP Non-Human Identity Top 10 addresses the attack and risk surface, while CIS Controls v8, NIST SP 800-53 Rev 5 and OWASP ASVS set the governance and control requirements practitioners need to meet.
| Framework | Control / Reference | Relevance |
|---|---|---|
| OWASP Non-Human Identity Top 10 | NHI-02 — Secret Leakage | Prompt-time secret leakage is direct secret exposure. |
| NHI-07 — Long-Lived Secrets | Prompt leaks are worsened when exposed values remain valid too long. | |
| Recommendation — Prevent prompt submission of live secrets and rotate any value that may have been exposed. Shorten secret lifetime so prompt exposure does not create durable access. | ||
| CIS Controls v8 | CIS-5 — Account Management | Secret exposure can enable account abuse through stolen credentials or tokens. |
| Recommendation — Remove exposed credentials and invalidate any access they can grant. | ||
| NIST SP 800-53 Rev 5 | IA-5 — Authenticator Management | The term concerns leakage of authenticators and other secret material. |
| Recommendation — Manage authenticators so exposed values can be rotated or revoked quickly. | ||
| OWASP ASVS | V14 — Data Protection | Prompt-time leakage is a data handling problem involving sensitive values. |
| Recommendation — Treat prompt text as sensitive data and block submission of secrets. | ||
Related resources from NHI Mgmt Group
Deepen Your Knowledge
Free weekly newsletter
Subscribe to the NHI & AI Identity Journal
The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.
Bonus 33% off our NHI Course when you subscribe.
Reviewed and updated by the NHIMG editorial team on October 12, 2026.
NHI Mgmt Group — the #1 independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org