Skip to content
Messaging · Secret guide

Leaked Resend API key: what to do in the first hour

High severityChecked liveLast verified · 4 min read

A Resend API key lets whoever holds it send email through your Resend account, from the sending domains you verified. That is the risk that matters most. Mail sent from a verified domain looks legitimate to recipients and to their mail filters, so a leaked key is a ready-made way to send phishing or spam in your company’s name. It can also expose the content of your transactional emails. Revoke the key first, then check what was sent.

Check your GitHub account for leaked secrets — free

Provider
Resend
Severity
High
Impact
SaaS account access and billing
Checked live by LeakWatch
Yes

What a Resend API key looks like

Resend keys start with re_, followed by an identifier, an underscore and a longer random part. The random characters use an alphabet that leaves out easily confused letters, so the value has a consistent look:

re_…_…XXXX   Resend API key (masked)

Resend offers keys with full access and keys limited to sending. A sending key can still send mail from your domains, so a restricted key is not a safe key to leave exposed. The value is usually stored in a variable named after Resend, and that name is often the first thing people search for when they clean up.

How Resend API keys get leaked

  • Environment files committed by accident. A .env file with the key, pushed to a repository that was later made public.
  • Front-end code. A key placed in a browser bundle or a mobile app so that the app can send email directly. Anyone who loads the app can read it.
  • Serverless and build configuration. A deployment configuration that stores the key in plain text instead of the platform’s secret store.
  • Shared examples. A snippet posted in a tutorial, a gist or a support thread, with the real key left in place of the placeholder.
  • Logs. A request logger that records headers, so the key appears in every log line.

What to do in the first hour

  1. Delete the key. Open the account settings, find the API keys section, locate the key by its name and delete it. A deleted key stops working for new sends.
  2. Create a replacement with the narrowest permission that the service needs, and store it in your secret manager. Use a separate key for each application so the next revocation is smaller.
  3. Check the sending logs. Review the emails sent since the exposure. Look for messages you did not write, recipients you do not recognise and sudden spikes in volume.
  4. Check the domains. Confirm that the sending domains and their DNS records are unchanged, and that no unknown domain was added.
  5. Warn your contacts if phishing may have gone out. A short note from a known address is better than silence.
  6. Clean the repository and logs. Remove the value from code and history and check the logs. See I accidentally pushed an API key to GitHub.

Not sure what else leaked from the same file? Run a free scan.

Not sure what else leaked? Run a free scan.

Revoke it at Resend

Open the account settings in the Resend dashboard, go to the API keys page and delete the key that leaked. Deleting a key is immediate. Before you delete it, make sure the replacement is deployed, or your sending will stop. This guide has not confirmed the exact menu labels against the live dashboard, so check the wording before you act.

How LeakWatch detects it

The rule is called “Resend API Key”. It looks for the prefix re_, an identifier of 8 characters, an underscore and a 24-character part, using a restricted alphabet, with word boundaries around the value. No surrounding text is needed. The severity is high. This type is checked live: LeakWatch can check whether a detected key is still active with a read-only request that lists the domains on the account. It sends nothing and changes nothing, and a key with only sending permission is still reported as valid, because it can send mail.

LeakWatch can check whether a detected key is still active with a read-only request to Resend. It never reads your data or spends your credits.

FAQ

Can a sending-only key still do damage?

Yes. It cannot read your account, but it can send email from your verified domains, which is the main risk in this case.

Does revoking the key affect sent mail already delivered?

No. Revocation only stops new API calls. Messages already in transit or delivered are not affected.

What about my domain reputation?

If spam or phishing went out, mailbox providers may lower your reputation for a time. Check your bounce and complaint rates and watch them for a few days.

Get alerted next time a secret leaks — create a free account

LeakWatch is not affiliated with Resend.