API Key Security & Encryption

Your AI API keys are credentials that grant access to your provider account and affect your billing. Evrykit takes several steps to ensure they are stored safely and never exposed unnecessarily.

How Keys Are Stored

When you save an API key in Settings โ†’ AI Keys, Evrykit immediately encrypts it before writing anything to the database. The original key value is never persisted in plaintext anywhere in the system.

Encryption Algorithm

Keys are encrypted using AES-256-GCM (Advanced Encryption Standard, 256-bit key, Galois/Counter Mode). This is the same algorithm used by modern browsers for HTTPS and by major cloud providers for at-rest encryption.

Each encrypted value is self-contained and uses the format:

base64( IV[12 bytes] + ciphertext + auth_tag[16 bytes] )

Encryption Key

The encryption key itself is derived from the ENCRYPTION_KEY environment variable, which is configured on your server and never stored in the database or committed to source control. This means that even if someone obtained a full database dump, they could not decrypt your API keys without also having the server's environment configuration.


What Is Displayed in the UI

The settings view never shows your full API key. When a key is configured, the display shows a masked preview in the form:

AIzaSyโ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ขGZo

This shows the first 4 and last 3 characters only โ€” enough to confirm which key is configured, but not enough to reconstruct it. The edit form placeholder shows the same masked value so you know a key is present without revealing it.


When Keys Are Used

A key is decrypted from the database exactly once per AI request โ€” in memory, on the server, at the moment the request is made. The decrypted key value:

Keys are never sent to the browser. The frontend communicates with Evrykit's own /ai/report/analyze/stream endpoint, and Evrykit's backend handles the provider communication using the stored key.


Key Isolation Per Tenant

Each organisation (tenant) in Evrykit stores its own encrypted AI keys. One tenant's keys are completely separate from another's. There is no shared key pool and no way for one tenant to access another tenant's AI configuration.


What To Do If a Key Is Compromised

If you suspect an API key has been leaked (for example, if you accidentally pasted it somewhere public):

  1. Revoke the key immediately in the provider's dashboard:

  2. Generate a new key from the same provider dashboard.

  3. Update the key in Evrykit via Settings โ†’ AI Keys. Paste the new key into the relevant field and save. The old encrypted value will be replaced.

  4. Check your provider's usage logs for any unexpected API calls that occurred while the key was exposed.


Recommendations

โ† Previous
Choosing the Right Model