Partition a semantic LLM cache by the customer and the permissions that controlled the original response. Within that partition, use similarity to find possible matches. Check that the response is still valid for the current request before you return it. Cache shared answers only when every eligible recipient can see the same source data.
Decide what can reuse a response
Semantic caching stores a generated answer and uses an embedding match to find it later. A response cache hit can skip generation, so it can also skip the inference policy checks that normally run on a model request. Provider prompt caching has a different purpose. It can reduce some input processing costs while the model still generates a response for the current request. How to measure provider prompt-cache savings
Start with a feature that answers from material shared by the entire customer, such as documentation for that customer's configured workflow. Resolve the tenant from authenticated server-side context before lookup. If permissions vary within the tenant, limit reuse to users with the same effective access, or validate every source reference against the current user's permissions before returning the answer. A broad role name is insufficient when individual workspaces have separate grants.
Microsoft's multitenant Azure architecture guidance recommends including the tenant in the semantic cache partition and varying by relevant configurations such as safety policy and tools. Its Redis tutorial also distinguishes similarity threshold settings from partitioning and describes versioning the entries. Azure multitenancy guidance and Azure Managed Redis semantic cache tutorial
Test the same text under different access rules
Suppose an assistant answers questions about the status of internal onboarding. In a hypothetical release test, a manager asks “What is the current onboarding deadline?” Fill the cache with an answer grounded in that manager's project. Then run the identical request in each context below. Using identical text makes the authorization case independent of the similarity threshold.
| Request context | Expected outcome |
|---|---|
| Same customer, same source permissions and active policy | Reuse is eligible if the source version still matches |
| Different customer with the same role name | Search only the other customer's partition |
| Same customer, different project access | Exclude the cached answer unless the current requester can read all cited source records |
| Same user after a grant is removed | Reject the earlier cached result even if it has time remaining |
| Same user after a policy change | Require the active policy version before serving a hit |
Run the negative cases after a warm lookup, through the same public application entry point as a normal request. Check the final response and any citations. Also verify that a retry after a cache outage still runs the normal authorization, retrieval and inference controls. Treat an unavailable authorization check as a reason to withhold the cached answer.
Test policy changes while a request is running
Every entry needs a version for the source data and any inputs that change whether the answer may be served. Include the effective policy, prompt template and tool configuration where they affect the result. A short expiry reduces the lifetime of old entries, but a permission revocation needs a current access check or a change to the active partition as soon as the revocation applies.
Test an in-flight write. Start generation under one policy version and pause the write. Activate a more restrictive policy, then resume the write. The stored answer must remain under the original version or be discarded. If the writer assigns the active version at write time, it can incorrectly make the old answer eligible under the stricter policy. Apply this test to background warm-up jobs as well.
Measure the share of requests eligible for caching, the hit rate within that eligible group, and the rate of incorrect answers on reviewed hits. A higher overall hit rate can mean the cache serves answers too broadly. For features that perform actions or depend on current user-specific records, skip semantic response reuse until you can validate every dependency. If your application serves cached responses before calling Alectura, enforce cache authorization in the application. Use the Alectura quickstart to verify how your uncached path supplies customer context.
4 December Sydney edition, released on 5 December.
Source documents (2)
Trace a request through Alectura.
Bring a sample prompt and a customer policy. See what reaches the model and which decisions appear in the request record.