Skip to content
AI · Secret guide

Leaked Weights & Biases API key: what to do in the first hour

High severityDetected onlyLast verified · 4 min read

A Weights & Biases API key lets whoever holds it act as the user who created it on the W&B platform. That covers experiments, logged metrics, artifacts and model files for every project the user can reach, and in some setups team projects too. Model artifacts are valuable intellectual property, and a changed artifact can quietly affect models that other people load. Revoke the key first, then check what was read or altered.

Check your GitHub account for leaked secrets — free

Provider
Weights & Biases
Severity
High
Impact
SaaS account access and billing
Checked live by LeakWatch
No

What a Weights & Biases API key looks like

Current Weights & Biases keys start with wandb_v1_, followed by a long run of letters, digits, underscores and hyphens. Older keys have a different, shorter format that the rule does not match. The wandb_v1_ prefix is distinctive, so the value is easy to spot once you know what to look for:

wandb_v1_…XXXX   Weights & Biases API key (masked)

The key is used by the W&B command-line tool and the Python client, which read it from an environment variable named WANDB_API_KEY or from a local credentials file. Both places are where keys are usually found when they leak.

How Weights & Biases API keys get leaked

  • Training scripts committed to a repository. A script that calls wandb.login with the key written inline, pushed with the project.
  • Notebooks. A key typed into a notebook cell, saved with the notebook and shared on a platform, in a course or in a paper’s supplementary material.
  • Local credentials files. The file the client writes after login, copied into a dotfiles repository or a backup.
  • Container images and cloud jobs. A key baked into an image or a job definition that is then pushed to a shared registry.
  • Logs. A training job that prints its environment, or an error report that includes the configuration.

What to do in the first hour

  1. Delete the key. Open the account settings, go to the API keys section of your user settings, and delete the key that leaked. Deleting it stops every script that uses it, so have the replacement ready if a job is running.
  2. Create a new key and store it in your CI secret store or a local credentials manager, not in code.
  3. Review the runs and artifacts. Check the projects the user can reach for runs, artifacts and model versions created or changed since the exposure. Pay attention to model artifacts that other people load.
  4. Check the team. If the key belonged to someone with access to team projects, review the team membership and the access settings.
  5. Check other secrets. Rotate any cloud or registry credential that was stored alongside the key.
  6. Clean the repository and logs. Remove the value from code, notebooks and history. See I accidentally pushed an API key to GitHub.

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

Not sure what else leaked? Run a free scan.

Revoke it at Weights & Biases

Open the account settings on Weights & Biases, go to the user settings page, find the API keys section, and delete the key that leaked. The official W&B user settings documentation describes this section and the steps for creating and deleting keys. Deleting a key takes effect at once, so update your systems first where you can. Organization administrators can also restrict which members create keys, which is worth checking for your team.

How LeakWatch detects it

The rule is called “Weights & Biases API Key”. It looks for the prefix wandb_v1_ followed by 77 letters, digits, underscores or hyphens, with word boundaries around the value. No surrounding text is needed. The severity is high. This type is not checked live: LeakWatch does not call Weights & Biases with the value it finds, so a hit tells you the key was present, not whether it still works.

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

Does an old-format key matter?

Yes. This rule only matches the current format, so older keys need a manual search. Treat them with the same care.

Will my training jobs stop?

Jobs that use the deleted key will fail at login. Replace the key in the job configuration before you delete the old one if the job cannot wait.

Is the key the same as my login password?

No. The key is a separate credential for scripts and tools. Changing your password does not revoke it, so delete the key explicitly.

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

LeakWatch is not affiliated with Weights & Biases.