Engram provides defense-in-depth privacy protection by stripping sensitive content at two layers: the plugin layer (before data leaves the process) and the store layer (before any database write).Documentation Index
Fetch the complete documentation index at: https://mintlify.com/Gentleman-Programming/engram/llms.txt
Use this file to discover all available pages before exploring further.
Privacy Tags
Wrap sensitive content in<private>...</private> tags to redact it from memory:
What Gets Redacted
Any content inside<private> tags is replaced with [REDACTED]:
- API keys and secrets
- Passwords and tokens
- Personal identifiable information (PII)
- Email addresses, phone numbers
- Database connection strings
- Any sensitive configuration values
Two-Layer Defense
Engram strips privacy tags at two independent layers to ensure sensitive data never reaches the database:Layer 1: Plugin Layer (TypeScript)
For agents using Engram plugins (OpenCode, Claude Code), privacy tags are stripped before data is sent to the HTTP API. OpenCode Plugin (engram.ts):
- Before sending observations to
POST /observations - Before sending prompts to
POST /prompts - Before any HTTP request leaves the plugin
Layer 2: Store Layer (Go)
The SQLite store layer strips privacy tags before any database write, regardless of how the data arrives (HTTP API, MCP stdio, CLI). Implementation (internal/store/store.go):
- Inside
AddObservation()— stripstitleandcontentbefore INSERT - Inside
UpdateObservation()— stripstitleandcontentbefore UPDATE - Inside
AddPrompt()— stripscontentbefore INSERT - Inside passive capture — strips learning items before save
Pattern Details
Regex Pattern
(?i)— Case-insensitive (matches<PRIVATE>,<Private>, etc.)(?s)— Dot matches newlines (supports multiline content).*?— Non-greedy match (stops at first</private>)
Supported Variations
All of these work:Nested Tags
The regex is non-greedy, so nested tags are handled correctly:Usage Examples
Protecting API Keys
Protecting Connection Strings
Protecting User Data
When to Use Privacy Tags
Always Redact
- API keys, tokens, secrets
- Passwords, passphrases
- Database credentials
- Personal emails, phone numbers
- Social Security Numbers, credit cards
Consider Redacting
- Internal URLs with auth tokens
- Server hostnames or IPs
- User-specific identifiers
- Proprietary business logic
- Sensitive configuration values
Team collaboration consideration: If you’re using Git Sync to share memories with your team, privacy tags prevent sensitive data from being committed to the repository.Always wrap secrets in
<private> tags before saving to memory.MCP Tool Integration
When calling MCP tools directly (without a plugin), privacy tags are still stripped at the store layer:Verification
You can verify that privacy tags are working by:1. Check the TUI
[REDACTED].
2. Check the Database Directly
[REDACTED] instead of the sensitive value.
3. Export and Inspect
<private> tags should appear in the export.
Best Practices
Use privacy tags proactively
Don’t wait until you see a secret in memory. Wrap it in
<private> tags before saving.Tag entire values, not just parts
❌ Bad:
API_KEY=abc<private>123</private>xyz✅ Good: API_KEY=<private>abc123xyz</private>Use privacy tags in prompts too
When saving user prompts with
mem_save_prompt, wrap sensitive content:Limitations
Related
Git Sync
Share memories safely with privacy tags
MCP Tools
Save memories with privacy protection
Export/Import
Export memories with redacted content
Architecture
Learn about Engram’s security layers