Test language, tenant and access separately
Key takeaway
Accurate translations do not establish that documents and actions are scoped to the right tenant.
Lessons in this path
How it works
Build a test matrix for two languages and two roles. Independently check layout length, date display, access scope, evidence and feedback. Use fictional or approved test data.
Worked example
One unit uses German and another English. Authorization comes from their roles, not the chosen language.
Why language and tenant are separate test dimensions
A tenant in this context is the bounded unit whose data and rights must stay separate from others, such as a national subsidiary or a business division. In AI applications these boundaries blur more easily than in classic software: a shared search index, a response cache or an example in the system instruction can carry content from one tenant into an answer for another without the interface showing anything.
Language acts on a different level: text length, date and number formats, sorting and the quality of the model itself, which may perform worse in some languages. Testing both in one case means that when something fails, you cannot tell which cause applies.
Step by step: a robust test matrix
The matrix need not be exhaustive, but it must cover each axis individually and the risky combinations deliberately.
- Define the axes: tenant, role, language and, if relevant, data residency region.
- Create synthetic test data per tenant with unique markers, such as a made-up word that only exists in tenant A.
- Write negative tests: a user from tenant B asks specifically for tenant A’s marker word. Expected result: no hit.
- Run language tests separately: layout with long translations, date and number formats, error messages, answer quality per language.
- Add combinations that tend to break: role change during a session, language switch with open history, shared links.
| Case | Tenant / role | Language | Expectation |
|---|---|---|---|
| Search foreign marker word | B / clerk | DE | No hit, no hint it exists |
| Summarise own document | A / clerk | EN | Evidence from tenant A, English answer |
| Trigger denied action | A / read-only | DE and EN | Same denial, clear message |
Going deeper: where tenant isolation breaks in AI systems
The most common weaknesses are not in the interface but in the retrieval layer. A search index should enforce tenant filters server-side, not via a hint in the model instruction. Response caches need the tenant in the key. Conversation histories, feedback data and quality evaluations must also be stored separately or at least be separately accessible.
Architecturally there are three patterns: one index per tenant (strong isolation, higher operating effort), a shared index with an enforced filter (efficient but more error-prone) or a mix by protection need. The decision belongs in the architecture documentation and is evidenced by the negative tests. For languages, the Unicode locale data (CLDR), on which many libraries base date and number formats, is worth a look.
If a model replies to a question about foreign data with “I am not allowed to say”, the test has not passed. It passes only if the data was never retrieved.
Example: The shared response cache
Example (fictional): a knowledge assistant for the HR departments of three national subsidiaries passes all language tests. In the negative test, however, it gives a user from Austria an answer citing a German works agreement. Cause: the cache stored answers by question text only, not by tenant.
The team adds the tenant to the cache key, clears the cache and adds the case permanently to the automated test suite. The language dimension was never the problem, but would have been suspected without a separate matrix.
Common mistakes
- Implementing tenant isolation through a model instruction instead of server-side filters.
- Copying production data for tests instead of using synthetic data with markers.
- Checking only interface translation, not answer quality per language.
- Collecting feedback and evaluation data from all tenants in one shared, openly accessible store.
Frequently asked questions
Is one index per tenant always better?
It isolates more strongly but costs operating effort and complicates shared content. Decide by protection need and evidence the choice with negative tests.
How many languages should a pilot cover?
At least two, including the weakest relevant language. A single language hides differences in model quality.
How does tenant isolation stay tested over time?
Add the negative tests with marker words to the automated test suite and run them on every change to index, cache, retrieval configuration or role model, not only before first launch.
Try it yourself
Record one normal and one denied action for each role in both languages.
Check your result
The interface remains readable and policies work equally well in both languages.