pub struct Config {Show 84 fields
pub workspace_dir: PathBuf,
pub config_path: PathBuf,
pub api_key: Option<String>,
pub api_url: Option<String>,
pub api_path: Option<String>,
pub default_provider: Option<String>,
pub default_model: Option<String>,
pub model_providers: HashMap<String, ModelProviderConfig>,
pub default_temperature: f64,
pub provider_timeout_secs: u64,
pub provider_max_tokens: Option<u32>,
pub extra_headers: HashMap<String, String>,
pub observability: ObservabilityConfig,
pub autonomy: AutonomyConfig,
pub trust: TrustConfig,
pub security: SecurityConfig,
pub backup: BackupConfig,
pub data_retention: DataRetentionConfig,
pub cloud_ops: CloudOpsConfig,
pub conversational_ai: ConversationalAiConfig,
pub security_ops: SecurityOpsConfig,
pub runtime: RuntimeConfig,
pub reliability: ReliabilityConfig,
pub scheduler: SchedulerConfig,
pub agent: AgentConfig,
pub pacing: PacingConfig,
pub skills: SkillsConfig,
pub pipeline: PipelineConfig,
pub model_routes: Vec<ModelRouteConfig>,
pub embedding_routes: Vec<EmbeddingRouteConfig>,
pub query_classification: QueryClassificationConfig,
pub heartbeat: HeartbeatConfig,
pub cron: CronConfig,
pub channels_config: ChannelsConfig,
pub memory: MemoryConfig,
pub storage: StorageConfig,
pub tunnel: TunnelConfig,
pub gateway: GatewayConfig,
pub composio: ComposioConfig,
pub microsoft365: Microsoft365Config,
pub secrets: SecretsConfig,
pub browser: BrowserConfig,
pub browser_delegate: BrowserDelegateConfig,
pub http_request: HttpRequestConfig,
pub multimodal: MultimodalConfig,
pub media_pipeline: MediaPipelineConfig,
pub web_fetch: WebFetchConfig,
pub link_enricher: LinkEnricherConfig,
pub text_browser: TextBrowserConfig,
pub web_search: WebSearchConfig,
pub project_intel: ProjectIntelConfig,
pub google_workspace: GoogleWorkspaceConfig,
pub proxy: ProxyConfig,
pub identity: IdentityConfig,
pub cost: CostConfig,
pub peripherals: PeripheralsConfig,
pub delegate: DelegateToolConfig,
pub agents: HashMap<String, DelegateAgentConfig>,
pub swarms: HashMap<String, SwarmConfig>,
pub hooks: HooksConfig,
pub hardware: HardwareConfig,
pub transcription: TranscriptionConfig,
pub tts: TtsConfig,
pub mcp: McpConfig,
pub kumiho: KumihoConfig,
pub operator: OperatorConfig,
pub nodes: NodesConfig,
pub clawhub: ClawHubConfig,
pub workspace: WorkspaceConfig,
pub notion: NotionConfig,
pub jira: JiraConfig,
pub node_transport: NodeTransportConfig,
pub linkedin: LinkedInConfig,
pub image_gen: ImageGenConfig,
pub plugins: PluginsConfig,
pub locale: Option<String>,
pub verifiable_intent: VerifiableIntentConfig,
pub claude_code: ClaudeCodeConfig,
pub claude_code_runner: ClaudeCodeRunnerConfig,
pub codex_cli: CodexCliConfig,
pub gemini_cli: GeminiCliConfig,
pub opencode_cli: OpenCodeCliConfig,
pub sop: SopConfig,
pub shell_tool: ShellToolConfig,
}Expand description
Top-level Construct configuration, loaded from config.toml.
Resolution order: CONSTRUCT_WORKSPACE env → active_workspace.toml marker → ~/.construct/config.toml.
Fields§
§workspace_dir: PathBufWorkspace directory - computed from home, not serialized
config_path: PathBufPath to config.toml - computed from home, not serialized
api_key: Option<String>API key for the selected provider. Overridden by CONSTRUCT_API_KEY or API_KEY env vars.
api_url: Option<String>Base URL override for provider API (e.g. “http://10.0.0.1:11434” for remote Ollama)
api_path: Option<String>Custom API path suffix for OpenAI-compatible / custom providers (e.g. “/v2/generate” instead of the default “/v1/chat/completions”).
default_provider: Option<String>Default provider ID or alias (e.g. "openrouter", "ollama", "anthropic"). Default: "openrouter".
default_model: Option<String>Default model routed through the selected provider (e.g. "anthropic/claude-sonnet-4-6").
model_providers: HashMap<String, ModelProviderConfig>Optional named provider profiles keyed by id (Codex app-server compatible layout).
default_temperature: f64Default model temperature (0.0–2.0). Default: 0.7.
provider_timeout_secs: u64HTTP request timeout in seconds for LLM provider API calls. Default: 120.
Increase for slower backends (e.g., llama.cpp on constrained hardware) that need more time processing large contexts.
provider_max_tokens: Option<u32>Maximum output tokens to include in LLM provider API requests.
When set, overrides each provider’s built-in default. This is especially important for OpenRouter where the platform default (65536) can cause 402 errors for models with lower output limits.
extra_headers: HashMap<String, String>Extra HTTP headers to include in LLM provider API requests.
Some providers require specific headers (e.g., User-Agent, HTTP-Referer,
X-Title) for request routing or policy enforcement. Headers defined here
augment (and override) the program’s default headers.
Can also be set via CONSTRUCT_EXTRA_HEADERS environment variable using
the format Key:Value,Key2:Value2. Env var headers override config file headers.
observability: ObservabilityConfigObservability backend configuration ([observability]).
autonomy: AutonomyConfigAutonomy and security policy configuration ([autonomy]).
trust: TrustConfigTrust scoring and regression detection configuration ([trust]).
security: SecurityConfigSecurity subsystem configuration ([security]).
backup: BackupConfigBackup tool configuration ([backup]).
data_retention: DataRetentionConfigData retention and purge configuration ([data_retention]).
cloud_ops: CloudOpsConfigCloud transformation accelerator configuration ([cloud_ops]).
conversational_ai: ConversationalAiConfigConversational AI agent builder configuration ([conversational_ai]).
Experimental / future feature — not yet wired into the agent runtime.
Omitted from generated config files when disabled (the default).
Existing configs that already contain this section will continue to
deserialize correctly thanks to #[serde(default)].
security_ops: SecurityOpsConfigManaged cybersecurity service configuration ([security_ops]).
runtime: RuntimeConfigRuntime adapter configuration ([runtime]). Controls native vs Docker execution.
reliability: ReliabilityConfigReliability settings: retries, fallback providers, backoff ([reliability]).
scheduler: SchedulerConfigScheduler configuration for periodic task execution ([scheduler]).
agent: AgentConfigAgent orchestration settings ([agent]).
pacing: PacingConfigPacing controls for slow/local LLM workloads ([pacing]).
skills: SkillsConfigSkills loading and community repository behavior ([skills]).
pipeline: PipelineConfigPipeline tool configuration ([pipeline]).
model_routes: Vec<ModelRouteConfig>Model routing rules — route hint:<name> to specific provider+model combos.
embedding_routes: Vec<EmbeddingRouteConfig>Embedding routing rules — route hint:<name> to specific provider+model combos.
query_classification: QueryClassificationConfigAutomatic query classification — maps user messages to model hints.
heartbeat: HeartbeatConfigHeartbeat configuration for periodic health pings ([heartbeat]).
cron: CronConfigCron job configuration ([cron]).
channels_config: ChannelsConfigChannel configurations: Telegram, Discord, Slack, etc. ([channels_config]).
memory: MemoryConfigMemory backend configuration: sqlite, markdown, embeddings ([memory]).
storage: StorageConfigPersistent storage provider configuration ([storage]).
tunnel: TunnelConfigTunnel configuration for exposing the gateway publicly ([tunnel]).
gateway: GatewayConfigGateway server configuration: host, port, pairing, rate limits ([gateway]).
composio: ComposioConfigComposio managed OAuth tools integration ([composio]).
microsoft365: Microsoft365ConfigMicrosoft 365 Graph API integration ([microsoft365]).
secrets: SecretsConfigSecrets encryption configuration ([secrets]).
browser: BrowserConfigBrowser automation configuration ([browser]).
browser_delegate: BrowserDelegateConfigBrowser delegation configuration ([browser_delegate]).
Delegates browser-based tasks to a browser-capable CLI subprocess (e.g.
Claude Code with claude-in-chrome MCP tools). Useful for interacting
with corporate web apps (Teams, Outlook, Jira, Confluence) that lack
direct API access. A persistent Chrome profile can be configured so SSO
sessions survive across invocations.
Fields:
enabled(bool, defaultfalse) — enable the browser delegation tool.cli_binary(String, default"claude") — CLI binary to spawn for browser tasks.chrome_profile_dir(String, default"") — Chrome user-data directory for persistent SSO sessions. When empty, a fresh profile is used each invocation.allowed_domains(Vec<String>, default[]) — allowlist of domains the browser may navigate to. Empty means all non-blocked domains are permitted.blocked_domains(Vec<String>, default[]) — denylist of domains. Blocked domains take precedence over allowed domains.task_timeout_secs(u64, default120) — per-task timeout in seconds.
Compatibility: additive and disabled by default; existing configs remain valid when omitted.
Rollback/migration: remove [browser_delegate] or keep enabled = false to disable.
http_request: HttpRequestConfigHTTP request tool configuration ([http_request]).
multimodal: MultimodalConfigMultimodal (image) handling configuration ([multimodal]).
media_pipeline: MediaPipelineConfigAutomatic media understanding pipeline ([media_pipeline]).
web_fetch: WebFetchConfigWeb fetch tool configuration ([web_fetch]).
link_enricher: LinkEnricherConfigLink enricher configuration ([link_enricher]).
text_browser: TextBrowserConfigText browser tool configuration ([text_browser]).
web_search: WebSearchConfigWeb search tool configuration ([web_search]).
project_intel: ProjectIntelConfigProject delivery intelligence configuration ([project_intel]).
google_workspace: GoogleWorkspaceConfigGoogle Workspace CLI (gws) tool configuration ([google_workspace]).
proxy: ProxyConfigProxy configuration for outbound HTTP/HTTPS/SOCKS5 traffic ([proxy]).
identity: IdentityConfigIdentity format configuration: OpenClaw or AIEOS ([identity]).
cost: CostConfigCost tracking and budget enforcement configuration ([cost]).
peripherals: PeripheralsConfigPeripheral board configuration for hardware integration ([peripherals]).
delegate: DelegateToolConfigDelegate tool global default configuration ([delegate]).
agents: HashMap<String, DelegateAgentConfig>Delegate agent configurations for multi-agent workflows.
swarms: HashMap<String, SwarmConfig>Swarm configurations for multi-agent orchestration.
hooks: HooksConfigHooks configuration (lifecycle hooks and built-in hook toggles).
hardware: HardwareConfigHardware configuration (wizard-driven physical world setup).
transcription: TranscriptionConfigVoice transcription configuration (Whisper API via Groq).
tts: TtsConfigText-to-Speech configuration ([tts]).
mcp: McpConfigExternal MCP server connections ([mcp]).
kumiho: KumihoConfigKumiho graph-memory integration ([kumiho]).
Automatically injects the Kumiho MCP server and session-bootstrap prompt into every non-internal agent. Disable only for testing or air-gapped deployments where Kumiho is not installed.
operator: OperatorConfigOperator multi-agent orchestration ([operator]).
Automatically injects the Operator MCP server and system prompt into every non-internal agent, enabling plan-delegate-monitor-synthesize workflows.
nodes: NodesConfigDynamic node discovery configuration ([nodes]).
clawhub: ClawHubConfigClawHub skill marketplace integration ([clawhub]).
workspace: WorkspaceConfigMulti-client workspace isolation configuration ([workspace]).
notion: NotionConfigNotion integration configuration ([notion]).
jira: JiraConfigJira integration configuration ([jira]).
node_transport: NodeTransportConfigSecure inter-node transport configuration ([node_transport]).
linkedin: LinkedInConfigLinkedIn integration configuration ([linkedin]).
image_gen: ImageGenConfigStandalone image generation tool configuration ([image_gen]).
plugins: PluginsConfigPlugin system configuration ([plugins]).
locale: Option<String>Locale for tool descriptions (e.g. "en", "zh-CN").
When set, tool descriptions shown in system prompts are loaded from
tool_descriptions/<locale>.toml. Falls back to English, then to
hardcoded descriptions.
If omitted or empty, the locale is auto-detected from CONSTRUCT_LOCALE,
LANG, or LC_ALL environment variables (defaulting to "en").
verifiable_intent: VerifiableIntentConfigVerifiable Intent (VI) credential verification and issuance ([verifiable_intent]).
claude_code: ClaudeCodeConfigClaude Code tool configuration ([claude_code]).
claude_code_runner: ClaudeCodeRunnerConfigClaude Code task runner with Slack progress and SSH session handoff ([claude_code_runner]).
codex_cli: CodexCliConfigCodex CLI tool configuration ([codex_cli]).
gemini_cli: GeminiCliConfigGemini CLI tool configuration ([gemini_cli]).
opencode_cli: OpenCodeCliConfigOpenCode CLI tool configuration ([opencode_cli]).
sop: SopConfigStandard Operating Procedures engine configuration ([sop]).
shell_tool: ShellToolConfigShell tool configuration ([shell_tool]).
Implementations§
Source§impl Config
impl Config
pub async fn load_or_init() -> Result<Self>
Sourcepub fn validate(&self) -> Result<()>
pub fn validate(&self) -> Result<()>
Validate configuration values that would cause runtime failures.
Called after TOML deserialization and env-override application to catch obviously invalid values early instead of failing at arbitrary runtime points.
Sourcepub fn apply_env_overrides(&mut self)
pub fn apply_env_overrides(&mut self)
Apply environment variable overrides to config
pub async fn save(&self) -> Result<()>
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Config
impl<'de> Deserialize<'de> for Config
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl JsonSchema for Config
impl JsonSchema for Config
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read moreAuto Trait Implementations§
impl Freeze for Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnsafeUnpin for Config
impl UnwindSafe for Config
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more