Skip to content
Docs

API keys

Rotate after a leak

The steps to take when a secret key is exposed, from revocation to reviewing usage.

Overview

Treat an exposed gray_sk_… like a compromised password. Assume it was copied.

Response steps

  1. Rotate the project secret in Console immediately.
  2. Deploy the new secret everywhere legitimate traffic runs.
  3. Search git history, logs, and error trackers for the old value; redact if found.
  4. Review Cloud API audit or usage spikes for the project.
  5. Document the incident for your security records.

Project ID leaks

Project IDs are less sensitive but still identify your app. Pairing ID with a stolen secret is what enables abuse—rotation is the critical step.