All Questions
Guardrails And Safety hard

A B2B SaaS assistant gives each tenant its own Postgres database and its own vector index. To cut inference cost, the team adds a semantic response cache. It embeds each prompt and returns the cached answer whenever cosine similarity to a stored prompt exceeds 0.95. The cache is one shared Redis instance. A security review blocks the launch. What is the problem, and what is the fix?

  1. A Raise the similarity threshold to 0.99 so that near-duplicate prompts from different tenants almost never match each other.
  2. B Per-tenant databases already isolate the data, so the only risk is staleness; shorten the cache TTL to bound it.
  3. C Enable TLS between app servers and Redis and encryption at rest so cached answers cannot leak over the network.
  4. D An answer grounded in one tenant's documents can be served to another tenant; namespace the cache key by tenant ID.

One system design question a day, with spaced repetition so the ones you miss come back.

Get the app

Related questions