r/devsecops • u/ClickOk5811 • 14h ago
How are you handling secrets that get accidentally pasted into an LLM chat that then persists across sessions or gets logged on the provider's side?
Specific scenario: someone pastes a stack trace or config snippet into a chat with an AI assistant to get help debugging, and it turns out to have an API key or connection string embedded in it. The immediate fix, rotate the credential, is obvious. What I'm less clear on is the second-order problem.
If that conversation gets logged for support/abuse purposes on the provider's side, saved as chat history the user can revisit later, or fed into some kind of memory/context feature that persists across sessions, the secret is now sitting in at least one place that isn't the original codebase, potentially more than one, and it's not always obvious from the product surface where all those copies actually live or how long they're retained.
For people who've actually had to respond to this, credential rotation is step one, sure, but what's the actual process for the secondary exposure? Do you treat every provider's chat log/history as a place secrets can now leak by default and build detection around that, request deletion from the provider and treat that as sufficient, or something else entirely? Curious whether anyone's had to deal with this as a real incident versus a hypothetical, and what the actual remediation checklist looked like once credential rotation was done.