Skip to main content

Overview

Encryption keys let you encrypt sensitive fields in logs and sessions before they reach Formal’s servers. You decrypt them on demand from your browser. Encrypted fields are stored as JWE (JSON Web Encryption) instead of plaintext. Refer to the log configuration documentation to learn which fields can be encrypted.
Log encryption keys are separate from Token Encryption. Use token encryption (and the HTTP encrypt / decrypt policy actions) to seal OAuth tokens in the data path. See Encrypt MCP OAuth Tokens.

Configuration via Terraform

Encryption keys are managed through the formal_encryption_key resource. AWS KMS, GCP KMS, and Azure Key Vault are supported, all using an asymmetric RSA key. The encrypting client (Connector or Desktop App) holds only the public key and needs no cloud credentials, so only the decryptor can recover the plaintext.
The region is derived from the key ARN, so pass the full ARN in key_id.
Symmetric and deterministic algorithms (aes_random, aes_deterministic) are deprecated and can no longer be registered. Encryption keys use asymmetric RSA (rsaes_oaep_sha256), which both the Connector and Desktop App can use without cloud credentials.

The Decryptor

Formal cannot decrypt these fields. When you set a decryptor_uri, the client-side JavaScript of the Formal Console calls it when a user decrypts a field. The endpoint must support CORS and accept POST requests with the encrypted payload in the body. Use this decryptor reference implementation, which unwraps AWS KMS, GCP KMS, and Azure Key Vault keys and ships Terraform examples for Lambda, Cloud Run, and Container Apps.
There is no authentication mechanism between the Formal Console and the decryptor. Deploy it behind a VPN or in a private network to restrict access.