Cross-Session Isolation & Leakage Gate
Conversational AI, Agent Memory & Multi-Turn Testing β Day 4
Verify strict (tenant_id, user_id) memory partitioning using synthetic canary PII tokens to prove User A claims, identifiers, and preferences never bleed into User B retrieval or summaries.
A single misconfigured vector-store filter or global cache key can leak one customer's dispute ID or PII into another customer's session summary. Today you will run canary-token isolation tests against both a strictly scoped router and a deliberately leaky router to verify 100% detection coverage.
The official reference codebase for Day 4 is hosted in the repository. Clone the repository and navigate to day-4-session-isolation/test_day4.py to run the working solution.
git clone https://github.com/777abhi/agent-memory-testing-roadmap.git
cd agent-memory-testing-roadmap/day-4-session-isolation/test_day4.pyRun Cross-Session Isolation Assertions
Execute the Day 4 multi-tenant isolation test suite and inspect canary detection.
npm run test:day4violations = detect_cross_session_leakage(
target_session=user_b,
retrieved_memories=router.retrieve(user_b),
summary_text=router.build_summary(user_b),
other_users_canaries={"user-alpha": {"SSN-4812", "DSP-ALPHA-99"}},
)
assert violations == []- Enforced composite (tenant_id, user_id) partition keys across all memory writes and retrievals.
- Verified zero cross-user and cross-tenant bleed even when two tenants share an identical user_id.
- Proved the canary leakage detector catches misconfigured global buckets on both retrieval and summary surfaces.
π§ Knowledge Check
Why should multi-tenant memory isolation tests seed synthetic canary tokens and scan both retrieval results and conversation summaries?