Skip to content

Verify stateful agent skills and memory MCPs never leak context across customer workspaces

Local memory files, shared tmp directories, and unscoped vector collections can bleed Customer A's context into Customer B's session.

Copy the prompt and paste it into the AI assistant you already use.

Multi-tenant isolation requires infrastructure-enforced namespaces and ephemeral sandboxes in addition to clean skill code.

Four state-bleed bugs found in multi-tenant skill deployments

  1. 01

    Eliminate hardcoded /tmp filenames in helper scripts

    Skills writing '/tmp/report.csv' instead of mkdtemp() leak data or corrupt outputs when two concurrent requests share a container.

  2. 02

    Enforce server-bound tenant_id on memory MCPs

    Never pass tenant_id solely via prompt instructions where injection can rewrite it; bind namespace credentials at connection init.

  3. 03

    Check module-level global cache persistence

    Long-lived Python or Node MCP servers caching last_query_result in global variables leak state across sequential users.

  4. 04

    Verify workspace directory wipe after completion

    Confirm ephemeral working directories and browser cookie jars reset completely after every tenant job.

Questions and answers

How could a stateless-looking SKILL.md cause cross-tenant leakage?

Bundled helper scripts frequently write fixed cache files like /tmp/schema_cache.json or ~/.cache/skill-db without scoping by session or tenant ID.

How does SkillMarket test concurrency and tenant bleed?

Harnesses fire interleaved concurrent sessions seeded with canary tokens for Tenant A and Tenant B, scanning all responses and disk artifacts for cross-contamination.

Which memory MCP architectures are safest for B2B SaaS?

Architectures enforcing cryptographic auth tokens mapped server-side to isolated database schemas or row-level security policies.