For the complete documentation index, see /developers/llms.txt Markdown versions: append .md to any /developers/{slug} URL. Browse structure: /developers/sitemap.md This page: /developers/tenant-envelope-encryption.md

New here? Start with What is Eigen Mesh? for a plain-language introduction.

Tenant envelope encryption

In plain terms: A master secret (TENANT_MASTER_KEY) encrypts each user's sensitive data at rest — set it once at deploy time and never commit it to git.

Eigen Mesh encrypts sensitive per-tenant data at rest using envelope encryption keyed by TENANT_MASTER_KEY.

Who this is for

  • Operators setting up or rotating encryption keys on self-hosted deployments

TENANT_MASTER_KEY is the root of all tenant encryption. Store it only in secrets managers or .env on the server — never in git, tickets, or chat logs. Rotating it without a re-encryption migration will break existing data.

Setup

Generate a strong master key before first deploy:

openssl rand -base64 32

Set TENANT_MASTER_KEY in your .env (eigen repo) or hosting dashboard. Never commit this value to git.

Rotation

Changing TENANT_MASTER_KEY without a re-encryption migration will break decrypt for existing tenant data. Plan rotation as a maintenance window:

  1. Back up the database.
  2. Run the re-encryption procedure documented in the eigen repository (see operator scripts under scripts/).
  3. Deploy with the new key only after re-encryption completes.

Symptoms

Symptom Likely cause
Encrypt/decrypt errors after deploy TENANT_MASTER_KEY missing, wrong, or changed without re-encryption
New users work, old users fail Key rotation without migration

Troubleshooting

See Troubleshooting for encrypt/decrypt errors and Environment variables for the full variable list.

Next steps

Agent Instructions

This documentation is published for humans and AI agents. Prefer .md URLs for structured content.

  • Index: /developers/llms.txt
  • Full export: /developers/llms-full.txt
  • Sitemap: /developers/sitemap.md
  • Raw page: append `.md` to any /developers/{slug} URL
  • Example: GET /developers/mcp-overview.md

Dynamic `?ask=` and `?goal=` query on markdown URLs is planned — see docs/planning/10-docs-query-api-design.md.