How do you keep API keys out of your code, your app, your logs and your git history, and what do you do the day one leaks?Leaked Keys and Secrets
- Module
- 01/05
- To read
- ~12 min
An AI-built app calls its AI provider straight from the browser. The coding agent that built it put the API key in a NEXT_PUBLIC_ setting. What do you think happens?
In the module you make your guess first, then read what happened and why.
Only your server reads secrets
Read each environment’s keys when the app runs
Scan before and after you push
Treat a leak as permanent
A list of your secrets and a plan for replacing them
A spec for your own app, as a text file you download. The module also gives you the prompt to paste into the AI you build with (Lovable, Bolt, Replit, Cursor, Claude Code or Codex), a checklist to check what it built, and recommended skills.
- A locked store for secrets (secret managers)
- A server route in front of paid APIs
- Logs that don’t leak keys