This reference lists the environment variables most projects need when running KsADK locally or in a release pipeline. Use placeholders in committed files and put real values in local .env files or CI secrets.
The following variables belong to 0.8 managed Runtime and A2A data-plane
contracts. Variables marked “platform injected” are deployment inputs; users
must not put them in .env or commit them.
Hosted deployments can inject a shared policy through AGENTENGINE_MODEL_POLICY_JSON. Hermes, OpenClaw, and generic agents share one default semantics. In 0.6.6, model policy v1 defaults to glm-5.2 as the primary model, kimi-k2.7-code as the multimodal model, and deepseek-v4-pro as the fallback model. Explicit request fields and explicit environment-variable overrides (such as HERMES_DEFAULT_MODEL / OPENCLAW_FALLBACK_MODEL) still take precedence over policy defaults.
Fallback retry semantics: the conversation runtime automatically retries once with the fallback model on recoverable errors (timeout, rate limit, 5xx, model unavailable, permission/quota); 400 parameter errors, business errors, and tool errors are not swallowed.
Reasoning declaration (0.6.7): DEFAULT_MODEL_POLICY adds a reasoning: true declaration per model, and the catalog output exposes a reasoning field so the console can tell whether a model supports thinking.
Thinking-disable injection (0.6.7): when model_options.thinking is disabled (reasoning.effort=none, or thinking.type=disabled, or max_reasoning_tokens<=0), the runtime auto-injects enable_thinking=false and chat_template_kwargs.enable_thinking=false into extra_body (DeepSeek-style compatibility) and filters reasoning output items from the stream.
Optional public IAM endpoint override; defaults to iam.api.ksyun.com when unset
KSYUN_IAM_INTRANET_URL
Optional platform-provided IAM intranet endpoint override; normally unset in public environments
IAM_INTRANET_URL
Compatibility alias for KSYUN_IAM_INTRANET_URL
Set KSYUN_IAM_INTRANET_URL or IAM_INTRANET_URL only when a platform
operator supplies an approved intranet endpoint. Do not put that address in
project files, documentation examples, or Agent manifests.
PostgreSQL session backend connect timeout in seconds, default 5; on failure raises SessionBackendUnavailable and server returns 503 instead of 500 (0.6.7)
digest of the actual Runtime capability matrix; admission rejects an adapter mismatch
AGENT_BUNDLE_DIGEST
immutable Agent Bundle identity used by owner and recovery evidence
PostgreSQL is not the default dependency
A single-replica hosted Agent that does not need cross-Pod recovery can use
memory with AGENT_KERNEL_DURABILITY_TIER=ephemeral. Choose postgres only
for a durable Inbox, cross-Pod takeover, or high availability; a missing
AGENT_KERNEL_STORE_DSN then fails startup.
checkpoint backend: local / sqlite / memory / postgres; default local (0.6.7)
KSADK_CHECKPOINT_PATH
local SQLite checkpoint path, default .agentengine/ui/checkpoints.sqlite (0.6.7)
KSADK_LANGGRAPH_CHECKPOINT_DSN
LangGraph PostgreSQL checkpoint DSN; required when backend is postgres (0.6.7)
Local agentengine web defaults to local session backend and SQLite LangGraph checkpoints, reducing the local resume path's dependency on PostgreSQL (0.6.7).
image registry username; required for enterprise KCR and third-party registries (sensitive)
KCR_PASSWORD
image registry password; required for enterprise KCR and third-party registries (sensitive)
Personal KCR (*.kce.ksyun.com) allows KSYUN_ACCOUNT_ID to fall back as the username; enterprise KCR (*.ksyunkcr.com) and third-party registries must set KCR_USERNAME / KCR_PASSWORD explicitly, to avoid wrongly using the cloud account id as an enterprise image username (0.6.5).
agentengine deploy and agentengine launch support --env KEY=VALUE (repeatable) and --env-file for runtime environment variables; explicit env goes into the deploy payload env_vars. Real .env / .env.local files are excluded from Code, Container, and MCP build contexts; only .env.example / .env.sample / .env.template template files are kept (0.6.5).
published @kingsoftcloud/ksadk-web npm version used by make sync-ksadk-web-static; the 0.8.4 default is 0.3.7. Publish and verify a new version before using it in a wheel build.
KSADK_WEB_PACKAGE
npm package name used for local UI static sync; default @kingsoftcloud/ksadk-web
KSADK_WEB_TARBALL_NAME
saved filename when KSADK_WEB_RELEASE_URL is set; npm pack mode uses the real tarball filename returned by npm
KSADK_WEB_RELEASE_URL
optional fallback; when set, skips npm pack and downloads from this tarball URL
KSADK_WEB_CACHE_DIR
KsADK Web package extraction cache directory; default .cache/ksadk-web
make build / make build-wheel automatically run sync-ksadk-web-static; no manual sync needed.
setup_tracing() auto-detects CLOUD_MONITOR_OTLP_* variables and builds a CloudMonitor OTLP exporter writing in parallel with the primary Langfuse OTLP (standard OTEL_EXPORTER_OTLP_*). A single span enters both backends with the same trace_id and span_id. Managed Agents created from either the CLI or console receive both routes by default; use --no-observability, or turn observability off in the console, to disable them explicitly. The Langfuse CallbackHandler path has been removed.
Variable
Purpose
CLOUD_MONITOR_APP_KEY
Deprecated transition fallback; used as Ksc-Appkey only when both CLOUD_MONITOR_OTLP_TRACES_HEADERS and CLOUD_MONITOR_OTLP_HEADERS are entirely absent (sensitive)
CLOUD_MONITOR_OTLP_ENDPOINT
CloudMonitor generic OTLP HTTP endpoint; derives /v1/traces when no traces endpoint is set
CLOUD_MONITOR_OTLP_PROTOCOL
CloudMonitor generic OTLP protocol; currently supports http/protobuf
CLOUD_MONITOR_OTLP_HEADERS
CloudMonitor OTLP extra headers, comma-separated and RFC 3986 encoded (sensitive)
CLOUD_MONITOR_OTLP_TRACES_ENDPOINT
CloudMonitor traces-specific endpoint; takes precedence over the generic endpoint
CLOUD_MONITOR_OTLP_TRACES_HEADERS
CloudMonitor traces-specific headers; take precedence over generic headers and fail closed when present without Ksc-Appkey (sensitive)
CLOUD_MONITOR_OTLP_TRACES_PROTOCOL
CloudMonitor traces-specific protocol; takes precedence over the generic protocol
When one backend fails the other still works: primary failure keeps the secondary, secondary failure keeps the primary, Agent business is not blocked.