# Leaked Brave Search API Key? Revoke It Fast

> Brave Search API key exposed in a repo or script? Revoke it in your dashboard, check query usage, then store the new key safely. Step-by-step.

Source: https://leakwatch.net/secrets/brave-search-api-key

---

[LeakWatch](/)

[Product](/product)[Live feed](/leaks)[Guides](/secrets)[Blog](/blog)[Free scan](/)

1.  [Home](/)
2.  [Secrets](/secrets)
3.  Brave Search API Key

AI · Secret guide

# Leaked Brave Search API Key: what to do in the first hour

Medium severityDetected onlyLast verified November 5, 2026 · 5 min read

A Brave Search API key lets a script or service send queries to Brave’s Search API under your subscription. Developers often use it to give an application or an AI assistant access to fresh web results. A leaked key lets someone run searches on your quota, and it can disrupt any feature that depends on search. The results returned to the attacker are public web results, so the main harm is cost and capacity, not a data breach. Revoke the key first, then check the usage that followed.

[Check your GitHub account for leaked secrets — free](/)

Provider

Brave Search

Severity

Medium

Impact

SaaS account access and billing

Checked live by LeakWatch

No

## What a Brave Search API Key looks like

Brave Search API keys begin with the letters `BSA`, followed by a run of letters, digits, underscores and hyphens. The prefix is case-sensitive, so a value written in a different case is not the same string:

```text
BSA…XXXX   Brave Search API key (masked)
```

The `BSA` prefix is what identifies the type in a file. Keys are typically sent in a request header, and they are often stored in an environment variable with the vendor’s name in it. A value with the same letters in lower case, or with extra characters before the prefix, is not matched by the rule. If you find a value with the prefix, treat it as a live key until you have checked it in the dashboard.

## How Brave Search API Keys get leaked

-   **Environment files committed by accident.** A `.env` file with the key, pushed to a public repository because the ignore rule was missing.
-   **AI agent configuration.** A settings file for an assistant or a search tool that stores the key in plain text, then gets shared with a team or a template.
-   **Front-end code.** A search request made from a browser, which exposes the key to every visitor who loads the page.
-   **Logs.** A debug line that prints request headers when a search fails.
-   **Shared snippets.** A key pasted into a chat, a tutorial or a support request to show why a query returned an error.

## What to do in the first hour

1.  **Revoke the key.** Open the account settings in the Brave Search API dashboard, find the key and revoke it. Revoking stops the key working for new requests, so do this before you clean the code.
2.  **Create a replacement** for each service that needs one. Use one key per environment, so a future revocation affects only one place.
3.  **Store the new key** in a secret manager or in the environment of the process that uses it. Do not put it in a file that is committed or shared.
4.  **Check usage.** Review the query counts for the period since the exposure. Look for a spike, for queries you did not send, and for calls at unusual hours.
5.  **Check the features that use search.** Confirm that your product still works with the new key, and that no service is still calling the old one.
6.  **Check the rest of the file.** Revoke other keys kept next to the Brave key, such as the model provider keys used by the same assistant.
7.  **Clean the repository.** Remove the value from current files, add the configuration to `.gitignore`, and rewrite history if the repository was public. See [I accidentally pushed an API key to GitHub](/blog/i-accidentally-pushed-an-api-key-to-github) for the full order.

Not sure what else leaked from the same repository? [Run a free scan](/).

[Not sure what else leaked? Run a free scan.](/)

## Revoke it at Brave Search

Brave’s authentication guide says keys can be generated and revoked from the dashboard, and it advises revoking a key from the dashboard and generating a new one if you suspect it has been compromised. Sign in to the Brave Search API dashboard, open the section where your API keys are listed, and use the control to revoke the leaked key. Then create the replacement, which the dashboard does with an add control. Some third-party guides recommend one key per environment, which is good practice because it makes the next revocation narrower. We did not confirm every label in the current interface, so check the names on the screen before you act. If the key is missing from the list, it may belong to a different subscription under the same account.

## How LeakWatch detects it

The rule is called “Brave Search API Key”. It looks for the letters `BSA`, followed by exactly 27 letters, digits, underscores or hyphens, with a word boundary before the prefix and another after the value. The prefix is case-sensitive, so `bsa` in lower case is not matched. A value with extra characters glued to the left of the prefix is not reported either. The severity is **medium**, with the SaaS impact class, because the key opens a search quota rather than account data. **This type is not checked live**: LeakWatch does not send the value to Brave, so a finding means the value has the right shape, not that 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

Is a Brave Search key as serious as a payment key?

No. It mainly spends search quota and can break features that rely on search. It does not open billing details or account data. The risk is cost and disruption, so still replace it promptly.

Why does LeakWatch care about the capital letters?

The prefix is case-sensitive, so the rule only reports the exact form the vendor uses. A key written in a different case would not be accepted by the API, which is why the rule is strict about it.

What is the best way to store the key for an AI assistant?

Keep it in a secret manager or an environment variable that the assistant reads at runtime, and avoid placing it in a configuration file that is synced to other machines or shared with a team.

## Related

-   [Tavily API Key](/secrets/tavily-api-key)
-   [Firecrawl API Key](/secrets/firecrawl-api-key)
-   [Perplexity API Key](/secrets/perplexity-api-key)
-   [I accidentally pushed an API key to GitHub](/blog/i-accidentally-pushed-an-api-key-to-github)
-   [Which vendors leak most this week](/leaks/trends)
-   [All secret guides](/secrets)

[Get alerted next time a secret leaks — create a free account](/)

LeakWatch is not affiliated with Brave Search.

![Gabriel Diyan, founder of LeakWatch](/brand/Photo-Gabriel-Diyan.webp)

Gabriel Diyan (0xCr0c0)

Cybersecurity student, founder of LeakWatch. I built and run the scanner described here — the detection patterns, the false-positive classifier and the provider validators are mine. [More about who I am](/about).

[GitHub](https://github.com/Leakwatch-Scan) · [X](https://x.com/LeakwatchScan) · [LinkedIn](https://www.linkedin.com/in/gabriel-diyan-80a378375) · [GitHub (personal)](https://github.com/crocogab)

LeakWatch

Secrets leak into public commits every minute. This watches the forges for yours. Built and run by [Gabriel Diyan](/about), a cybersecurity student — [why LeakWatch exists](/about).

Scan

-   [Product](/product)
-   [Live feed](/leaks)
-   [Trends](/leaks/trends)
-   [API docs](/docs)
-   [CI/CD](/docs?tab=ci)

Read

-   [Blog](/blog)
-   [Secret guides](/secrets)
-   [Changelog](/changelog)
-   [About](/about)

Verify

-   [Security](/security)
-   [Privacy](/privacy)
-   [Terms](/terms)
-   [Legal](/legal)
-   [Contact](/contact)
-   [Status](https://status.leakwatch.net)

© 2026 LeakWatch

[GitHub](https://github.com/Leakwatch-Scan)[X](https://x.com/LeakwatchScan)
