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
- 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.
- 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.
- 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.
- 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.
Related tasks in this category
See all in Skill Security, Injection & Permission Audits-
Scan third-party SKILL.md packages and reference files for covert prompt injection
Community skill bundles can hide Unicode tag characters, poisoned reference docs, or stealth instructions inside helper scripts.
-
Audit MCP server OAuth scopes, API token handling, and credential storage hygiene
Many community MCP connectors ask for full repo admin or Gmail read/write/delete scopes when your workflow only needs read access.
-
Test agent skills for covert data exfiltration via Markdown images, DNS, or webhooks
Even without write tools, a compromised skill or untrusted webpage can exfiltrate workspace secrets via rendered Markdown URLs or query strings.
-
Verify destructive command blocking and sandboxing in Bash-enabled agent skills
Check whether CLI-driven skills block force-pushes, recursive deletes, prod profile mutations, and subshell bypasses cleanly.
-
Check commit pinning, lockfile hashes, and maintainer provenance in community skill packs
Installing skills from floating GitHub branches or unpinned uvx/npx commands exposes developer laptops to upstream repo takeovers.
-
Benchmark PII and secret redaction skills that scrub sensitive payloads before LLM or API calls
Compare local presidio, regex+NER, and reversible tokenization skills on catching API keys, SSNs, and patient IDs without mangling code.