LogicTrail
  • Trails
  • Check my app
  • Pricing
  • Sign in
  1. Trails
  2. /
  3. Money and secrets
  4. · 4 minutes · Pro

The key you deleted

Your AI committed a file with your . You deleted it in the next commit and made the repo public a week later. The key is being used.

This answers: Deleted my API key from GitHub. Still exposed? No coding needed. 3 quick decisions.

  • Keys and secrets
  • Supervising your AI

Checking your access…

Deleted my API key from GitHub. Still exposed?

Yes, if it was ever committed. Git keeps every version of every file, so the key is still in the repository history, and bots scan public repositories quickly. Revoke the key and create a new one first, then clean the history, and turn on secret scanning with push protection.

Trail of the bug
  1. Your laptop
  2. GitHub
  3. Stranger

Breaks at GitHub: Key still in git history

How it works

Where your keys end upName it NEXT_PUBLIC_

Your server: private

OPENAI_KEY (secret)

Every visitor's browser: public

Publishable key (meant to be here)
The secret key stays on your server, where visitors can't see it. Only the publishable key, made for browsers, goes out.

Why AI tools write this bug

AI tools sometimes hard-code a key 'temporarily' to get something working, and the next commit removes it, which only hides it from the latest version.

How to fix it

  1. Revoke the exposed key immediately and issue a new one.

3 more steps, and a prompt that checks your own app for this bug. Part of Pro.

Unlock

Common questions

Does making the repo private fix it?
No. Anyone who already copied the key keeps it. Only rotating the key makes copies useless.

Related scenarios

  • The agent that reset productionFree · 5 min
  • The key you pasted into chatPro · 4 min
  • The ticket that gave ordersPro · 5 min

More on this trail

Money and secrets: Keys, payments, webhooks, and reading what your AI changed.

Want someone to look?

We check AI-built apps for this and three other common leaks, in plain English.

Check my app
Sign in

Sign in to walk this one

3 decisions, about 4 minutes, and a prompt to check your own app for the same problem.

Sign in No password. We email you a link.

How to fix it

  1. Revoke the exposed key immediately and issue a new one.

3 more steps, and a prompt that checks your own app for this bug. Part of Pro.

Unlock