MongoDB Atlas vector search added first-class tenant ID filters so SaaS apps can keep embeddings isolated per customer.
MongoDB made tenant filters a first-class part of Atlas vector search. If you embed per customer, this is the knob operators wanted before someone mixed namespaces in a similarity query and called it a cute bug. Multi-tenant RAG without hard filters is how demos become incidents.
Why the feature exists
Vector search without a tenant predicate is a liability in SaaS. Similarity does not understand your billing boundaries. Atlas now documents efficient filtering on tenant identifiers alongside the neighbor search, so you are not inventing awkward workarounds that fall apart under load.
You still choose the field names and the write path. MongoDB is not inventing your tenancy model. It is making the query pattern official and fast enough to recommend.
What remains on you
Application auth stays mandatory. A database filter does not forgive a missing org check on the request. Log the tenant id you queried. Test a negative case where user A asks for user B’s data and confirm empty results.
If you already shipped vectors in a shared collection, plan a backfill and a dual-read period. New filters do not rewrite old mistakes. Atlas gave you a sharper tool. Use it with the same paranoia you apply to SQL WHERE clauses on customer_id.
Migration pattern
Add the tenant field to new writes immediately. Backfill in batches with a progress meter and a checksum of documents per tenant. Run dual read: filtered query in shadow mode compared against your old application-level filter until they match. Only then remove the legacy path. Vector features that skip migration theater become cross-tenant ghost stories. MongoDB documented the filter. Your release plan still needs the boring dual-run week.
Load test the filter
Before you call the migration done, run similarity queries at peak QPS with random tenant ids, including tenants that own almost no vectors. Watch for scatter-gather surprises and for planners that ignore the filter under load. Add an integration test that plants a canary embedding in tenant A and asserts tenant B never retrieves it across a thousand randomized queries. Security properties that are not tested weekly quietly rot. MongoDB made the feature real; your tests keep it true.