Skip to main content

Config

Struct Config 

Source
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: PathBuf

Workspace directory - computed from home, not serialized

§config_path: PathBuf

Path 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: f64

Default model temperature (0.0–2.0). Default: 0.7.

§provider_timeout_secs: u64

HTTP 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: ObservabilityConfig

Observability backend configuration ([observability]).

§autonomy: AutonomyConfig

Autonomy and security policy configuration ([autonomy]).

§trust: TrustConfig

Trust scoring and regression detection configuration ([trust]).

§security: SecurityConfig

Security subsystem configuration ([security]).

§backup: BackupConfig

Backup tool configuration ([backup]).

§data_retention: DataRetentionConfig

Data retention and purge configuration ([data_retention]).

§cloud_ops: CloudOpsConfig

Cloud transformation accelerator configuration ([cloud_ops]).

§conversational_ai: ConversationalAiConfig

Conversational 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: SecurityOpsConfig

Managed cybersecurity service configuration ([security_ops]).

§runtime: RuntimeConfig

Runtime adapter configuration ([runtime]). Controls native vs Docker execution.

§reliability: ReliabilityConfig

Reliability settings: retries, fallback providers, backoff ([reliability]).

§scheduler: SchedulerConfig

Scheduler configuration for periodic task execution ([scheduler]).

§agent: AgentConfig

Agent orchestration settings ([agent]).

§pacing: PacingConfig

Pacing controls for slow/local LLM workloads ([pacing]).

§skills: SkillsConfig

Skills loading and community repository behavior ([skills]).

§pipeline: PipelineConfig

Pipeline 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: QueryClassificationConfig

Automatic query classification — maps user messages to model hints.

§heartbeat: HeartbeatConfig

Heartbeat configuration for periodic health pings ([heartbeat]).

§cron: CronConfig

Cron job configuration ([cron]).

§channels_config: ChannelsConfig

Channel configurations: Telegram, Discord, Slack, etc. ([channels_config]).

§memory: MemoryConfig

Memory backend configuration: sqlite, markdown, embeddings ([memory]).

§storage: StorageConfig

Persistent storage provider configuration ([storage]).

§tunnel: TunnelConfig

Tunnel configuration for exposing the gateway publicly ([tunnel]).

§gateway: GatewayConfig

Gateway server configuration: host, port, pairing, rate limits ([gateway]).

§composio: ComposioConfig

Composio managed OAuth tools integration ([composio]).

§microsoft365: Microsoft365Config

Microsoft 365 Graph API integration ([microsoft365]).

§secrets: SecretsConfig

Secrets encryption configuration ([secrets]).

§browser: BrowserConfig

Browser automation configuration ([browser]).

§browser_delegate: BrowserDelegateConfig

Browser 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, default false) — 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, default 120) — 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: HttpRequestConfig

HTTP request tool configuration ([http_request]).

§multimodal: MultimodalConfig

Multimodal (image) handling configuration ([multimodal]).

§media_pipeline: MediaPipelineConfig

Automatic media understanding pipeline ([media_pipeline]).

§web_fetch: WebFetchConfig

Web fetch tool configuration ([web_fetch]).

§link_enricher: LinkEnricherConfig

Link enricher configuration ([link_enricher]).

§text_browser: TextBrowserConfig

Text browser tool configuration ([text_browser]).

§web_search: WebSearchConfig

Web search tool configuration ([web_search]).

§project_intel: ProjectIntelConfig

Project delivery intelligence configuration ([project_intel]).

§google_workspace: GoogleWorkspaceConfig

Google Workspace CLI (gws) tool configuration ([google_workspace]).

§proxy: ProxyConfig

Proxy configuration for outbound HTTP/HTTPS/SOCKS5 traffic ([proxy]).

§identity: IdentityConfig

Identity format configuration: OpenClaw or AIEOS ([identity]).

§cost: CostConfig

Cost tracking and budget enforcement configuration ([cost]).

§peripherals: PeripheralsConfig

Peripheral board configuration for hardware integration ([peripherals]).

§delegate: DelegateToolConfig

Delegate 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: HooksConfig

Hooks configuration (lifecycle hooks and built-in hook toggles).

§hardware: HardwareConfig

Hardware configuration (wizard-driven physical world setup).

§transcription: TranscriptionConfig

Voice transcription configuration (Whisper API via Groq).

§tts: TtsConfig

Text-to-Speech configuration ([tts]).

§mcp: McpConfig

External MCP server connections ([mcp]).

§kumiho: KumihoConfig

Kumiho 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: OperatorConfig

Operator 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: NodesConfig

Dynamic node discovery configuration ([nodes]).

§clawhub: ClawHubConfig

ClawHub skill marketplace integration ([clawhub]).

§workspace: WorkspaceConfig

Multi-client workspace isolation configuration ([workspace]).

§notion: NotionConfig

Notion integration configuration ([notion]).

§jira: JiraConfig

Jira integration configuration ([jira]).

§node_transport: NodeTransportConfig

Secure inter-node transport configuration ([node_transport]).

§linkedin: LinkedInConfig

LinkedIn integration configuration ([linkedin]).

§image_gen: ImageGenConfig

Standalone image generation tool configuration ([image_gen]).

§plugins: PluginsConfig

Plugin 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: VerifiableIntentConfig

Verifiable Intent (VI) credential verification and issuance ([verifiable_intent]).

§claude_code: ClaudeCodeConfig

Claude Code tool configuration ([claude_code]).

§claude_code_runner: ClaudeCodeRunnerConfig

Claude Code task runner with Slack progress and SSH session handoff ([claude_code_runner]).

§codex_cli: CodexCliConfig

Codex CLI tool configuration ([codex_cli]).

§gemini_cli: GeminiCliConfig

Gemini CLI tool configuration ([gemini_cli]).

§opencode_cli: OpenCodeCliConfig

OpenCode CLI tool configuration ([opencode_cli]).

§sop: SopConfig

Standard Operating Procedures engine configuration ([sop]).

§shell_tool: ShellToolConfig

Shell tool configuration ([shell_tool]).

Implementations§

Source§

impl Config

Source

pub async fn load_or_init() -> Result<Self>

Source

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.

Source

pub fn apply_env_overrides(&mut self)

Apply environment variable overrides to config

Source

pub async fn save(&self) -> Result<()>

Trait Implementations§

Source§

impl Clone for Config

Source§

fn clone(&self) -> Config

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Config

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Config

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for Config

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl JsonSchema for Config

Source§

fn schema_name() -> Cow<'static, str>

The name of the generated JSON Schema. Read more
Source§

fn schema_id() -> Cow<'static, str>

Returns a string that uniquely identifies the schema produced by this type. Read more
Source§

fn json_schema(generator: &mut SchemaGenerator) -> Schema

Generates a JSON Schema for this type. Read more
Source§

fn inline_schema() -> bool

Whether JSON Schemas generated for this type should be included directly in parent schemas, rather than being re-used where possible using the $ref keyword. Read more
Source§

impl Serialize for Config

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> Downcast for T
where T: Any,

Source§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert 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>

Convert 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)

Convert &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)

Convert &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
where T: Any + Send + Sync,

Source§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> FromRef<T> for T
where T: Clone,

Source§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,