Skip to content
Databases & keys · Secret guide

Leaked WorkOS production API key: what to do in the first hour

Critical severityDetected onlyLast verified · 4 min read

A WorkOS production API key lets the holder call WorkOS on behalf of your application, the one that handles single sign-on, directory sync and user management for your customers. Your customers’ identity connections and directory data sit behind it. A production key is the one that matters: it works against live customer environments, not a sandbox. Revoke it first, then check what the key was used for, because the damage in an identity system is often quiet.

Check your GitHub account for leaked secrets — free

Provider
WorkOS
Severity
Critical
Impact
Payments and customer data
Checked live by LeakWatch
No

What a WorkOS production API key looks like

WorkOS production keys begin with sk_live_, followed by a long encoded body. The format is specific to WorkOS, so the prefix tells you what the value is. A sandbox key uses a different mode word in place of live, and it cannot reach production customer data.

sk_live_…XXXX   WorkOS production API key (masked)

Keys are usually sent as bearer tokens from a backend service. Because they grant access to customer identity data, they belong in a server-side secret store and nowhere else. A client-side application that needs WorkOS should call your own backend, which then calls WorkOS with the key.

How WorkOS production keys get leaked

  • Environment files committed by accident. A .env file with a WorkOS key pushed to a repository that later became public.
  • Client-side code. A key placed in a React, Vue or mobile bundle to save a backend hop. Anyone who loads the page can read it.
  • Local development configuration. A development settings file that someone filled with the production value to test a customer connection.
  • CI logs. A pipeline step that prints the environment, or a test that echoes an API request including its headers.
  • Support threads. A key pasted into a ticket, a forum or a chat to debug an error message.

What to do in the first hour

  1. Revoke the key. Open the account settings, find the API keys section and revoke the production key that leaked. Create the replacement before you remove the old value from production, so the application keeps working.
  2. Deploy the new key through your secret store, then confirm your sign-in flow still works for a test connection.
  3. Review the audit trail. WorkOS records lifecycle events for API keys, including creation and revocation. Check them for keys you did not create, and check your own event history for the period since exposure.
  4. Review your customers’ connections. Look for new SSO connections, changed directory settings or new users you did not expect. An attacker with the key could alter configuration that your customers rely on.
  5. Check your own user records. Compare recent sign-ins and user changes in your application with what you expect, and force a password or session reset if you see anything unusual.
  6. Clean the repository. Remove the value from the code, check the history and any logs, and move the key into your secret store. 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 WorkOS

Open the account settings for your WorkOS environment, go to the API keys page and revoke the production key. WorkOS documents revocation from the dashboard and through an API endpoint that deletes a key, and it shows a production key only once at creation. This guide has not confirmed the dashboard labels against the live page, so check the wording before you act, and make sure you are in the production environment and not the sandbox. Keep the new value somewhere safe when it is shown, because you will not be able to read it again.

How LeakWatch detects it

The rule is called “WorkOS Production API Key”. It looks for the word workos, followed by words such as secret, key or token, then an assignment, and then a value that starts with sk_live_ and continues with a fixed-length encoded body. The surrounding word is required, so a bare production value with no WorkOS context is not reported. The severity is critical. This type is not checked live: LeakWatch does not call the WorkOS API with the value it finds.

LeakWatch detects this format but does not check it live: it can tell you the key is exposed, not whether it still works. Assume it does until you have revoked it.

FAQ

Is a sandbox key also a risk?

Less, because it cannot reach production customer data. It can still expose test configuration and should be rotated if it was published with the production value.

Will revoking the key break my sign-in?

Only until the new key is deployed. Create the replacement, deploy it, then revoke the old key. Test a connection before you close the window.

What if the key was only in a client bundle?

Treat it as exposed from the moment the bundle was public. Anyone could have read it, so revoke it, and move the calls behind your own backend.

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

LeakWatch is not affiliated with WorkOS.