Encryption Keys and Data Locations
Two controls in Admin › Trust › Settings keep your data under your organization's control:
- Encryption keys: the key that protects Studio's stored secrets stays in your own key service, HashiCorp Vault or Azure Key Vault.
- Data locations: say where each model connection sends what people type, and where each phone line's calls go, and allow only the places you choose.
Only admins can see or change them. Every change is recorded in Admin › Trust › Audit log.
Encryption keys
What is protected
Studio keeps some secrets so it can use them later. They are always stored encrypted:
- the keys of model connections and other services in the settings;
- API Builder credentials, and catalog keys and secrets;
- the secrets of workflow triggers and website widgets;
- e-mail and messaging account passwords;
- the copies of people's API keys that their tools use;
- two-step sign-in secrets, Computer tokens and OAuth sessions.
Without a key service
By default, the encryption key comes from Studio's own settings (HRIDAAI_SECRET_KEY). Anyone who has both the database and that setting can read the secrets.
With your own key service
Studio makes a random data key and encrypts every new secret with it. The data key is never stored as it is. Your key service encrypts ("wraps") it with a key that never leaves the service, and Studio's database keeps only the wrapped copy. Studio asks the key service to unwrap it when it starts, and again every hour.
So:
- the database, or a backup of it, reveals no secret on its own;
- you stay in control: revoke or disable the key in your key service, and Studio can no longer read the stored secrets.
Set up HashiCorp Vault
- In Vault, turn on the Transit secrets engine and create a key for Studio, for example
hrida-studio. - Give Studio a policy that only lets it encrypt and decrypt with that key, and renew its own token if it signs in with one.
- Let Studio sign in with a token that has the policy, or with an AppRole.
- Set these on Studio, and on the API gateway service if you run it, then restart them:
| Setting | |
|---|---|
HRIDAAI_KEY_PROVIDER | vault |
VAULT_ADDR | Vault's address, for example https://vault.example.com:8200 |
VAULT_TOKEN | A token with the policy. Studio renews it every hour. |
VAULT_ROLE_ID and VAULT_SECRET_ID | Instead of a token: AppRole. Studio signs in each time it unwraps. |
VAULT_APPROLE_MOUNT | Where AppRole is mounted, approle by default |
VAULT_NAMESPACE | The namespace, on HCP Vault or Vault Enterprise |
VAULT_CACERT | The certificate authority's file, when Vault's certificate comes from your own |
HRIDAAI_VAULT_TRANSIT_MOUNT | Where Transit is mounted, transit by default |
HRIDAAI_VAULT_TRANSIT_KEY | The key's name, hrida-studio by default |
Set up Azure Key Vault
- Create an RSA key of 2048 bits or more in a key vault or a Managed HSM. Turn on soft delete and purge protection.
- Let Studio's identity wrap and unwrap with the key, for example with the Key Vault Crypto Service Encryption User role on it.
- Let Studio sign in to Azure: a managed identity, workload identity, or a service principal (
AZURE_TENANT_ID,AZURE_CLIENT_ID,AZURE_CLIENT_SECRET). - Set these on Studio, and on the API gateway service if you run it, then restart them:
| Setting | |
|---|---|
HRIDAAI_KEY_PROVIDER | azure-keyvault |
HRIDAAI_AZURE_KEYVAULT_URL | The vault's address, for example https://my-vault.vault.azure.net |
HRIDAAI_AZURE_KEYVAULT_KEY | The key's name |
HRIDAAI_AZURE_KEYVAULT_KEY_VERSION | A version of the key. Empty: the current one. |
After you turn it on
- At its first start, Studio makes its data key and has your key service wrap it.
- Existing secrets stay readable. One server moves them onto the data key in the background. The card shows when this finished and how many secrets moved.
- Until then, an existing secret can still be read with the old key.
The Encryption keys card
It shows the key service and its status (Working, Refused, Can't be reached or Not set up), the key and the service's address, when the data key was made, and when this server last unwrapped it. It also shows the last re-encryption: when it ran and how many secrets moved.
- Rotate the data key makes a new data key, wrapped by your key service. The stored secrets move onto it in the background. The older key stays, to read what hasn't moved yet. Rotate when your policy says to, or if you think a data key may have leaked.
- Re-encrypt now moves every stored secret onto the current key now. One server does it.
A new version of the key in Vault or Azure needs nothing from Studio: a wrapped data key still unwraps with the version that wrapped it, while that version is allowed. Rotate the data key then wraps a new one with the newest version.
When the key service refuses or can't be reached
| What happens | What Studio does |
|---|---|
| The key is revoked, disabled or deleted, or Studio may no longer use it | Within the hour, Studio stops reading the stored secrets. Connection keys in the settings stay in memory until Studio restarts. Settings and new secrets can't be saved, and an error says why. Admin › Trust › Security records Key service refused the key, with high severity. Once the key is allowed again, Studio recovers within a minute. |
| The key service can't be reached (a network problem or an outage) | Studio keeps using the data key it already has, and tries again every minute. Security records Key service could not be reached. A server that starts while it can't reach the key service can't read the stored secrets until it can. |
Limits
- Files people upload aren't covered. Encrypt the disk or volume that holds them.
- Every Studio server, and the API gateway service, needs the same settings and access to the key service.
- Turning the key service off again isn't supported: secrets encrypted with the data key can't be read without it, and would have to be entered again.
- Keep your key safe. If the key is lost, so are the secrets: a database backup can't bring them back.
- AWS KMS isn't supported.
Data locations
Label each connection
Admin › Trust › Settings › Data locations lists every model connection, and every phone line:
- OpenAI-compatible and Ollama connections;
- the fallback provider;
- the LLM providers of your agent catalogs;
- voice agents' phone lines, shown as Phone line (Twilio) with their name and number: Twilio carries their calls' audio.
Type each one's location: local for this network, or a name you choose, such as a country, a region or a cloud region ("India", "European Union", "Azure Central India"). Capitals and spacing don't matter.
Choose the allowed locations
- Tick the locations models may be used at. The labels you've typed are offered; Add others.
- Click Save the data locations. If a connection would no longer be used, Studio asks first and names it.
With nothing ticked there's no limit. That's the default.
What happens to a connection outside them
- Its models leave everyone's model list, with the Enterprise Agents built on them.
- A chat or API request for one is refused. The answer says where the connection is and that the location isn't allowed.
- Workflows, the assistants, voice agents, the guardrails' AI check and the quality judge can't call it either. A fallback outside the allowed locations is passed over.
- The fallback provider isn't used if it's outside.
- A phone line outside them takes no calls. Callers hear that the line isn't available.
- Each refusal is recorded in Admin › Trust › Security as Outside the allowed data locations, at most once per connection every ten minutes on each server.
A connection without a location counts as outside.
Limits
- Document services (embeddings, document extraction), speech and image generation aren't covered. If their data must stay inside, point them at services in your own network.
- A label is what you say it is: Studio doesn't check where a service really runs.
TRUST_ALLOWED_LOCATIONS(comma-separated) sets the allowed locations when Studio first starts. After that, change them on the card.