Skip to content
Back to the app

Customer-Held Keys ​

With Customer-Held Keys, your organisation holds the key that protects its tool and integration credentials: SAP, Salesforce, bank and database logins, API tokens. You can withdraw that key at any time, and from then on the platform cannot read those credentials.

How it works ​

  1. When you turn it on, the platform creates a 256-bit data key for your organisation.
  2. Your key wraps the data key. It is one of these:
    • local: a key on your own installation, held in the environment variable CUSTOMER_KEK or CUSTOMER_KEK_<NAME> (64 hex characters; openssl rand -hex 32).
    • vault-transit: a transit key in your own HashiCorp Vault. The platform sends the data key to your Vault to be wrapped and unwrapped, and never sees your key. The Vault address must use https.
    • pkcs11: a key in your own hardware security module (on-premise installs). See Keys in your HSM.
  3. Only the wrapped data key is stored. Each credential is sealed with AES-256-GCM under the data key.
  4. The unwrapped data key is kept in memory only, and is checked with your key every minute (CUSTOMER_KEY_REFRESH_SECONDS).

Your off switch ​

You do thisThe effect
Revoke the Vault token, disable the transit key, or remove CUSTOMER_KEKWithin 5 minutes (CUSTOMER_KEY_MAX_STALE_SECONDS), credentials can be neither read nor saved. Agent steps that need them fail with a clear error
Restore the keyAccess returns at the next check
Destroy the data keys: DELETE /api/orgs/{slug}/customer-key with {"confirm":"<slug>"}The sealed credentials are permanently unreadable by anyone. New credentials use the platform key

The platform fails closed. When your key is unavailable, it never falls back to the platform key or to plaintext.

Turning it on ​

Only an organisation owner can turn it on.

bash
# On your own installation, with CUSTOMER_KEK set in the backend's environment
curl -X PUT https://<your-host>/api/orgs/<slug>/customer-key \
  -H "Authorization: Bearer <owner session token>" -H "Content-Type: application/json" \
  -d '{ "provider": "local", "keyRef": "CUSTOMER_KEK" }'

# With HashiCorp Vault
curl -X PUT https://<your-host>/api/orgs/<slug>/customer-key \
  -H "Authorization: Bearer <owner session token>" -H "Content-Type: application/json" \
  -d '{ "provider": "vault-transit", "keyRef": "changents", "vaultAddr": "https://vault.example.com", "vaultToken": "<token>" }'

The key is tested before anything is saved: a fresh data key is wrapped, then unwrapped. The organisation's existing credentials are then re-sealed under the new key. Calling it again rotates to a new data key, and values sealed under earlier versions stay readable. GET /api/orgs/{slug}/customer-key shows the provider, the version, and when the key was last verified.

For Vault, give the token only update on transit/encrypt/<key> and transit/decrypt/<key>. The platform stores the token encrypted under its own key.

Scope, stated plainly ​

  • Covered: tool and integration credentials.
  • Not covered: other stored data (run history, documents, account records) uses the platform key. To keep run content off the platform altogether, use No-Retention Mode.
  • Not yet supported: cloud key services (AWS KMS, Azure Key Vault, Google Cloud KMS).
  • Platform key format: values encrypted with the platform key are now written as authenticated AES-256-GCM. Values written earlier with AES-256-CBC are still read.
  • No attestation. This protects data at rest under your key. It does not prove which code runs on the platform's servers.

Keep a copy of your key ​

If you lose your key, the sealed credentials cannot be recovered: not by you, and not by us. Keep it in your own key management system with its usual backup.

Keys in your HSM ​

On an on-premise install, your key can be held in a hardware security module you run, through its PKCS#11 library: for example Thales Luna, Entrust nShield, Utimaco or an AWS CloudHSM cluster.

How. When you turn it on with "provider": "pkcs11" and a keyRef, the platform finds the AES-256 key with that label on your token, or creates it there. A key it creates is non-extractable and sensitive, so it never leaves the HSM. Your organisation's data key is encrypted inside the HSM with CKM_AES_GCM (a fresh 96-bit IV each time, a 128-bit tag); only that encrypted copy is stored. The same fail-closed rules apply as for the other providers: a token that cannot be reached means your sealed credentials cannot be opened.

The platform's own key. The key behind the platform's encrypted values can also live in the HSM. Run node scripts/hsm-platform-key.js --from-env with your current ENCRYPTION_KEY (or --generate on a new install), then set PLATFORM_KEY_PROVIDER=pkcs11, PLATFORM_KEY_LABEL and PLATFORM_KEY_WRAPPED from its output and remove ENCRYPTION_KEY. --from-env keeps the same key, so everything already stored stays readable. The backend opens the key at start-up and will not start if the HSM refuses.

Setup.

  1. Use the HSM image (backend/Dockerfile.hsm, Debian-based, because vendor libraries are built for glibc). Mount your vendor's PKCS#11 library and its configuration into the container.
  2. Set PKCS11_MODULE (the library's path), PKCS11_TOKEN_LABEL (or PKCS11_SLOT) and PKCS11_PIN (from a secret; it is never logged or shown in an error).
  3. On Kubernetes, set the chart's hsm.* values (Kubernetes); they set these variables, mount hsm.libraryVolume at /opt/hsm and read the PIN from hsm.pinSecret.

GET /api/orgs/:slug/customer-key reports the provider, the token's label, maker and model, and when the key was last verified.

Tested with SoftHSM2 (an open-source PKCS#11 token). We have not yet tested against a specific vendor's device; tell us your model and we will test with its library before go-live.

Certification. Any FIPS 140-3 or Common Criteria certification is your HSM's, not ours. The platform does not hold one.

Served from this deployment. No page view leaves it.