Leaked API key fix: revoke the key first, then move calls to the server
A developer who accidentally exposed an API key in a vibe-coded app outlines a step-by-step remediation order. The guide stresses revoking the leaked key at the provider before anything else, since deleting it from code does not stop anyone who already copied it. The replacement key should live in a server-only environment variable, with browser calls routed through the developer's own server instead. Further steps include adding per-user limits, checking usage and billing for unfamiliar calls, and purging old builds, CDN caches, source maps and git history. The article also warns against rotating only after cleaning git, keeping the old key active, or testing the leaked key.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in