Submit a toolSubmit

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.

The problem: 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.
Asked on X: post 1, post 2

How do I fix this: Check a vibe-coded app for leaked API keys before you share it?

  1. 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.

  2. 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.

  3. 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.

  4. 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.

  5. 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.

All tools for “Secure a vibe-coded app” →

Related fixes

See also AI tools launched today on the daily board.