Skip to content
Latest (currently 2026.10.2) has the newest features, bug fixes, and CVE patches of Solo Enterprise for agentgateway.

For the complete documentation index, see llms.txt. Markdown versions of all docs pages are available by appending .md to any docs URL.

External secrets

Page as Markdown

Read credentials such as LLM API keys from an external secret store like HashiCorp Vault, instead of storing them as Kubernetes Secrets.

Read LLM API keys, backend authentication credentials, and other sensitive values from an external secret store, instead of storing them as Kubernetes Secrets.

About external secrets

By default, Solo Enterprise for agentgateway reads the credentials that backends and policies need, such as LLM provider API keys, from Kubernetes Secrets. With this approach, a copy of each credential lives in the cluster’s etcd datastore, and anyone with Secret read access in the namespace can retrieve it.

With external secrets, Solo Enterprise for agentgateway instead reads credentials from an integrated external secret store, such as files projected by the Kubernetes Secrets Store CSI Driver from a provider like HashiCorp Vault. The credential material is materialized in memory on every agentgateway replica and is consumed directly by the gateway. It is never written back to the cluster as a Kubernetes Secret.

Note

External secrets currently support a single file store provider, designed to read files mounted by the Secrets Store CSI Driver. Direct provider integrations (such as a native HashiCorp Vault store) are not currently supported.

How it works

The following diagram shows how external secrets work for an LLM provider API key that is stored in HashiCorp Vault.

  • The dotted lines show the one-time configuration flow that projects the key into the cluster and materializes it in memory.
  • The solid lines show the per-request request flow, where a client request reaches the gateway, the gateway reads the materialized credential, and the gateway authenticates to the LLM provider.
    flowchart LR
    Client([Client])

    subgraph vault["HashiCorp Vault"]
        V["API key"]
    end

    subgraph cluster["Kubernetes cluster"]
        direction TB
        F["Credential file<br>(agentgateway controller)"]
        ES["EnterpriseAgentgateway<br>ExternalSecret"]
        CRED["Materialized API key<br>(in memory)"]
        GW["AgentgatewayBackend"]
    end

    LLM(["LLM provider"])

    %% Configuration flow (one time)
    V -. "Secrets Store CSI Driver" .-> F
    F -. "storeRef" .-> ES
    ES .-> CRED

    %% Request flow (per request)
    Client -- "request" --> GW
    CRED -- "secretRef" --> GW
    GW -- "request<br>(with API key)" --> LLM

    classDef accent fill:#7734be,stroke:#7734be,color:#fff;
    class ES,CRED accent;
  

Example configuration

External secrets involve three pieces: the secret store, the secret reference, and the consumer backend or policy.

  1. Secret Store: An installation-global definition of where credentials come from. You define stores once per installation in the enterprise-agentgateway Helm values under externalSecrets.stores. Each store has a name and exactly one provider. Store configuration is non-sensitive by design: it flows through Helm values and a ConfigMap, so the actual credentials are never part of the store definition.

    Example configuration:

    externalSecrets:
      stores:
        - name: llm-secrets
          file:
            path: /var/run/secrets/agentgateway-external-secrets/llm
  2. EnterpriseAgentgatewayExternalSecret: A namespaced custom resource that maps values from a store into named, in-memory credential keys. It references a store by name with storeRef, and each entry in data maps a remoteRef (a provider object) to a materializedKey (the data key that backends and policies read).

    Example configuration: Here, the openai-api-key file from the llm-secrets store materializes under the Authorization key.

    apiVersion: enterpriseagentgateway.solo.io/v1alpha1
    kind: EnterpriseAgentgatewayExternalSecret
    metadata:
      name: openai-external-secret
    spec:
      storeRef:
        name: llm-secrets
      refreshInterval: 1h
      data:
        - materializedKey: Authorization
          remoteRef:
            key: openai-api-key
  3. Consumer: A backend or policy that references the materialized credential. Instead of pointing a secretRef at a Kubernetes Secret, you point it at the EnterpriseAgentgatewayExternalSecret by setting the ref’s group and kind. The credential resolver returns the materialized value.

    Example configuration:

    auth:
      secretRef:
        group: enterpriseagentgateway.solo.io
        kind: EnterpriseAgentgatewayExternalSecret
        name: openai-external-secret

File store reference mapping

In the example, remoteRef.key is openai-api-key. For a file store, remoteRef.key is a path relative to the store root that names either:

  • A YAML or JSON map file, where remoteRef.property selects a top-level key.
  • A directory, where remoteRef.property selects a regular file inside it.

If you omit remoteRef.property, a scalar file is materialized as raw bytes, and a map file is materialized as a JSON map of all of its properties. Nested property paths, such as foo.bar, are not supported. File stores do not support remoteRef.version.

Refresh and rotation

The refreshInterval field on the EnterpriseAgentgatewayExternalSecret, set to 1h in the example, governs how often network providers are refreshed. The minimum is 15m and the default is 1h. For file stores, agentgateway watches the store root and re-materializes credentials immediately when mounted files change, with a periodic backstop poll to catch nested or missed changes.

Whether a mounted file actually changes depends on the volume source. Kubelet-managed Secret, ConfigMap, and projected volumes propagate updates automatically. A Secrets Store CSI Driver mount changes after pod start only if the driver’s secret rotation is enabled. Without rotation, the credential materializes once and does not refresh until the pod restarts, regardless of refreshInterval.

Status

The EnterpriseAgentgatewayExternalSecret, such as the openai-external-secret in the example, reports an Accepted condition for deterministic outcomes that every replica agrees on:

ReasonStatusMeaning
AcceptedTrueThe spec resolved against the configured store and the referenced provider objects.
StoreValidationFailedFalseThe storeRef names a store that is not configured in the Helm values.
ReferencedObjectNotFoundFalseThe referenced provider object or file does not exist in the store.

Transient refresh failures, such as a temporarily unavailable provider, are not reported on the resource status because materialization is process-local to each replica. Instead, each controller pod exports per-replica metrics under the enterprise_agentgateway_externalsecret prefix.

Guides

Review the following guides for different external secret store provider setup.

Tip

Throughout the documentation, you can use external secret storage instead of Kubernetes Secret-based storage, such as for LLM provider API keys.