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:
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
.envfile 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
- 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.
- Create a replacement for each service that needs one. Use one key per environment, so a future revocation affects only one place.
- 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.
- 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.
- 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.
- 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.
- 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 for the full order.
Not sure what else leaked from the same repository? 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.