Retrieval-augmented generation gets the attention, but the layer underneath it, the embeddings and the vector database that stores them, has a threat model of its own that survives even a perfectly scoped RAG pipeline. The core misconception to unlearn is that an embedding is a safe, anonymous fingerprint of text. It is closer to a compressed, reversible copy, sitting in a store that most teams never classified as sensitive.

What an embedding actually is

An embedding model maps a chunk of text to a vector, a few hundred to a few thousand numbers, positioned so that similar meanings land near each other. That geometry is what makes semantic search possible: embed a query, find the nearest stored vectors, return their text. The vector database exists to do that nearest-neighbour search at scale, which relational engines were never built for. So far, so useful.

The security-relevant fact is what the vector preserves. Because meaning is retained with high fidelity, the vector is a lossy but reconstructable representation of the text, and no one-way hash. Given the vectors and the embedding model, researchers can recover much of the original text. In one 2023 study (Morris, Kuleshov, Shmatikov and Rush, "Text Embeddings Reveal (Almost) As Much As Text"), a multi-step method recovered 92% of 32-token inputs exactly and extracted full names from clinical notes. If the source text was a medical note or a customer record, the vector inherits that sensitivity.

Embeddings and the Vector-Database Threat ModelDiagram with these labels, in reading order: ingest; index; query time; Source text; often sensitive; Embedding model; text → vector; Vector store; vectors + metadata; Nearest neighbors; on query; Vectors invert →; source recovered; A poisoned magnet; ranks for every; query.ingestindexquery timeSource textoften sensitiveEmbedding modeltext → vectorVector storevectors + metadataNearest neighborson queryVectors invert →source recoveredA poisoned magnetranks for everyquery
The embedding pipeline, and why the store and the retrieval step are both attack surface.

The threats specific to this layer

These differ from the RAG-pipeline issues of retrieval scoping and prompt injection. They live in the embeddings and the store itself:

  • Embedding inversion. An attacker who obtains vectors, through a leaky API, a misconfigured store, or a shared index, can reconstruct approximate source text. The vector database must be classified and protected at the sensitivity of its source data, not treated as opaque math.
  • Membership inference. Even without full inversion, an attacker may be able to tell whether a specific document or person is in the index by probing similarity. That is a privacy leak in its own right.
  • Index poisoning / retrieval magnets. An attacker who can add content crafts a chunk whose embedding sits near a broad range of queries, so it is retrieved constantly. Pair that with a hidden instruction and you have injection that fires on almost any question.
  • Cross-tenant and cross-scope leakage. Similarity search does not know about your permissions. In a shared index without per-vector access metadata, one tenant's query can surface another tenant's chunks.
Why it matters: Most teams protect the source documents carefully and then copy their entire meaning into a vector store with default settings, open network access, and no per-record authorization, because "it's just embeddings."

There is a compliance dimension here that catches teams off guard. If your source documents fall under a data-protection regime, personal data, health records, anything with a deletion or residency obligation, those obligations can extend to the vectors as well as the files. A vector derived from a customer's record can still count as that customer's data in a deletion request, and an erasure that scrubs the document store but leaves the vectors in place has not removed the data. Few embedding pipelines were built with a delete path in mind, so add one before the first request arrives.

Controls that fit the layer

  • Classify the vector store as sensitive data. Encrypt at rest, lock down network access, and audit who and what can read vectors, the same posture you give the source.
  • Attach access metadata to every vector and filter retrieval by the asking identity, so similarity never overrides authorization.
  • Govern ingestion. Control who can add content to the index; a retrieval magnet needs a way in, and ingestion is it.
  • Isolate tenants. Prefer separate indexes or enforced partition keys over a shared index with hopeful filtering.

Embeddings feel abstract, and teams under-protect them for that reason. Treat the vector store as what it is, a searchable, reversible copy of your most useful text, and the controls become obvious. The catch, as ever, is coverage: you cannot classify or lock down a vector database nobody recorded standing up, so the first job is finding every embedding store your organization is quietly running.

Back to the knowledge baseRequest an assessment