Check a vibe-coded app for leaked API keys before you share it
If you need to check a vibe-coded app for leaked API keys, search the repo and browser bundle first. Agents often paste secrets into source, commit .env files, or put paid keys in front-end code that every visitor can read. Short answer: 5 steps. 1) Search your code for keys; 2) Move secrets to environment variables; 3) Never put secret keys in front-end code; 4) Scan the whole Git history; 5) Rotate anything that leaked.
Last updated: · This page is the decision checklist; the tools list for “Secure a vibe-coded app” is a separate URL.
How do I fix this: Check a vibe-coded app for leaked API keys before you share it?
Search your code for keys
Look for strings starting with sk-, AIza, ghp_, or words like api_key/secret. Any real key in a source file is a problem.
Move secrets to environment variables
Put them in .env locally and in the host's dashboard in production. Add .env to .gitignore before your next commit.
Never put secret keys in front-end code
Variables with a public prefix (VITE_, NEXT_PUBLIC_, PUBLIC_) are shipped to every visitor's browser. Call paid APIs from a server route instead.
Scan the whole Git history
Deleting a key from the latest file doesn't remove it from history. Run a secret scanner (TruffleHog, GitGuardian) on the repo.
Rotate anything that leaked
If a key was ever pushed, revoke it in the provider's dashboard and create a new one. Set usage limits/alerts on every paid API key.
Which tools are best to secure a vibe-coded app?
GitGuardian
Detects secrets in repos and commits; free for individual developers.
TruffleHog
Open-source secret scanner for Git history, files and more.
Semgrep
Static analysis that finds common security bugs in code.
Snyk
Finds vulnerable dependencies and code issues.
Open: 1 spot per week
One labeled sponsor for this topic each week; this week's spot is open. See open weeks →
All tools for “Secure a vibe-coded app” →
Related fixes
- Stop a Cursor agent loopHow to fix a Cursor agent loop (same edit, or work after Stop)Fix →
- Claude Code vs Codex vs Cursor ~$20 plansClaude Code vs Codex vs Cursor $20 plan limits: how to pick without burning the weekFix →
- Add an MCP server to Claude Code, Cursor, or CodexHow to add an MCP server to Claude Code, Cursor, or CodexFix →
- Stop purple-gradient AI UI defaultsAI keeps making purple gradient UI — how to fix the generic lookFix →
See also AI tools launched today on the daily board.
NewAIToolsToday Daily
Top 3 AI launches, one model or news item that matters, and one simple fix. A 5-minute read, every weekday.