Unlike the other backends, the konnect type doesn’t connect out to an external secret manager.
It stores secrets directly in Konnect, in a Config Store: a named container of key-value secrets that you create and populate through its own API, separate from the AI Vault entity itself.
A konnect-type AI Vault doesn’t hold any secret values. It only references a Config Store by ID through config.config_store_id. The Config Store holds the actual secrets.
Secret values are write-only. Once stored, AI Gateway never returns the value again, only the secret’s key and timestamps.
Config Stores are managed through the AI Gateway API:
Both support full create, list, get, update, and delete operations.
Deleting a Config Store that still has secrets fails unless you pass ?force=true, which cascades the delete to all secrets in that Config Store.
The following example creates a Config Store:
curl -X POST "https://us.api.konghq.com/v1/ai-gateways/$AI_GATEWAY_ID/config-stores" \
--no-progress-meter --fail-with-body \
-H "Authorization: Bearer $KONNECT_TOKEN"\
-H "Content-Type: application/json"\
-H "Accept: application/json, application/problem+json" \
--json '{
"name": "prod-secrets"
}'
Add a secret to the Config Store:
curl -X POST "https://us.api.konghq.com/v1/ai-gateways/$AI_GATEWAY_ID/config-stores/$CONFIG_STORE_ID/secrets" \
--no-progress-meter --fail-with-body \
-H "Authorization: Bearer $KONNECT_TOKEN"\
-H "Content-Type: application/json"\
-H "Accept: application/json, application/problem+json" \
--json '{
"key": "openai-api-key",
"value": "sk-my-openai-key"
}'
Create a konnect-type AI Vault that points at the Config Store’s id:
To create a Vault entity, call the Konnect AI Gateway API’s /vaults endpoint.
curl -X POST https://{region}.api.konghq.com/v1/ai-gateways/{AIGatewayId}/vaults \
--header "accept: application/json" \
--header "Content-Type: application/json" \
--header "Authorization: Bearer $KONNECT_TOKEN" \
--data '
{
"name": "prod-config-store-vault",
"description": "Vault backed by the built-in Konnect Config Store.",
"type": "konnect",
"config": {
"config_store_id": "'$CONFIG_STORE_ID'"
}
}
'
Make sure to replace the following placeholders with your own values:
-
region: Geographic region where your Kong Konnect is hosted and operates.
-
KONNECT_TOKEN: Your Personal Access Token (PAT) associated with your Konnect account.
-
AIGatewayId: The id of the AI Gateway.
See the Konnect AI Gateway API reference to learn about region-specific URLs and personal access tokens.
ai_gateway_vaults:
- ref: prod-config-store-vault
ai_gateway: !lookup {id: !env AI_GATEWAY_ID}
name: prod-config-store-vault
description: Vault backed by the built-in Konnect Config Store.
type: konnect
config:
config_store_id: !secret {source: !env CONFIG_STORE_ID}
Make sure to replace the following placeholders with your own values:
AI_GATEWAY_ID: The id of your AI Gateway.
The following creates a new AI Vault. Suggested values are shown in backticks:
- In the Konnect sidebar, click Gateways.
- Select your AI Gateway.
- Click the Vaults tab.
- Click New vault.
- In Vault configuration, select the vault type (for example:
konnect) and enter the fields for that type.
- In the Name field, enter
prod-config-store-vault.
- Optional: In the Description field, enter a description.
- Click Save.
Reference the secret the same way as any other AI Vault:
{vault://prod-config-store-vault/openai-api-key}