Skip to content
AI · Secret guide

Leaked Pinecone API Key: what to do in the first hour

High severityDetected onlyLast verified · 4 min read

A Pinecone API key authorizes requests to your Pinecone project, which hosts vector indexes. Those indexes hold embeddings, and the embeddings are usually derived from your own documents, customer records or product data. A key with the right role can read those vectors, write new ones, change the index settings or delete an index. The data that sits behind a vector index is often as valuable as the index itself, so a leak deserves a prompt response, even though the key is not a payment credential.

Check your GitHub account for leaked secrets — free

Provider
Pinecone
Severity
High
Impact
SaaS account access and billing
Checked live by LeakWatch
No

What a Pinecone API Key looks like

Current Pinecone API keys start with pcsk_. A short block of letters and digits follows, then an underscore and a longer block:

pcsk_…_…   Pinecone API key (masked)

The prefix separates these keys from the older keys that had no prefix and were long identifiers. Those older keys are not covered by this rule, so a value without the prefix may still be a Pinecone key and should be checked by hand. Keys are created per project, and the role you choose when you create one decides what the key can do: some keys can only read and query, while others can manage indexes or other project resources.

How Pinecone API Keys get leaked

  • Environment files. A .env file with PINECONE_API_KEY set to the real value, committed to a repository that later became public.
  • Notebooks and scripts. A key typed into a notebook while loading an index, saved with the notebook and shared.
  • Application code. A retrieval service that hard-codes the key rather than reading it from its environment.
  • CI pipelines. A job that writes the key into a configuration file during deployment, or prints it when a build fails.
  • Shared snippets. A code sample pasted in a forum or a chat when asking why a query returns no results.

What to do in the first hour

  1. Delete the key. Open the account settings for your Pinecone project, find the key in the API keys list and delete it. Deleting stops the key working, so do this before you change the code.
  2. Create a replacement with the narrowest role your service needs. A query service rarely needs permission to delete indexes, so do not reuse a broad key for it.
  3. Check the indexes. Look at the list of indexes for the project. Look for indexes you did not create, deleted indexes and changes to index settings.
  4. Review the data. Check the record counts and recent write activity for each index. A sudden drop or a large upload is a sign of misuse.
  5. Review other keys. Look at the other keys on the project and remove any you no longer use.
  6. Look for other secrets in the same file, such as model provider keys. Rotate them too. See I accidentally pushed an API key to GitHub for the order of steps.
  7. Clean the code. Read the key from the environment at runtime and remove the value from current files. For a wider search, see deep-scan your whole git history.

Not sure what else leaked? Run a free scan.

Not sure what else leaked? Run a free scan.

Revoke it at Pinecone

Keys are managed in the Pinecone console, under the project’s API keys section. Open account settings, select the project, find the key and delete it. Pinecone also offers command-line and administrative interfaces that can delete a key by its identifier, which is useful when you manage many keys. We did not confirm every console label, so follow the wording on the page you see, and check that you are in the project that issued the key.

How LeakWatch detects it

The rule is called Pinecone API Key. It looks for the pcsk_ prefix, then a short block of five or six letters and digits, an underscore and a block of 63 letters and digits, with a boundary or a line break after it. Older keys without the prefix are 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 Pinecone 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

Does revoking the key delete my vectors?

No. Deleting a key removes access, not the indexes. The data stays in place, so check it for changes rather than assuming it was removed.

Can an old key without the prefix still be a Pinecone key?

Yes. Older keys do not use the prefix, so this rule will miss them. If you find a long identifier in a Pinecone configuration, treat it as a key and revoke it the same way.

Should my application use a read-only key?

Where it can, yes. A service that only answers queries should not be able to delete an index, so a read-focused role limits the damage from a leak.

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

LeakWatch is not affiliated with Pinecone.