C.W.K.
Stream
Lesson 02 of 05 · published

The Concrete Leak Vectors

~15 min · leak-vectors, reasoning-trace, memory-bleed

Level 0Greenhorn
0 XP0/53 lessons0/14 achievements
0/100 XP to next level100 XP to go0% complete

Five distinct ways an LLM in your dev loop puts secrets at risk. Knowing the vectors is half the defense.

1. Direct file read

The agent has a Read tool. You ask "what does my deployment look like?". The agent reads docker-compose.yml + .env for context. The .env contents are now in the model's context window, which means they're in the API request, which means they're on a server outside your control.

2. The helpful echo

You paste a stack trace. The trace includes a connection string with embedded password. The model summarizes the error: "Postgres at postgres://app:HUNTER2@db.internal:5432/prod is rejecting the connection". Now your password is in the chat transcript.

3. Reasoning-trace leak

Modern reasoning models (o-series, Claude thinking, DeepSeek R1, Gemini Thinking, etc.) often produce a thinking block. That block is shown to the user, sometimes hidden, sometimes logged separately. Many products send the trace upstream for billing/QA. If the model thinks "I should NOT reveal that the password is HUNTER2", that exact string is now in the trace.

4. Suggested code that hardcodes

You ask for "a script that connects to the database". The model, helpfully, fills in the password it just saw in your context. You accept the suggestion. Now the secret lives in committed code, on disk, and (because git history is forever) in your repo's permanent record.

5. Cross-conversation bleed (memory features)

"Memory" features in modern assistants persist facts across sessions. If session A learns your API key (from a .env read), session B can sometimes recall it.

VectorWhere the secret ends upHardest part to clean up
Direct file readAPI request, provider logs, possibly training dataYou can never fully prove deletion
Helpful echoChat transcript, screenshots, sharesDistribution is uncontrollable
Reasoning traceTrace logs, billing systemsOften invisible to the user
Hardcoded in suggestionYour repo, git history, deploy artifactsGit history rewrites are painful and partial
Memory bleedProvider's persistent memory storeHard to audit, hard to purge selectively

External links

Exercise

Take a real conversation transcript with your AI editor and grep for: API key prefixes, password=, postgres://, mongodb://, your own email address, your IP. Anything you find is already 'out' — you can't unsee it on the provider side. Rotate every credential that appears, then take stock: which vector caused each leak?

Progress

Progress is local-only — sign in to sync across devices.
Spotted a bug or have feedback on this page?Report an Issue

Comments 0

🔔 Reply notifications (sign in)
Sign inPlease sign in to comment.

No comments yet — be the first.