Leaked an API key? › Resend
Leaked Resend API key: what to do in the next 10 minutes
Last updated: November 9, 2026. Steps checked against Resend's own docs on November 9, 2026.
Short answer: Delete the exposed Resend API key in the Resend Dashboard first. Deleting revokes it immediately, and there is no separate revoke step. Then create a replacement and put it only in a server-only environment variable or secret store, never in a VITE_ or NEXT_PUBLIC_ variable or in client JavaScript. Prefer a Sending access key, optionally limited to one verified domain, instead of Full access. Check Logs and Emails for sends you didn't make. A free SniffPup scan of a site you own can help find a remaining exposed key in public pages, but it cannot confirm the key is absent everywhere or that the site is secure. Removing the key from code alone does not un-leak it.
Which Resend keys are secret?
- Secret: Resend API keys. Official examples use tokens that start with re_ (for example re_xxxxxxxxx). Treat every API key as a password. You can view the full token only once at creation; a replacement is always a new key, not a reissue of the old string.
- Secret: full_access: can create, delete, get, and update any resource.
- Secret: sending_access: can send email only. For Inboxes, Resend documents that it can call only Reply to Thread Email, Forward Thread Email, Create Draft, and Send Draft. A sending key can optionally be restricted to one domain, and that restriction applies only to sending_access.
- Meant to be public: None. Resend says not to expose keys in the browser or other client-side code.
The next 10 minutes
Times are a rough guide. Do the first step before anything else.
1. Delete the leaked key (Minutes 0-2)
- Open the API keys page in the Resend Dashboard. Find the exposed key, using the last-used indicator if that helps. Choose More options, then Remove API key. Deleting revokes it right away. There is no separate revoke step.
- If production is still sending with that same key and you cannot tolerate a short outage, use Resend's rotation order instead: create the replacement, deploy it everywhere, verify in Logs, then delete the old key. Once you know the key leaked, Resend says to delete it rather than wait on a schedule.
2. Create a server-only replacement (Minutes 2-5)
- Create a new key with the permission and domain scope you need. Prefer Sending access over Full access for apps that only send mail, and restrict it to one domain when that fits. A Sending access key can send email and, for Inboxes, only Reply to Thread Email, Forward Thread Email, Create Draft, and Send Draft.
- Copy the re_ token now. Resend shows it once. Store it only in a server-only environment variable or secrets manager (an Edge Function, API route, or other backend), never in a client bundle or a VITE_ or NEXT_PUBLIC_ variable, then redeploy.
3. Review what was sent (Minutes 5-8)
- On the Logs page, filter by API key and date range. On the Emails page, review recipients, subjects, and delivery outcomes. Resend keeps 30 days of activity.
- Log entries include the endpoint, method, status, timestamp, User-Agent, and request and response bodies. They do not include source IP, ASN, or geo. Note the times if you contact support.
- Watch Metrics afterward. Resend states that accounts should stay under a 4% bounce rate and a 0.08% spam rate, or sending may be temporarily paused. We can't promise how Resend support will handle abuse aftermath.
4. Clean up and re-check (Minutes 8-10)
- Remove the key from frontend code, public files, screenshots, CI logs, and git history. History can keep a secret after the file is deleted. Rotate any other secrets that sat in the same file or commit. Give each service its own key, and delete unused keys. Resend flags keys unused for 30 or more days.
- Deleting the key from a repo does not revoke it. Removal happens in the Resend Dashboard, or when you finish a create, deploy, then delete rotation. Close the leak path so the replacement never ships to the browser.
- Re-scan the live site you own. A passive scan can help find a remaining exposed key in public pages. It cannot confirm the key is absent everywhere, and a clean report is not a guarantee of security. If a scan reports a match, confirm it in the Dashboard by last-used time. Don't paste the full secret into chat. Official examples use tokens beginning with re_.
Good to know
- Resend API keys do not expire automatically. For a planned rotation: create a new key, deploy it, verify it in Logs, then delete the old key. Rotate at least every 90 days, or immediately if the key is compromised.
- Replacing a key without removing it from client bundles or public .env files exposes the new key the same way.
- One key per service makes Logs clearer and lets you delete one integration without breaking the others.
After the first 10 minutes
Move the code that needs the key to the server (an API route, serverless function or Supabase Edge Function), keep the key in a server-only environment variable, redeploy, and re-check your live site. The general plan, with a prompt you can paste into Lovable, Bolt, Cursor or Claude Code, is in I leaked an API key in my vibe-coded app. What do I do now?
What SniffPup checks, and what it doesn't
A free SniffPup scan reads only what your live site serves to the public: secret key patterns in HTML and same-origin JavaScript (masked in the report) and public files such as /.env and /.git/config. It never uses a key it finds. It can't see your repo, your server or Resend's logs, so the steps above are always on you. A clean report is not a guarantee of security.
Sources
- Resend Docs: How to handle a leaked API key
- Resend Docs: How to handle API keys
- Resend Docs: Create API key
- Resend Docs: Delete API key
Resend can change its dashboard and steps at any time. If something here doesn't match what you see, follow Resend's docs and tell us.
Other providers
- Leaked OpenAI API key: what to do in the next 10 minutes
- Leaked Anthropic API key: what to do in the next 10 minutes
- Leaked Gemini API key: what to do in the next 10 minutes
- Leaked Perplexity API key: what to do in the next 10 minutes
- Leaked OpenRouter API key: what to do in the next 10 minutes
- Leaked ElevenLabs API key (unauthorized charges): what to do
- Leaked Stripe secret key: what to do in the next 10 minutes
- Leaked Supabase service_role or secret key: next 10 minutes
- Leaked AWS access key: what to do in the next 10 minutes
- Leaked GitHub token: what to do in the next 10 minutes