Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

zeph-config

Pure-data configuration types, TOML loader, environment variable overrides, and migration helpers for Zeph.

Extracted from zeph-core in epic #1973 (Phase 1a/1b). zeph-core re-exports all public types via pub use for backward compatibility.

Purpose

zeph-config owns every configuration struct and enum used across the workspace. It provides:

  • All TOML configuration types (Config, AgentConfig, LlmConfig, MemoryConfig, etc.)
  • TOML file loading with environment variable overrides (ZEPH_* prefixes)
  • Default value helpers and legacy-path detection
  • Config migration (--migrate-config) so existing configs can be upgraded without manual editing

No runtime logic lives in this crate — it is pure data plus serialization. Vault secret resolution is handled by zeph-vault and zeph-core.

Key Types

TypeDescription
ConfigRoot configuration struct, deserialized from config.toml
ResolvedSecretsResolved API keys and secrets after vault lookup
AgentConfigAgent loop settings: model, system prompt, context budget, compaction
LlmConfigProvider selection and provider-specific params
MemoryConfigSQLite path, Qdrant URL, semantic search settings, graph memory
SkillsConfigSkills directory, prompt mode, hot-reload
SecurityConfigTimeout, trust, sandbox, and content isolation configuration
VaultConfigVault backend selection (env or age) and file paths
ContentIsolationConfigSanitization pipeline settings (max size, spotlighting, injection detection)
ExperimentConfigAutonomous experiment engine settings
SubAgentConfigSubagent defaults: tool policy, memory scope, permission mode
TuiConfigTUI dashboard settings
AcpConfigACP server settings: transports, max sessions, idle timeout

Modules

ModuleContents
rootTop-level Config struct and ResolvedSecrets
agentAgentConfig, FocusConfig, SubAgentConfig, SubAgentLifecycleHooks
providersAll LLM provider configs — unified ProviderEntry list ([[llm.providers]])
memoryMemoryConfig, SemanticConfig, GraphConfig, CompressionConfig
featuresFeature-specific configs: DebugConfig, GatewayConfig, SchedulerConfig, VaultConfig
securitySecurityConfig, TimeoutConfig, TrustConfig
sanitizerContentIsolationConfig, PiiFilterConfig, ExfiltrationGuardConfig, QuarantineConfig
subagentHookDef, HookMatcher, HookType, MemoryScope, PermissionMode, ToolPolicy
uiAcpConfig, TuiConfig, AcpTransport
channelsTelegramConfig, DiscordConfig, SlackConfig, McpConfig, A2aServerConfig
loggingLoggingConfig, LogRotation
learningLearningConfig, DetectorMode
experimentExperimentConfig, ExperimentSchedule, OrchestrationConfig
loaderload_config() — reads TOML file and applies ZEPH_* env overrides
envEnvironment variable override logic
migrate--migrate-config migration steps
defaultsDefault path helpers and legacy path detection

Feature Flags

FeatureDefaultDescription
guardrailoffEnables GuardrailConfig, GuardrailAction, GuardrailFailStrategy
lsp-contextoffEnables LspConfig, DiagnosticsConfig, HoverConfig, DiagnosticSeverity
compression-guidelinesoffEnables compression failure strategy in MemoryConfig
experimentsoffEnables ExperimentConfig fields that require ordered-float
policy-enforceroffEnables policy enforcer configuration in SecurityConfig

Integration with zeph-core

zeph-core depends on zeph-config and re-exports all config types at the crate root:

#![allow(unused)]
fn main() {
// In your code, both of these resolve to the same type:
use zeph_config::Config;
use zeph_core::Config; // re-exported
}

The AppBuilder::from_env() bootstrap function calls zeph_config::loader::load_config() to read the TOML file, then passes the resulting Config to downstream subsystems.

Common Use Cases

Loading a configuration file

#![allow(unused)]
fn main() {
use zeph_config::loader::load_config;

let config = load_config(Some("config.toml"))?;
println!("Model: {}", config.llm.model);
}

Building a config for tests

#![allow(unused)]
fn main() {
use zeph_config::{Config, AgentConfig};

let config = Config {
    agent: AgentConfig {
        model: "qwen3:8b".into(),
        ..Default::default()
    },
    ..Default::default()
};
}

Accessing content isolation settings

#![allow(unused)]
fn main() {
use zeph_config::ContentIsolationConfig;

let iso = ContentIsolationConfig::default();
assert!(iso.enabled);
assert_eq!(iso.max_content_size, 65_536);
}

Source Code

crates/zeph-config/