From 1c8735109e0c3f2bab1f0a10fe6648a2c86e4d14 Mon Sep 17 00:00:00 2001 From: Chiranjeet Mishra Date: Fri, 16 Oct 2026 08:50:48 +0000 Subject: [PATCH 1/2] docs: document public key allowed origins matching and overrides Allowed Origins matching rules were undocumented, and the page did not say assistant restrictions do not cover assistantOverrides. --- fern/security-and-privacy/api-keys.mdx | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/fern/security-and-privacy/api-keys.mdx b/fern/security-and-privacy/api-keys.mdx index 35d7a4990..f16b9b7c7 100644 --- a/fern/security-and-privacy/api-keys.mdx +++ b/fern/security-and-privacy/api-keys.mdx @@ -24,6 +24,8 @@ Every API key belongs to one Vapi organization. Choose the key type based on whe | Public API key | Client-side Vapi SDKs and web integrations | Client-side application configuration | | Private API key | Vapi REST API, server SDKs, and server-side integrations | Server-side secret manager or environment variable | +Allowed origins and allowed assistants apply to public keys only. A private key can access everything in your organization, so store it server-side and delete it if it is exposed. + ## Prerequisites - A [Vapi account](https://dashboard.vapi.ai/) @@ -57,6 +59,11 @@ Every API key belongs to one Vapi organization. Choose the key type based on whe For example, add `https://app.example.com` for a production web application. + Enter each origin as scheme, host, and optional port, for example `https://app.example.com`; any path is ignored. The scheme, host, and port must match the browser `Origin` header. + You can use `*` as an entire subdomain label. For example, `https://*.example.com` matches `https://app.example.com` but not `https://example.com` or `https://a.b.example.com`. + Partial wildcards such as `https://myapp-*.example.com` never match. + If you set no allowed origins, the key works from any origin. + Complete New Public API Key form with the expanded Dashboard sidebar, name, allowed origins, allowed assistants, and transient assistant settings @@ -93,6 +100,8 @@ Replace `YOUR_PUBLIC_API_KEY` and `YOUR_ASSISTANT_ID` with values from your Vapi Public API keys are visible in client-side code. Restrict them to the required origins and assistants. For short-lived or user-specific access, use [JWT authentication](/customization/jwt-authentication). + +Restricting a public key to specific assistants does not stop callers from sending `assistantOverrides` for those assistants. Do not rely on a public key to protect the system prompt or server settings of an allowed assistant. ## Test a private API key From 3bd20b47866b16b7a4272cd00ee3a4411419b63c Mon Sep 17 00:00:00 2001 From: Chiranjeet Mishra Date: Fri, 16 Oct 2026 20:07:41 +0000 Subject: [PATCH 2/2] docs: apply review suggestions on public key restrictions --- fern/security-and-privacy/api-keys.mdx | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/fern/security-and-privacy/api-keys.mdx b/fern/security-and-privacy/api-keys.mdx index f16b9b7c7..51d27bc58 100644 --- a/fern/security-and-privacy/api-keys.mdx +++ b/fern/security-and-privacy/api-keys.mdx @@ -17,14 +17,14 @@ If you're setting up API access with an AI coding assistant, the [setup-api-key ## How it works -Every API key belongs to one Vapi organization. Choose the key type based on where your application runs, then limit the key to the origins and assistants that need access. +Every API key belongs to one Vapi organization. Choose the key type based on where your application runs, then limit a public key to the origins and assistants that need access. | Key type | Use it for | Where to store it | | --- | --- | --- | | Public API key | Client-side Vapi SDKs and web integrations | Client-side application configuration | | Private API key | Vapi REST API, server SDKs, and server-side integrations | Server-side secret manager or environment variable | -Allowed origins and allowed assistants apply to public keys only. A private key can access everything in your organization, so store it server-side and delete it if it is exposed. +Only public keys support allowed origins and allowed assistants. A private key can access everything in your organization, so store it server-side and delete it if it is exposed. ## Prerequisites @@ -55,14 +55,17 @@ Allowed origins and allowed assistants apply to public keys only. A private key - For a public key, enter the URLs that may use the key in **Allowed Origins**. In **Allowed Assistants**, select the assistants the key may access. Enable **Transient Assistant** only when the application needs to create calls with [transient assistants](/assistants/concepts/transient-vs-permanent-configurations). + For a public key, enter the origins that may use the key in **Allowed Origins**. In **Allowed Assistants**, select the assistants the key may access. Enable **Transient Assistant** only when the application needs to create calls with [transient assistants](/assistants/concepts/transient-vs-permanent-configurations). For example, add `https://app.example.com` for a production web application. - Enter each origin as scheme, host, and optional port, for example `https://app.example.com`; any path is ignored. The scheme, host, and port must match the browser `Origin` header. - You can use `*` as an entire subdomain label. For example, `https://*.example.com` matches `https://app.example.com` but not `https://example.com` or `https://a.b.example.com`. - Partial wildcards such as `https://myapp-*.example.com` never match. - If you set no allowed origins, the key works from any origin. + Allowed origins follow these rules: + + - Enter each origin as a scheme, host, and optional port. Any path is ignored. + - The scheme, host, and port must match the `Origin` header the browser sends. + - Use `*` in place of one whole subdomain label, one dot-separated part of the host. For example, `https://*.example.com` matches `https://app.example.com` but not `https://example.com` or `https://a.b.example.com`. + - Partial wildcards, such as `https://myapp-*.example.com`, never match. + - If you set no allowed origins, the key works from any origin. Complete New Public API Key form with the expanded Dashboard sidebar, name, allowed origins, allowed assistants, and transient assistant settings