Storing OAuth tokens with Cloud KMS envelope encryption, bound to their connection with AES-GCM AAD Draft
When members connect to external MCP servers, their OAuth tokens are stored in the database. They used to be encrypted with one app-wide Fernet key, so a ciphertext copied to another row decrypted as that row’s token. Now each write uses a fresh AES-256-GCM data key, wrapped by Cloud KMS, with AAD naming the environment, workspace, connection, member, and token kind. The KMS work happens before the refresh token is rotated.