Skip to main content
PathDocs

Environment Variables

1. Paths

VariableDefaultPurpose
DSH_HOME~/.dshHarness home directory (credentials, profiles, sessions, source)

DSH_HOME is the resolution entry point for the single-root Harness home. Priority (high → low): explicitly configured path → $DSH_HOME~/.dsh; every shell tool invocation also receives the resolved absolute DSH_HOME.

2. Behavior Control

VariableDefaultPurpose
DSH_TELEMETRY_DISABLEDunsetAny non-empty value (including 0/false) disables the telemetry line before startup
DSH_TELEMETRY_OTLP_URLhttps://harness-telemetry.deepseeksvc.com/v1/logsOverrides the telemetry OTLP reporting endpoint (for local development)
DSH_PERMISSION_MODEworkspace-writeProcess-level fallback for the permission preset: rewrites both the sandbox mode and the approval policy (danger-full-accessnever, otherwise → ask)
DSH_TOOLS_MODEunset (= native)Process-level switch for Code Mode; values native / code / both; any other value fails at startup
DSH_WEB_URLCanonical Web GUI address (injected at runtime, not a user setting)

DSH_PERMISSION_MODE and DSH_TOOLS_MODE are both process-level temporary switches: the former is a fallback to the composition default (see Permissions), the latter is a temporary Code Mode entry shared by Web/headless, to be removed once the Web UI takes over per session.

3. Provider Credentials

VariablePurpose
DEEPSEEK_API_KEYOfficial provider credential (can also be stored in ~/.dsh/.env)
DEEPSEEK_BASE_URLOfficial endpoint fallback (only effective for the trusted tier)
DEEPSEEK_SEARCH_BASE_URLWeb search endpoint override
Custom DP_* etc.apiKeyEnv reference for custom providers

The actual provider variables are governed by the apiKeyEnv you configure in llm-pi-ai.providers / llm-deepseek (see Multi-model).

4. Credential Files

FileContentPermissions
~/.dsh/.envDEEPSEEK_API_KEY=... and so on (environment-tier fallback)self-managed
~/.dsh/.credentials.yamlstructured credentials0600

ctx.credentials resolves these per operation, referencing secrets rather than storing values (see Credentials). Resolution priority: process environment → .credentials.yaml → cwd .env$DSH_HOME/.env; managed documents are never materialized into process.env, and both .env files are ordinary startup environment layers.

5. Runtime-Injected DSH_* (Not User Settings)

Each model shell invocation receives a set of trusted DSH_* environment variables collected by the host/registry — these are not variables you can set directly, but facts injected at runtime:

VariableValueInjected by
DSH_HOMEresolved absolute Harness homeregistry built-in
DSH_SHELL1registry built-in, marks managed subprocesses
DSH_SESSION_IDcurrent agent session idonly invocations with an agent
DSH_SESSION_JSONLabsolute path of the current session JSONLwhen the persistence seam is provided

DSH_WEB_URL is also injected the same way by the Web host's shell-env contributor. The whole DSH_* namespace is type-restricted and is a trusted overlay for the shell tool, separate from ordinary env; DSH_HOME/DSH_SHELL/DSH_SESSION_ID are registry-reserved built-in keys that list() does not enumerate.

6. Notes

  • Telemetry anonymous identity: exported records use $DSH_HOME/.anonymous-user-id (a random UUID) as the Resource anonymous user id; deleting this file resets the identity.

Next Steps