▲ Agents in production
How do you keep your AI assistant from seeing another customer's data or acting without permission?
By César Soto · 9 min read
▲ In this article
▲ In short
- The AI assistant in a multi-tenant product should reach exactly what the user's screens reach: the account and the user come from the server session, and every tool runs the same permission check as the matching screen.
- In permission-aware RAG, the account and role filter goes inside the vector query; if you filter after retrieval, another customer's data has already passed through your server.
- For any change, the model proposes and a person applies it: the server computes the preview, revalidates the proposal when it is applied, stores how to undo it and records the action in the audit log.
Short answer: the server sets the account and the user for every tool from the session, applies the same permission check your screens use, and lets the model only propose changes that a person then applies. No system prompt guarantees this, because models can be talked into things, so every access rule lives in server code you can cover with a test.
I'm CTO of Simón, a B2B platform. On November 3, 2026 we launched its AI assistant in three places: the admin panel, the portal where each customer's HR and training teams manage their people, and the chat used by the people taking the courses. In August we hid an assistant button that was already in the panel, because there was no real service behind it yet and we preferred not to promise something the product didn't do.
These are the rules we launched with, and what I would check in any product before opening an assistant to customers.
What data can the assistant see?
The same data the screens of the person typing can see. That was the first rule, and almost every other rule follows from it.
The account and the user come from the server session. No assistant tool accepts an account or a user as a parameter the model fills in. If someone asks for another company's data, the query runs with the signed-in account and comes back empty.
Every tool calls the same permission check the matching screen uses, and it does so twice:
- When the conversation's tools are assembled. If the person lacks a permission, the model never receives the tool that needs it, and the person never sees an option they can't use.
- When the tool runs. The check is repeated with the current session, in case something changed mid-conversation.
That work uncovered several permissions that were declared in the system but had never been enforced in code. We enforced them as part of the assistant project.
Scope also depends on the role. A learner only finds catalog content already shown to them, and a supervisor only sees the people in their own areas.
The server keeps the conversation history. The browser sends only the new message, so a tampered history or a tool result faked on the client never reaches the model.
It's the same rule I explained in where the agent ends and the backend begins: if the server already knows a value, the model has no business deciding it.
How do you filter what the RAG retrieves?
With the permission filters inside the vector query. If you first fetch the chunks most similar to the question and then drop the ones the person can't see, the foreign data has already passed through your server, and one slip in that second step sends it to the model. The top results also fill up with chunks you're about to discard, so the answer gets worse.
OWASP, in its guidance on vector database risks for LLM applications, recommends "permission-aware vector and embedding stores" with strict logical and access partitioning between datasets.
Two decisions made before the query matter just as much:
- What goes into the index. Before indexing we strip the internal material attached to each piece of content, because anything in the index can end up in the answer a learner receives.
- Which version goes in. We only index the published version. A draft stays out until someone publishes it.
Data questions, such as how many people in an area finished a course, go through the reporting layer that already existed, with its own access rules, instead of the model writing queries. That way the assistant's number matches the reports screen, and nobody has to explain to a customer why two figures in the same product disagree.
What about personal data and the text users write?
The model gets the minimum it needs to answer. Tools that look up a team return aggregates (how many people, what percentage of progress), and someone's full profile is shown to the person directly in the interface, without passing through the model. Contact details arrive masked.
Text that users write, such as comments or documents, is treated as data. A comment may contain something shaped like an instruction, and the assistant reads it as content to analyze without obeying it.
Answers are rendered in restricted markdown with no images. An image with an external URL can carry data in its parameters, and the browser sends them to that server as soon as it loads the image, without anyone clicking.
Which actions can it run alone, and which need confirmation?
On its own, the assistant only reads. Anything that changes something is applied by a person, because the model proposes and holds no tool that writes content.
Luis Isselin of Proofpoint Mexico put it this way in a November 2026 ITSitio article: an assistant that reads documents shouldn't necessarily have permission to modify or delete them. OWASP ranks excessive agency third in its 2026 Top 10 for LLM applications.
This is how a proposal works at Simón:
- The model proposes the change as structured data.
- The server computes the preview, with what changes and how many people it affects, and stores the proposal.
- The approval card shows names and counts the server computed. The model's text doesn't go into it.
- On Apply, the server reloads the proposal from its own store and checks the content hasn't changed since the preview.
- Every change is stored with its inverse, so Undo works.
- Every action is recorded in the audit log and can be filtered as done "via Simón".
| Type of action | Example | How it's applied |
|---|---|---|
| Read | Search content, check an area's progress | The assistant answers within the person's permissions |
| Reversible change | Edit a reminder | Proposal, server preview and Apply |
| Risky change | Publish, archive, send something to many people | Stronger confirmation |
| Delete | Remove content | Only a person, from the screen |
The assistant can propose archiving, and deleting is reserved for people. The criterion for what needs a stronger confirmation is the one I described in human approval without the bottleneck: the action's impact and how far it reaches.
We evaluated the tool approval built into the SDK we use and decided against it for this flow. It binds the approval to the exact input the model produced, so if the person corrects the reminder's text, the approval no longer holds. It also shows the model's own text instead of a server-computed preview, costs a model call per click and offers no safe retry.
What should you check before launching it?
A study by Illumio with Sapio Research, published in November 2026, found that 59% of the Mexican organizations surveyed rolled out AI tools before having the security controls they needed. This is the list I would go through with the CTO or tech lead before opening an assistant to customers. Each item is a yes or a no, and every no is pending work.
- The account and user for every tool come from the server session; no parameter the model fills in defines them.
- Every tool calls the same permission check as the matching screen, when tools are assembled and when they run.
- There's a test that, with one account's session, asks for another account's data and expects an empty result.
- The conversation history lives on the server and the browser only sends the new message.
- The RAG permission filter runs inside the vector query.
- Only published content, stripped of internal material, goes into the index.
- Figures come from the reporting layer and match the reports screen.
- The model receives aggregates about people, and contact details are masked.
- Answers render without external images.
- The model holds no tool that writes; it proposes, and the server computes the preview and revalidates on apply.
- Every change has Undo and is recorded in the audit log with a mark that tells it apart from manual changes.
- There's a daily usage limit per person and a usage record per account.
If you're about to put an AI assistant inside your product and want to go through this list with your CTO or tech lead, book a 30-minute conversation. You leave with a clear next step, with me or without me.
Frequently asked questions
Is a good system prompt enough to stop the assistant from showing another customer's data?
No. A well-crafted user prompt can convince the model to ask for someone else's data, and no system prompt fully prevents that. Tenant isolation has to live on the server: the account comes from the session, every tool goes through the matching screen's permission check and the RAG filter runs inside the query.
What is permission-aware RAG?
It's a retrieval-augmented generation system where the search only considers the chunks the person asking can see, based on their account, their role and the content's status. The filter runs inside the vector query. Filtering results after retrieval lets other customers' data pass through the server.
Should an AI assistant publish or delete without confirmation?
In a product with customers, I wouldn't. At Simón the assistant only proposes; a person sees a preview computed by the server and applies it. Publishing, archiving or sending something to many people requires a stronger confirmation, and deleting is reserved for people, from the screen.
References
- ITSitio, "Empresas mexicanas podrían esperar hasta 2027 para proteger sus herramientas de IA" (Illumio study with Sapio Research), November 11, 2026
- OWASP GenAI Security Project, 2026 Top 10 for LLM Applications announcement, September 2026
- OWASP GenAI Security Project, "LLM08:2025 Vector and Embedding Weaknesses"
Want to apply it in your team? Let's talk for 30 minutes.
Free, on video, with César Soto.
Book a conversation