Skip to main content

Credential Vault

A credential vault is a secure repository for centrally managing authentication information for external services. Specific credentials (e.g., API keys, tokens) are stored inside the vault and bound to sessions at creation time, enabling MCP services and skills to reference them at runtime.

Structure

Credentials follow a two-level hierarchy:
  • Vault: A container for grouping and managing credentials.
  • Credential: A specific secret stored within a vault, consisting of a variable name and its corresponding value.

Creating a Vault

  1. On the Credentials page, click Create Vault.
  2. Enter a vault name and click Create.

Adding Credentials

After creating a vault, add individual credentials on the vault's detail page:
  1. Click the vault name to navigate to its detail page.
  2. In the Credential List section, click New Credential.
  3. Fill in the following fields:
    • Name: A display name for the credential.
    • Type: Fixed to Environment Variable. The credential is referenced as an environment variable by the agent and replaced with the real value by the gateway at egress.
    • Variable Name: The key used by tools to reference this credential (e.g., MY_API_KEY). Cannot be changed after creation.
    • Variable Value: The actual secret value. After saving, the console and API display only the last 4 digits; the plaintext is never returned, and the value is decrypted and injected server-side only when referenced by tools.
    • Injection Location: Fixed to Authorization header (Bearer). The real credential is written into the request's Authorization header as Bearer <secret>. Placeholders in the request body and query parameters are not replaced.
    • Allowed Hosts: Restricts which hosts receive the real credential—only requests sent to these hosts have the placeholder replaced; all other hosts only see the placeholder. Separate entries with commas or newlines, support *.example.com wildcard subdomains, up to 10 hosts. Enter * to apply to all hosts; acknowledge the risk and confirm.
  4. Check the shared credential acknowledgement, then click Create to complete.

Credential Injection Mechanism

Credentials are injected via placeholders + gateway rewriting, so the agent itself never touches the real secret:
  1. Placeholder reference: The agent references the credential via the ${VARIABLE_NAME} environment variable in tool or MCP code. For example, writing Authorization: Bearer ${MY_API_KEY} in the Authorization header.
  2. Gateway rewriting: At egress, the gateway checks whether the target host is in the Allowed Hosts list. On a match, it replaces the placeholder in the Authorization header with the real credential; on no match, it leaves the placeholder as-is, so the target host only receives the placeholder.
  3. Scope: Only placeholders in the Authorization header are replaced; placeholders in the request body and query parameters remain untouched.
  4. Host matching rules: Exact and wildcard matching; matching is case-insensitive and ignores ports; *.example.com matches its subdomains but not the bare domain example.com — list the bare domain separately.
  5. Redirect safety: If a request is redirected (3xx) across domains to a host outside Allowed Hosts, the redirected request is not replaced.
Read the credential value straight from the environment variable—no need to hardcode secrets. Put it in the Authorization header in Bearer format, and it will be automatically replaced with the real credential when the request leaves the network.

Choosing Allowed Hosts

  • * (open): Requests to all hosts are replaced with the real credential, for workloads that don't need to restrict where the credential is sent. Acknowledge the risk and confirm.
  • Specific hosts (restricted): e.g. api.example.com, *.example.com. Only requests to matching hosts receive the real credential; all others receive the placeholder, which contains no credential value, so a leaked placeholder does not expose the credential. For cases where the credential should only reach your own services.

Referencing Credentials in Code

No special SDK is required: read the environment variable as usual in tool or MCP code, and put it in the Authorization header in Bearer format. The value read is a placeholder; the gateway replaces it with the real credential when the request goes to a matching host:
import os, requests

# What you read is a placeholder; no need to know the real value
token = os.environ["MY_API_KEY"]
requests.get("https://api.example.com/v1/data",
             headers={"Authorization": f"Bearer {token}"})

Difference from Environment Variables

A session can obtain external values in two ways: session environment variables (environment_variables) and vault credentials. Both are read by name as environment variables in code, but they differ in value form and security posture:
DimensionSession environment variablesVault credentials
Value inside the containerReal valuePlaceholder
When the real value appearsReadable inside the container at all timesOnly at the moment the egress gateway matches an allowed host
Domain restrictionNoneOnly requests sent to allowed hosts are replaced with the real value
Authentication method restrictionNone; the value can be used freely in codeOnly Authorization header replacement; other headers or request-body authentication are not supported
Reuse and rotationConfigured per session; changes require a session updateVaults are reusable across sessions, with centralized updates and rotation
Suitable scenariosNon-sensitive configuration, or SDKs/skills whose underlying authentication method is unknownHigh-sensitivity scenarios where the credential must not leak
  • When using a third-party SDK or skill whose underlying request authentication cannot be confirmed, the gateway cannot guarantee replacement at the correct location — use session environment variables instead.
  • The real value of a session environment variable can be read or printed by code in the container and may enter logs and model context; use a vault for highly sensitive credentials.

Binding to a Session

When creating a session, select an existing vault from the Credential Vault dropdown field. During session execution, MCP services and skills can reference credential values using their variable names.

Next Steps

Agent Development
Agent Context
Agent Governance & Evolution
Store
Application Marketplace