API Key Leaked: the First-Hour Runbook for Small Teams

A leaked API key is an incident with a timer — bots scrape public repos and paste sites within minutes, not hours. The order of operations decides whether you get a scare or an outage: scope the blast radius, rotate in the safe order (new key first, revoke second), check for real abuse, then purge the copies. Deleting the file is not the fix; revocation is.

1. Scope the blast radius (minutes 0–10)

Before touching anything, answer four questions — each one changes the play:

SignalWhat it meansFirst move
Key in a public repo or paste siteAssume scraped alreadyRotate immediately (section 2); history cleanup is hygiene, not the fix
Key in a shipped client bundle (JS app, mobile app)It is public by constructionNever ship secret keys client-side; move the call behind your backend, then rotate
Key in CI logs, error tracker, or ticketEvery viewer and log archive holds a copyPurge where you can, rotate regardless — log retention outlives the message
Key works and has broad scopes (payments, email, cloud)Real money and data at riskRotate first among all keys; check spend and audit logs for abuse

Write down: which account, which scopes/permissions, when it was created, where it leaked, who has seen it. That list becomes your rotation checklist and, if abuse occurred, your evidence log (see the first-24-hours breach checklist for the preserve-before-you-act rule).

2. Rotate in the safe order (minutes 10–30)

The classic self-inflicted outage is revoking first and discovering production was using the key. The safe dance:

3. Check for real abuse (in parallel, minutes 10–60)

4. Purge the copies that matter (minutes 30–60)

5. The prevention pass (this week, 30 minutes)

The mistakes that turn a leak into a crisis

Takeaways

---

The Ops Starter Kit ($14) includes the incident templates and evidence-log structure that make key-leak response survivable, and Vol. 2 ($27) adds the full DR plan and evidence log. Launch week: 30% off any paid kit with code HIVE-LAUNCH30 at checkout.