A Mem0 API key authenticates an application to Mem0, the memory layer used by AI agents to store and recall facts about users and conversations. Whoever holds the key can read the memories stored under the project, and depending on its permissions, add or delete them. Those memories often contain personal details that end users shared with an assistant, which makes a leaked key a privacy problem as well as a billing one. Rotate the key first, then check what was read.
Check your GitHub account for leaked secrets — free
- Provider
- Mem0
- Severity
- High
- Impact
- SaaS account access and billing
- Checked live by LeakWatch
- No
What a Mem0 API Key looks like
Mem0 platform API keys start with m0-, followed by a block of letters and digits. The value is a single string:
m0-… Mem0 API key (masked)
The prefix is what makes the value recognizable, but the detection also looks for a label such as MEM0_API_KEY or a configuration entry named after Mem0. Keys are usually stored in an environment variable for a Python or JavaScript agent, which is where most leaks begin. If you run self-hosted Mem0 instead of the hosted platform, the key may be a different value, so confirm which service issued the one you found before you act.
How Mem0 API Keys get leaked
- Environment files. A
.envfile withMEM0_API_KEYset to the real value, committed because.gitignoredid not cover it. - Notebooks. A key typed into a notebook cell during an experiment, saved with the notebook and published with it.
- Agent configuration. A prompt or tool configuration file that includes the key, copied between projects.
- Shared examples. A snippet pasted into a support thread or a blog post to show how to store a memory, with the real key left in.
- Browser code. A key placed in a front-end script for a demo, where anyone can read it.
What to do in the first hour
- Revoke the key. Open the account settings for your Mem0 project, locate the API key and delete it. Do this before you change the code, so the value stops working straight away.
- Create a replacement and store it in your secret manager. Give each agent or service its own key, so the next leak affects one component.
- Check reads and writes. Review recent memory activity for the project since the exposure date. Look for reads from unfamiliar sources and for bulk exports.
- Assess the data. Decide what kinds of personal information the memories hold. If the data includes personal details of end users, your privacy obligations may apply, and you should take advice on whether notification is required in your jurisdiction.
- Check the other keys in the same environment. An agent that holds a memory key often holds a model provider key too. Rotate those as well. See I accidentally pushed an API key to GitHub for the order of steps.
- Clean the repository. Read the key from an environment variable, add the environment file to
.gitignore, and remove the value from current files.
Not sure what else leaked? Run a free scan.
Revoke it at Mem0
API keys are listed in the Mem0 dashboard for your project. Open account settings, go to the API keys section, find the key by its name and delete it, or create a new one and then remove the old one. Deleting the key stops it working for new requests. We have not confirmed the exact labels or whether every plan shows the same screen, so follow what the dashboard displays.
How LeakWatch detects it
The rule is called Mem0 API Key. It looks for the word “mem0” followed, within a short distance, by an assignment-style separator and a value that begins with m0- and has between 24 and 44 letters or digits. The label is required, so a bare m0- value with no Mem0 context is not reported. The severity is high, with the impact class for SaaS tools. This type is not checked live: LeakWatch does not send a request to Mem0 with the value it found.
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
Are memories stored by Mem0 public if the key leaks?
Not public, but readable by anyone who holds a valid key for that project. The leak exposes whatever the project stored, so the key matters as much as the data.
Can the key be used to create memories?
Possibly, depending on its permissions. Check the key’s scope in the dashboard. A key that can write can also plant false memories that an agent will later act on.
Should I use one project for each environment?
Yes. Keeping development and production separate limits what a leaked development key can reach, and makes a cleanup easier.