Skip to main content

What are you looking for?

Explore our services and discover how we can help you achieve your goals

AI assistant in a B2B SaaS product: tenant isolation, user permissions and grounded answers

An AI assistant inside a B2B SaaS product is safe when your code, not the model, fixes the tenant and the user on every call, retrieval and tools run with that user's own permissions, and each answer cites a source or declines. Netbase treats those three rules as release gates, not as prompt instructions.

Book a solution review See the SaaS product accelerator

By Netbase Commerce and Platform Engineering Desk · Reviewed by David (CEO) · Updated · 11 min read

star

This guide is for CTOs, engineering leads and product owners of a live multi-tenant product who want an in-app assistant that answers "how do I" questions and questions about the customer's own records. It sits under the SaaS platform engineering guide and is part of how Netbase approaches SaaS development. It builds on multi-tenant SaaS architecture and RAG architecture for knowledge assistants and covers what changes when the assistant faces customers.

In this guide

Why is an in-product assistant riskier than an internal one?

An internal assistant serves one company. An in-product assistant serves many customers who must never see each other, and users whose roles differ inside each customer. One retrieval index, one cache or one log can hold data from hundreds of tenants, so a single missing filter is a cross-customer breach rather than an awkward answer.

The AWS SaaS Lens calls a crossed tenant boundary a significant and potentially unrecoverable event for a SaaS business. An assistant adds new places where it can break: it reads more data per request than most screens and blends it into prose.

The second difference is authority. A screen shows what the API returns for the signed-in user. An assistant that calls tools can be talked into calling them differently, through the user's question or through text inside a document it reads. The OWASP Top 10 for LLM applications therefore asks that actions run in the context of the specific user, with minimum privileges, and that downstream systems, not the model, decide whether an action is allowed.

Where can an assistant cross a tenant boundary?

The tenant boundary map below lists the nine places an in-product assistant touches tenant data, the identity each should run under, and the leak teams most often find late. Use it as the design review agenda.

Surface Runs under Typical leak
Retrieval index Session tenant and user, applied server-side Shared index queried without a tenant filter, or filtered by tenant but not by record permission
Conversation history Session tenant and user A conversation id from the client loads another customer's thread
Answer and embedding caches Key with tenant, plus user when the answer depends on role A cached answer for an admin is served to a member
Tool calls and actions The user's own token or a scoped proxy A shared service account lets the assistant read or change what the user cannot
Model provider Your account, with retention and training terms checked Prompts with customer data kept or used for training against the contract
Logs and traces Tenant-tagged, access-controlled like production data Support staff read full prompts and answers across tenants
Evaluation sets Synthetic or consented data only Real customer questions copied into a shared test set
Admin settings Tenant administrator The assistant is switched on, or given sources, without the customer deciding
Plan entitlements Billing and entitlement service A plan without the feature still reaches the model through an old endpoint

The last two rows are product decisions, not security fixes. Tenant administrators should choose whether the assistant is on, which sources it may read and whether conversations are kept. Whether a plan includes the assistant belongs in the same entitlement service as every other feature, described in subscription billing and entitlement systems.

Shared index, namespace or per-tenant index: which isolation fits?

Retrieval is where most leaks start, so the storage choice matters. A shared index with server-side filters is cheapest to run and easiest to change, but a single query built without the tenant filter exposes every customer. A namespace or collection per tenant inside one vector store makes the tenant part of the address, so a missing filter returns nothing instead of everything. A separate index per tenant gives the strongest isolation and simple deletion, at the cost of more infrastructure and uneven load.

OWASP lists vector and embedding weaknesses as a 2025 risk and names context leakage in shared vector databases; its mitigations are permission-aware vector stores and strict logical partitioning of datasets. In practice most products start with namespaces per tenant and record-level permission filters inside each namespace, then move large or regulated tenants to their own index. Whatever the layout, tenant isolation is not user permission: inside one customer, a sales rep should not get answers from HR records the rep cannot open.

How do you keep answers grounded and honest?

A grounded answer quotes or paraphrases retrieved content and shows where it came from. The rules that make that true are code, not tone of voice: the assistant receives only permitted passages, must cite at least one of them for every factual claim, and returns a short "I cannot answer that from your workspace" when nothing relevant is found. A citation check after generation confirms that every cited id was in the permitted set; an answer that fails is withheld.

OWASP's guidance on misinformation recommends retrieval from verified sources, human oversight for sensitive answers and telling users plainly about the limits. In a SaaS product, label assistant answers, link each citation to its record or help article, and never state account figures the assistant did not read from your API in that request.

Documents are also an attack surface. A customer can upload a file that tells the model to ignore its rules; OWASP calls this indirect prompt injection. Because the assistant only ever holds the current user's permissions and tools are checked downstream, an injected instruction can at worst misuse what that user could already do.

What should the release test matrix prove?

  1. Other tenant

    Seed two tenants with near-identical records and ask the same questions from each; every answer, citation, cache hit and history lookup must stay inside its own tenant.

  2. Member versus admin

    Repeat the questions as a member and as an administrator of one tenant; the member must never receive content or actions only the admin may see.

  3. Revoked access

    Remove a user's access to a record or project, then ask about it; the assistant must stop citing it within the freshness window you promised.

  4. Deleted content

    Delete a document and offboard a test tenant; embeddings, caches, logs and conversation history must follow the deletion policy.

  5. Plan without the feature

    Call every assistant endpoint from a plan that excludes it; requests must fail before any model call.

  6. Hostile content

    Upload documents with embedded instructions and ask for actions beyond the role; no tool may run outside the user's permissions.

  7. Ungrounded question

    Ask about something not in the workspace; the assistant must decline instead of guessing.

Run the matrix as automated pipeline tests, because new tools, sources and prompts reopen old paths. Netbase delivery follows a six-step lifecycle from discovery to ongoing support, and this matrix belongs to the agile execution step with outcome-based milestones.

Where AI fits

AI does three jobs in this feature: it ranks and reads permitted passages, writes the answer with citations, and chooses which permitted tool to call. Engineers still own everything that decides access: the tenant and user context, the retrieval filters, the tool permissions, the entitlement check, the citation check and the test matrix. Netbase works with the major commercial and open-source models, chosen per project, so the isolation design does not depend on one provider.

What delivery record exists, and what does not?

No published Netbase record shows a tenant-scoped assistant inside a client's SaaS product, and this guide claims none. The design above is how Netbase approaches the work, not a measured outcome.

Both halves of the problem are on record separately. Netbase works as offshore development partner on a multi-tenant cloud ERP for a US client that is not named, delivered as SaaS to small and mid-sized businesses, with a knowledge base, custom fields, workflows and API integrations in its first phase. Beyond the named recommendation engine for 4over4, Netbase has delivered AI projects for clients that are not named, including retrieval-augmented knowledge assistants, document AI and MLOps pipelines. Cloodo, a Netbase Business Division product, is an AI-powered digital workplace with CRM, HRM, Cloud ERP and AI modules in one workspace.

Most Netbase projects are delivered on fixed-price contracts, with milestone-based, retainer and KPI-linked models also offered. No accuracy, leak rate, duration or cost result is claimed here.

Alternatives: which assistant route fits your product?

Route Strength Risk Choose it when
Better search and filters No model risk, predictable Users still read and combine results themselves Questions are about finding records, not explaining them
Help-centre assistant only Public content, no tenant data Cannot answer about the customer's own records You need quick value while permissions are being modelled
Embedded third-party assistant Fast start Tenant data leaves your stack; limited control over filters Data is low sensitivity and the vendor's isolation is documented
Own assistant on your APIs Full control of tenant, permission and grounding rules Build, evaluation and operating effort The assistant must read and act on tenant records

Selection criteria: whether record-level permissions already exist in your data model, how sensitive tenant data is, whether customers demand control over sources and retention, and whether the assistant needs to act or only to answer. Netbase works on the last route through AI integration and the SaaS product accelerator; internal assistants for one company fit an AI knowledge assistant instead. When the assistant changes data, the approval patterns of AI agent security apply.

When should you not add an assistant yet?

Do not ship a tenant-data assistant while permissions live only in the user interface, while you cannot delete a tenant's data end to end, or while you cannot attribute model usage per tenant. Start with a help-centre assistant and a feedback loop such as the one in human feedback for AI assistants, and add tenant records once the test matrix passes.

Limits of this guide

  • It covers assistants that answer and act inside one SaaS product, not cross-company agent networks or model training.
  • It describes design rules and tests; it publishes no benchmark, leak rate or vendor comparison.

Plan the next step with a Netbase consultant

Frequently asked questions

No. A prompt instruction is advice to the model, not access control. Tenant and user context must come from the authenticated session and be applied by your retrieval service, caches and tools before the model sees any data.

Not always. A namespace per tenant with record-level filters suits most products; a separate index suits large or regulated tenants that need strict isolation or simple deletion, at higher operating effort.

It should not. Tool calls should run with the signed-in user's token or a proxy scoped to that user and tenant, so the assistant can never do more than the user could do in the product.

Next step

If you are planning an assistant for your product, book a solution review and bring your permission model and the questions customers ask most.

AI-ready SaaS development from a team that runs its own SaaS AI-ready SaaS development from a team that runs its own SaaS

Netbase provides SaaS development for founders and product teams to launch and scale multi-tenant subscription software with AI features customers will pay for. We build and operate our own SaaS platforms, Printcart and the AI-powered Cloodo workplace, and bring that experience to client products. Discovery fixes the MVP scope and schedule.

Learn More
line
AI integration services: add AI to the products and systems you already run AI integration services: add AI to the products and systems you already run

Netbase provides AI integration services for companies that want AI inside the store, ERP, CRM, mobile app or internal tool they already run, without rebuilding it. We connect language model APIs and retrieval over your data to existing workflows through a controlled integration layer, with evaluation, guardrails, cost limits and privacy rules agreed before launch. It is a growth capability.

Learn More
line
SaaS product accelerator: launch an AI-ready SaaS on proven Netbase modules SaaS product accelerator: launch an AI-ready SaaS on proven Netbase modules

A SaaS product accelerator is a set of reusable Netbase modules for accounts, billing, roles and integrations that helps founders and product teams launch subscription software faster, with room for in-product AI from the first release. Reusing these modules can shorten development time, and the approach is proven on Printcart, Netbase's own web-to-print SaaS.

Learn More
line

Work with Netbase remotely

Every Netbase engagement is delivered remotely, so clients in any country and any industry can work with us; Netbase has worked with clients in 80 countries. Contracts and invoices are issued by Netbase JSC, and payment is made by bank transfer to Netbase JSC's company account or PayPal Business. Talk to the CEO, Huy Nguyen (David), on WhatsApp or by email.

Contact Netbase

Discuss a project

Netbase JSC helps organizations design, build, modernize, and operate digital products and AI-enabled business systems.
Project enquiries

project@netbasejsc.com

WhatsApp

+84 937 869 689

Office address

91 Nguyen Chi Thanh, Dong Da, Hanoi, Vietnam

Get in touch

Tell us what you want to build, modernize, or operate.

Tell us what you want to build, modernize, or operate.

Contact Netbase