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.

Características Principales

01Reversible credential masking with zero-persistence, in-memory vault storage
020 GitHub stars
03Opt-in Shannon entropy and PII detection for high-entropy tokens and personal data
04Fail-closed outbound execution guard with egress checks and interactive MCP elicitation approval
05Runtime safety-net that scans tool outputs to re-tokenize any known leaked secrets
06Comprehensive secret detection supporting .env formats, built-in regex rules, and hot-reloading custom patterns

Casos de Uso

01Executing shell commands and writing configurations in AI workflows without exposing raw credentials to the model
02Enforcing strict egress policies and approval workflows before AI agents transmit data over the network
03Preventing LLMs from directly exposing local .env files, API keys, and database credentials during coding sessions