Runtime authentication
Configure API keys and model endpoints for AgentConnect runtimes on Kubernetes. Use a shared Secret for runtime discovery and agent sessions without interactive login.
The daemon pool starts each installed runtime in a probe sandbox to discover its available models. Because the probe has no agent identity, it can't read organization or agent secrets. Instead, use a cluster-wide Secret to supply API keys to both the probe and agent sessions. Use API-key authentication for unattended runtimes, since interactive OAuth login can't complete in the pool probe.
Choose the runtime image
The chart's default runtime-sandbox image includes Claude Code, Codex, DeepSeek Harness, and OpenCode. The published runtime-sandbox-full image adds Qwen Code and other ACP runtimes:
daemonPool:
runtime:
repository: ghcr.io/agentconnect-md/runtime-sandbox-fullThe chart appends the selected AgentConnect release tag automatically. Use daemonPool.runtime.image to pin a full image reference. Changing the image restarts runtime discovery.
Configure any runtime with a Secret
For OpenCode with Anthropic, OpenAI, or DeepSeek, use the built-in model pairs below. Existing pairs are reused automatically with no separate OpenCode environment mapping needed. Use the steps below for other providers or extra runtime settings.
- Pick a model provider and get an API key. Check the runtime's official documentation for its API-key environment variable, supported model IDs, and endpoint format. For example, see Qwen Code authentication, OpenCode providers, and DeepSeek's API root.
- Store the key, endpoint, and any runtime config in a Kubernetes Secret in the AgentConnect release namespace. Don't put API keys in Helm values.
- Map each runtime's environment variable to a Secret entry under
daemonPool.runtimeEnvironment.runtimes, using the runtime ID reported by the image. The chart projects only the named entries into the daemon and passes each runtime only its own mapped variables at probe and session launch. - Upgrade the Helm release. Updating the mapping rolls the daemon pool and reruns the probe. If you change a Secret value in place, restart the daemon pool to refresh its environment and probe results.
For example, a deployment using DeepSeek's OpenAI-compatible API can store these entries in its Secret:
| Secret entry | Value |
|---|---|
PROVIDER_API_KEY | Your DeepSeek API key |
PROVIDER_BASE_URL | https://api.deepseek.com |
QWEN_MODEL | deepseek-flash |
OPENCODE_CONFIG_CONTENT | {"model":"deepseek/deepseek-flash","provider":{"deepseek":{"options":{"baseURL":"https://api.deepseek.com"}}}} |
Then reference those entries without copying secret values into Helm:
daemonPool:
runtime:
repository: ghcr.io/agentconnect-md/runtime-sandbox-full
runtimeEnvironment:
existingSecret: agentconnect-model-credentials
runtimes:
qwen-code:
OPENAI_API_KEY: PROVIDER_API_KEY
OPENAI_BASE_URL: PROVIDER_BASE_URL
OPENAI_MODEL: QWEN_MODEL
opencode:
DEEPSEEK_API_KEY: PROVIDER_API_KEY
OPENCODE_CONFIG_CONTENT: OPENCODE_CONFIG_CONTENTQwen Code selects OpenAI-compatible API-key auth from OPENAI_API_KEY. OpenCode selects the deepseek provider and model from OPENCODE_CONFIG_CONTENT and reads DEEPSEEK_API_KEY from its environment. The endpoint and model above follow DeepSeek's current API documentation. Check your provider's documentation if you use a different service. Neither runtime needs browser login or a stored OAuth account.
OpenCode's model setting picks a default model and doesn't restrict the provider list. For providers outside the built-in pairs, add their API keys to the Secret and map their variables under opencode, such as OPENCODE_API_KEY for OpenCode Zen. When built-in pairs are configured, explicitly list any additional providers in enabled_providers inside OPENCODE_CONFIG_CONTENT. Seeing a model in a catalog doesn't prove your account can call it, so verify it with a test request using that provider's credential.
You can omit runtimeEnvironment.existingSecret if daemonPool.modelCredentials.existingSecret already points to the same Secret. Each mapping targets a Secret entry name, not an inline value. A missing or empty entry fails daemon startup instead of silently probing without the expected credential. A runtime mapping overrides an agent-level variable of the same name, while built-in model translation and issued session keys keep their existing precedence for the variables they set.
Built-in model pairs and other sources
The chart also supports daemonPool.modelCredentials.existingSecret for built-in credential translation:
| Runtime | Token entry | Base URL entry |
|---|---|---|
Claude Code and OpenCode's anthropic provider | ANTHROPIC_MODEL_TOKEN | ANTHROPIC_MODEL_BASE_URL |
Codex and OpenCode's openai provider | OPENAI_MODEL_TOKEN | OPENAI_MODEL_BASE_URL |
DeepSeek Harness and OpenCode's deepseek provider | DEEPSEEK_MODEL_TOKEN | DEEPSEEK_MODEL_BASE_URL |
MODEL_TOKEN and MODEL_BASE_URL act as a shared fallback for these recognized runtimes. A runtime-specific pair replaces the shared pair as a whole. The daemon translates each pair into that runtime's config at probe and spawn time, and doesn't translate pairs for Qwen Code or arbitrary runtimes. Use runtimeEnvironment for those runtimes or for settings beyond a key and URL, such as model selection or provider config.
OpenCode defaults to the providers configured through these pairs. Explicit enabled_providers, model restrictions, and custom model definitions in OPENCODE_CONFIG_CONTENT are preserved. Reuse the Claude Code base URL for Anthropic: AgentConnect appends /v1 for OpenCode's SDK without duplicating an existing /v1 suffix. OpenAI and DeepSeek base URLs pass through unchanged.
When using a key server, endpoint-only pairs are enough for model discovery. Discovery doesn't make model requests, and each live session gets an issued key for its selected provider. Switching providers takes effect on the next runtime start after current work finishes, using the new provider's key. Without a key server, OpenCode receives the separate static keys and can switch directly between configured providers.
modelEgress.clients is another cluster-wide source for supported clients. The chart rejects combining it with modelCredentials.existingSecret, or setting a built-in pair again in daemonPool.extraEnv. Organization and agent variables and secrets are passed to their agent sessions, but not to the independent pool probe. Infra → Provider keys stores organization connections for supported provider consumers, not ACP runtime credentials.
OpenCode also reuses pairs supplied by modelEgress.clients.claude, .codex, and .deepseek. Those client entries work as-is for OpenCode, with no separate opencode client entry needed.
For a Codex gateway, set OPENAI_MODEL_TOKEN and OPENAI_MODEL_BASE_URL to the gateway's Codex-compatible API root. The daemon configures both Codex's provider URL and its API key. When connecting to DeepSeek directly, use its documented API root, https://api.deepseek.com.
To confirm discovery after a rollout, check the daemon pool's probe completion log and inspect the runtime's model picker in the console. A runtime installed in the image can still show an empty picker if its API key, model ID, or endpoint is misconfigured.
Keys stay with the daemon pool
When a provider endpoint uses HTTPS, the cluster's static keys don't enter agent pods. The daemon pool reads them from its own environment, passes a placeholder to the pod's runtime, and injects the real key on each outbound request to the provider. This applies only to keys configured through this chart: the built-in pairs in modelCredentials, modelEgress.clients.<client>.apiKey, and ANTHROPIC_API_KEY, OPENAI_API_KEY, DEEPSEEK_API_KEY, and COPILOT_PROVIDER_API_KEY mapped under runtimeEnvironment.
- The daemon pool needs outbound HTTPS access to every provider endpoint or gateway these keys target. If your cluster restricts egress from the release namespace, allow those destinations.
- A key stays in the pod's environment if its endpoint uses plain
http://, if the daemon can't map it to a single endpoint for that runtime, or if another variable also contains the key (such as anOPENCODE_CONFIG_CONTENTwith an embedded key). The daemon logs a notice once when this happens. - Keys issued by a key server and the model-discovery probe are unaffected.
See Credential protection for the same behavior on other daemons.
How is this guide?