Envault

Envelope Encryption

Understanding Envault's security model and request flow

Security Architecture

Envault prioritizes security above all else. Our architecture is designed to ensure that your secrets remain confidential, even in the event of a database compromise. We adhere to the principle of Defense in Depth.

Envelope Encryption

We use a multi-tiered encryption strategy known as Envelope Encryption. This limits the exposure of any single key and allows for easier key rotation.

True Client-Side Encryption (CSE)

Envault recently transitioned its Go CLI to a True Client-Side Encryption (CSE) model.

Unlike traditional architectures where the Node.js API server decrypts the payload and sends plaintext variables over the wire, Envault pushes the cryptographic heavy lifting to your local machine:

  • envault pull: The Next.js API provides the unwrapped Data Encryption Key (DEK) and the raw AES-256-GCM ciphertext to the Go CLI. The Go CLI performs the AES decryption locally on your machine.
  • envault deploy: The Go CLI requests the active DEK from the server, encrypts your local .env variables locally via AES-256-GCM, and transmits only the resulting ciphertexts to the Supabase database. The Node.js server never sees your plaintext secrets.

Threat Model

What happens if...

The Database is Leaked?

Impact: Low. Attacker gains access to:

  • Encrypted Secrets (Ciphertext)
  • Encrypted Data Keys
  • User Metadata

They cannot decrypt any secrets because the Master Key is not in the database.

The Server is Compromised?

Impact: Critical. If an attacker gains full shell access to the running server, they can read the ENCRYPTION_KEY from the environment.

  • Mitigation: Use a hardened infrastructure provider (e.g., Vercel, AWS ECS). Restrict access to the production environment. Envault does not store decrypted secrets on disk.

A Developer's Laptop is Stolen?

Impact: Medium.

  • The attacker might have access to the local .env file if it was pulled.
  • Mitigation: envault pull does not persist credentials permanently. Revoke the user's access immediately via the dashboard to prevent fetching new secrets.

Key Rotation

Envault supports key rotation to minimize the impact of a potential key compromise.

To rotate the Master Key, you must provide the old key and the new key to a migration script that re-encrypts all Data Keys.

  1. Generate New Key: Create a new 32-byte random string.
  2. Update Environment: Update the ENCRYPTION_KEY variable on your deployment to the new key, and set the old key to OLD_ENCRYPTION_KEY.
  3. Run Scavenger Process: Call the Supabase edge function to process the migration:
    curl -X POST 'https://<PROJECT_REF>.supabase.co/functions/v1/rotate-keys' \
      -H 'Authorization: Bearer <YOUR_SUPABASE_SERVICE_ROLE_KEY>'
    This function decrypts all Data Keys with the Old Master Key and re-encrypts them with the New Master Key.

Agent Mutation Architecture (SDK/MCP)

Agent-driven mutations use a delegated token + human approval execution model.

Design properties:

  • Mutations are paused until explicit human approval.
  • Approved payload retrieval is burn-after-read to reduce replay risk.
  • Global and project-level kill switches can disable agent mutations.

On this page