LangChain Middleware Patterns (Python) Overview Tenant A sends a prompt: "Summarize this support ticket from [email protected] about her overdue invoice." The chain's caching middleware ran before the PII redaction middleware, so the raw prompt — email and all — became part of the cache key. Thirty seconds later Tenant B sends a semantically identical prompt (different tenant, different customer, same shape). Cache hits. Tenant B's user gets back a summary that names and her overdue invoice. That is pain-catalog entry P24 in production, and it is a real class of incident — post-mortems read like…