Samar
Masks detected credentials and sensitive data with reversible in-memory tokens for secure AI agent interactions.
Samar is an ephemeral privacy and security middleware designed for the Model Context Protocol (MCP). It intercepts file reads and environment variable accesses to mask sensitive credentials into cryptographically random tokens, maintaining zero persistence by keeping all mappings strictly in memory. When agents trigger file writes or execute shell commands, Samar safely detokenizes the inputs while enforcing heuristic egress checks and elicitation approval workflows. Featuring built-in parsers, hot-reloading custom regex support, and optional Shannon entropy and PII detection, it prevents secret leakage without breaking the agent's ability to run automated development tasks.