Lab Notes
Appendix

Appendix B: Environment Variables

The complete list of environment variables used by the lab: the name, the purpose, the default, and the component that reads it.

Purpose

This appendix is the canonical reference for the lab's environment variables. Every environment variable used by the lab is documented here. The variables are organized by component.

The environment variables are read at process startup and at every configuration reload. The Coordinator respects environment variables that are set in the shell; the framework's defaults apply otherwise.

Conventions

  • The variables are POSIX-style: uppercase letters and underscores.
  • The variables are namespaced by component: variables for the Coordinator start with COORDINATOR_; variables for the Scout start with SCOUT_; and so on.
  • Variables that contain secrets (API keys, tokens) must be set in a way that does not expose them in process listings or shell history. The recommended approach is a .env file that is not committed to version control.

Framework variables

These variables are read by the framework (the underlying runtime, not the lab's components).

VariableDefaultPurpose
OPENCLAW_CONFIG{workspace-root}/.openclaw/openclaw.jsonPath to the main configuration file.
OPENCLAW_LOG_LEVELINFOThe framework's log level.
OPENCLAW_LOG_FORMATjsonThe log format (json or text).
OPENCLAW_DISABLE_TELEMETRYfalseWhether to disable telemetry.

Coordinator variables

VariableDefaultPurpose
COORDINATOR_PORT18789The Coordinator's HTTP port.
COORDINATOR_HOST127.0.0.1The interface the Coordinator binds to.
COORDINATOR_MAX_CONCURRENT1The maximum number of concurrent requests.
COORDINATOR_SESSION_TIMEOUT_S3600The idle session timeout in seconds.
COORDINATOR_MEMORY_ENABLEDtrueWhether the memory layer is active.
COORDINATOR_SKILLS_ENABLEDtrueWhether the skill loader is active.
COORDINATOR_PROMPT_PATH{workspace-root}/prompts/coordinator.mdPath to the Coordinator's system prompt.
COORDINATOR_MODEL_PRIMARY(from config)Override for the primary model.

Scout variables

The Scout gateway hosts the Research Worker and the Media Agent.

VariableDefaultPurpose
SCOUT_PORT18790The Scout gateway's HTTP port.
SCOUT_HOST127.0.0.1The interface the Scout binds to.
SCOUT_LOG_DIR~/.openclaw-scout/logs/The Scout's log directory.
SCOUT_MODEL_PRIMARY(from config)Override for the Scout's primary model.
SCOUT_PROMPT_PATH{workspace-root-scout}/prompts/scout.mdPath to the Scout's system prompt.

Research Framework variables

These variables are read by the research framework.

VariableDefaultPurpose
SCOUTE_RESEARCH_ROOT/tmp/scoute/researchThe root directory for research runs.
SCOUTE_RUNS_DIR/tmp/scoute/runsThe directory where mission state and artifacts live.
SCOUTE_LOG_LEVELINFOThe framework's log level.
SCOUTE_PARALLEL_WORKERS3The maximum number of parallel phases.
SCOUTE_DEFAULT_RETRY2The default retry count for phases.
SCOUTE_MAX_BACKOFF_S30The maximum backoff between retries.
SCOUTE_INITIAL_BACKOFF_S1.0The initial backoff between retries.
SCOUTE_BACKOFF_FACTOR2.0The backoff multiplier.
SCOUTE_JOURNAL_MAX_BYTES52428800The maximum size of the request journal before rotation.
SCOUTE_TOKEN_POOL_PATH{framework-root}/config/token_pool_config.jsonPath to the token pool configuration.
SCOUTE_TOKEN_POOL_STATE_PATH{framework-root}/runtime/token_pool_state.jsonPath to the token pool state.
SCOUTE_JOURNAL_PATH{framework-root}/runtime/request_journal.jsonlPath to the request journal.
SCOUTE_RETENTION_DAYS30The default retention period in days.
SCOUTE_FAILED_RETENTION_DAYS90The retention period for failed missions.
SCOUTE_CANCELLED_RETENTION_DAYS7The retention period for cancelled missions.

Research adapter variables

These variables are read by the research adapters.

VariableDefaultPurpose
TAVILY_API_KEY(none)The Tavily API key. Required for Tavily adapter.
GOOGLE_API_KEY(none)The Google Custom Search API key. Required for Google adapter.
GOOGLE_SEARCH_CX(none)The Google Custom Search engine ID. Required for Google adapter.
PERPLEXITY_DEFAULT_MODEL(provider default)The default Perplexity model.
PERPLEXITY_MAX_RETRIES3The maximum number of retries for Perplexity requests.
ADAPTER_RATE_LIMIT_TAVILY60The per-minute rate limit for Tavily.
ADAPTER_RATE_LIMIT_DUCKDUCKGO30The per-minute rate limit for DuckDuckGo.
ADAPTER_RATE_LIMIT_GOOGLE100The per-minute rate limit for Google.
ADAPTER_RATE_LIMIT_YOUTUBE60The per-minute rate limit for YouTube.
ADAPTER_RATE_LIMIT_YT_DLP20The per-minute rate limit for yt-dlp.
ADAPTER_RATE_LIMIT_PERPLEXITY20The per-minute rate limit for Perplexity.

Coding sub-agent variables

These variables are read by the coding sub-agent (Codex, in the lab's case).

VariableDefaultPurpose
CODEX_HOME~/.codexThe Codex configuration directory.
CODEX_CONFIG~/.codex/config.tomlThe Codex configuration file.
CODEX_SANDBOX_MODEworkspace-writeThe default sandbox mode.
CODEX_TIMEOUT_S180The default per-invocation timeout.
CODEX_MAX_ITERATIONS3The default maximum iterations.

Web Agent variables

VariableDefaultPurpose
WEB_AGENT_BROWSER_PROFILEopenclawThe browser profile to use.
WEB_AGENT_HEADLESSfalseWhether the browser is headless.
WEB_AGENT_CDP_PORT18800The CDP port.
WEB_AGENT_SNAPSHOT_MODEariaThe default ref mode for snapshots.
WEB_AGENT_SCREENSHOT_QUALITY80The screenshot quality (0-100).

Media Agent variables

VariableDefaultPurpose
MEDIA_AGENT_CHROMECAST_ENABLEDtrueWhether the Chromecast backend is enabled.
MEDIA_AGENT_VLC_BINARYvlcThe path to the VLC binary.
MEDIA_AGENT_VLC_DEFAULT_INTFqtThe default VLC interface.
MEDIA_AGENT_SELECTION_DEFAULT(from config)The default backend when the rules do not resolve.
MEDIA_LAB_PORT8765The Media Lab Server's HTTP port.
MEDIA_LAB_OUTPUT_DIR~/.openclaw/media/outbound/The Media Lab Server's output directory.

Operational variables

These variables are read by the operational scripts.

VariableDefaultPurpose
OPS_BACKUP_DESTINATION(none)The backup destination.
OPS_AUDIT_REPORT_DIR{workspace-root}/security/audits/The audit report directory.
OPS_HEALTH_CHECK_INTERVAL_S86400The health check interval in seconds (default 1 day).
OPS_RETENTION_CHECK_INTERVAL_S86400The retention check interval.
OPS_LOG_ROTATION_INTERVAL_S86400The log rotation interval.

Path variables

These variables are paths used by the lab.

VariableDefaultPurpose
WORKSPACE_ROOT(none, required)The lab's workspace root.
RESEARCH_ROOTSCOUTE_RESEARCH_ROOTThe research framework's run root.
RUNS_DIRSCOUTE_RUNS_DIRThe research framework's runs directory.
FRAMEWORK_ROOT(none)The research framework's source root.
MEMORY_DIR{workspace-root}/memory/The daily log directory.
SKILLS_DIR{workspace-root}/.agents/skills/The skills directory.
TOOLS_DIR{workspace-root}/devclaw-tools/The tools directory.
SESSIONS_DIR{workspace-root}/sessions/The sessions directory.
AUDIT_DIR{workspace-root}/security/audits/The audit reports directory.
INCIDENTS_DIR{workspace-root}/security/incidents/The post-mortems directory.

How variables are loaded

The variables are loaded in the following order:

  1. Defaults. The framework's built-in defaults apply if no other source provides a value.
  2. Configuration files. The framework reads the configuration files and overrides the defaults.
  3. Environment variables. The framework reads the environment variables and overrides the configuration files.
  4. Command-line flags. The framework reads the command-line flags and overrides the environment variables.

The order is: defaults < config files < env vars < CLI flags. The most specific wins.

How variables are documented

The variables are documented in this page. When a new variable is added, this page is updated. When a variable is deprecated, this page is updated with the deprecation notice and the migration path.

Sensitive variables

Variables that contain secrets (API keys, tokens) must be handled with care:

  • They must not be logged.
  • They must not be written to the request journal.
  • They must not be committed to version control.
  • They must be stored in a .env file with owner-only permissions.

The framework's logging layer redacts known sensitive variables. The redaction is based on the variable name; variables whose name contains KEY, TOKEN, SECRET, or PASSWORD are redacted by default.

See also