Never paste an API key into a prompt — not into the model, not into a chat, not into a screenshot.

By (@jacksparrow) ·

I nearly did it myself. I was debugging a payment integration, the model asked for my config to see what was wrong, and my hand was on the paste shortcut before my brain caught up. That key could charge real cards. One paste and it would have been sitting in a chat log I don't control.

Keys don't belong in prompts, ever. Not the real one, not "just to test", not in a screenshot of your code, not in the error message you paste. Here's the setup that makes it a non-issue:
1. Keys live in a .env file, nowhere else. The code reads them from there. The model gets a placeholder — YOUR_KEY_HERE — and it can do everything it needs with that.
2. .env is in .gitignore from day one. If it ever gets committed, the key is public the moment the repo is, and "private repo" is not a defence.
3. If you already pasted one, rotate it immediately. Don't debate whether anyone saw it. Assume it's leaked, generate a new key, delete the old one. Thirty seconds of admin beats explaining a bill you didn't run up.

Same rule for database URLs, tokens, passwords, anything that grants access. The model doesn't need your real credentials to help you — it needs to know where the credentials go.

This is the cheapest habit in vibe coding and the most expensive one to skip. A leaked key costs you an afternoon at best and a drained account at worst. Placeholder in the prompt, real key in the .env, and never the two shall meet.

4 views

Explore more on Prompted