Skip to main content

Configuration Reference

Use this page when you need the field-level public config contract for Loong. If you want the shared shape first, start with Configuration Patterns. loong validate-config performs structural and range diagnostics for provider/channels/tools/memory/feishu_integration fields. Some fields (notably parts of conversation and most acp runtime knobs) are accepted and then normalized at runtime rather than rejected by validate diagnostics.

Configuration File Location

The default configuration file is located at:
  • Linux/macOS: ~/.loong/config.toml
  • Windows: %USERPROFILE%\.loong\config.toml
Existing legacy ~/.loongclaw/ homes are still discovered when ~/.loong/ has not been created yet, but the public path and examples in this reference use the current ~/.loong/ home. You can specify a custom path with the --config flag:
loong validate-config --config /path/to/custom-config.toml

Configuration Sections

Validation Semantics

  • Validate-config diagnostics: Fields that produce explicit validation diagnostics (error/warn) during loong validate-config.
  • Runtime-normalized: Fields that are accepted at parse/validate time and clamped/defaulted by runtime resolution logic.
  • Provider/runtime-dependent: Fields whose effective behavior depends on provider capability or runtime routing.
Unless explicitly noted otherwise, Valid Values / Range means the expected operational domain for that field.

top-level

Top-level fields that coordinate provider profile selection and runtime state.
FieldTypeDefaultValid Values / Typical RangeDescription
active_providerstring?nullProvider profile ID ([a-zA-Z0-9_-]+)Explicit active provider profile selector (preferred in multi-provider setups)
last_providerstring?nullProvider profile ID ([a-zA-Z0-9_-]+)Last selected provider profile ID (runtime state)
Notes:
  • In single-provider setups, the legacy [provider] table can still be used.
  • In multi-provider setups, [providers.<profile_id>] plus active_provider is the canonical model.

provider

Configuration for the LLM provider.
FieldTypeDefaultValid Values / Typical RangeDescription
kindstring"openai"See Provider KindsProvider type
modelstring"auto"Model name / "auto"Model name or “auto” for discovery
base_urlstringProvider-specificURLAPI base URL
wire_apistring"chat_completions""chat_completions", "responses"Wire API format
chat_completions_pathstring"/v1/chat/completions"PathChat completions endpoint path
endpointstring?nullURLOverride complete endpoint URL
models_endpointstring?nullURLOverride models list endpoint
api_keystring?nullAPI key stringAPI key (use env reference preferred)
api_key_envstring?nullEnv var nameEnvironment variable containing API key
oauth_access_tokenstring?nullToken stringOAuth access token
oauth_access_token_envstring?nullEnv var nameEnvironment variable containing OAuth token
preferred_modelsstring[][]Model namesFallback models when discovery fails
reasoning_effortstring?null"none", "minimal", "low", "medium", "high", "xhigh"Reasoning effort level
headersmap{}HTTP headersCustom headers to add to requests
temperaturefloat0.20.0 - 2.0Sampling temperature
max_tokensinteger?null1+Maximum tokens per response
request_timeout_msinteger300001+Request timeout in milliseconds
retry_max_attemptsinteger30+Maximum retry attempts
retry_initial_backoff_msinteger3000+Initial retry backoff
retry_max_backoff_msinteger30001+Maximum retry backoff
model_catalog_cache_ttl_msinteger300000+Model catalog cache TTL
model_catalog_stale_if_error_msinteger1200000+Stale cache fallback TTL
model_catalog_cache_max_entriesinteger321+Max catalog cache entries
model_candidate_cooldown_msinteger3000000+Model failure cooldown
model_candidate_cooldown_max_msinteger36000000+Max model cooldown
model_candidate_cooldown_max_entriesinteger641+Max cooldown tracking entries
profile_cooldown_msinteger600000+Profile failure cooldown
profile_cooldown_max_msinteger36000000+Max profile cooldown
profile_auth_reject_disable_msinteger216000001+Auth rejection disable duration
profile_state_max_entriesinteger2561+Max profile state entries
profile_state_backendstring"file""file", "sqlite"Profile state storage backend
profile_state_sqlite_pathstring?nullPathSQLite database path
profile_health_modestring"provider_default""provider_default", "enforce", "observe_only"Health check mode
tool_schema_modestring"provider_default""provider_default", "disabled", "enabled_strict", "enabled_with_downgrade"Tool schema handling
reasoning_extra_body_modestring"provider_default""provider_default", "omit", "kimi_thinking"Reasoning extra body handling
tool_schema_disabled_model_hintsstring[][]Model namesModels that don’t support tool schema
tool_schema_strict_model_hintsstring[][]Model namesModels requiring strict tool schema
reasoning_extra_body_kimi_model_hintsstring[][]Model namesModels supporting Kimi thinking format
reasoning_extra_body_omit_model_hintsstring[][]Model namesModels that should omit reasoning extra body

Provider Kinds

KindAliasesDefault Base URL
openaiopenai_compatiblehttps://api.openai.com
anthropicanthropic_compatiblehttps://api.anthropic.com
kimimoonshot, moonshot_compatible, kimi_compatiblehttps://api.moonshot.cn
kimi_codingkimi_coding_compatiblehttps://api.kimi.com
deepseekdeepseek_compatiblehttps://api.deepseek.com
volcenginevolcengine_compatible, volcengine_custom, doubao, arkhttps://ark.cn-beijing.volces.com
volcengine_codingvolcengine_coding_compatiblehttps://ark.cn-beijing.volces.com/api/coding/v3
bailian_codingbailian_coding_compatiblehttps://coding.dashscope.aliyuncs.com/v1
byteplusbyteplus_compatiblehttps://ark.ap-southeast.bytepluses.com/api/v3
byteplus_codingbyteplus_coding_compatiblehttps://ark.ap-southeast.bytepluses.com/api/coding/v3
ollamaollama_compatiblehttp://127.0.0.1:11434
openrouteropenrouter_compatiblehttps://openrouter.ai
groqgroq_compatiblehttps://api.groq.com
fireworksfireworks_compatiblehttps://api.fireworks.ai
mistralmistral_compatiblehttps://api.mistral.ai
minimaxminimax_compatiblehttps://api.minimaxi.com
geminigoogle, google_gemini, gemini_compatiblehttps://generativelanguage.googleapis.com/v1beta/openai
bedrockaws_bedrock, aws-bedrockhttps://bedrock-runtime.<region>.amazonaws.com
coherecohere_compatiblehttps://api.cohere.ai/compatibility
cerebrascerebras_compatiblehttps://api.cerebras.ai
cloudflare_ai_gatewaycloudflare_ai, cloudflare-ai, cloudflare_ai_gateway, cloudflare-ai-gatewayhttps://gateway.ai.cloudflare.com/v1/<account_id>/<gateway_name>/openai/compat
novitanovita_compatiblehttps://api.novita.ai
nvidianvidia_compatible, nvidia_nimhttps://integrate.api.nvidia.com
llamacppllama.cpp, llama_cpphttp://127.0.0.1:8080
lm_studiolmstudio, lm-studiohttp://127.0.0.1:1234
perplexityperplexity_compatiblehttps://api.perplexity.ai
qianfanqianfan_compatible, baiduhttps://qianfan.baidubce.com
qwenqwen_compatible, dashscopehttps://dashscope.aliyuncs.com
sambanovasambanova_compatible, samba_novahttps://api.sambanova.ai
sglangsglang_compatiblehttp://127.0.0.1:30000
siliconflowsiliconflow_compatiblehttps://api.siliconflow.com
stepfunstepfun_compatiblehttps://api.stepfun.com
togethertogether_compatible, together_aihttps://api.together.xyz
venicevenice_compatiblehttps://api.venice.ai
vercel_ai_gatewayvercel_ai, vercel-ai, vercel_ai_gateway, vercel-ai-gatewayhttps://ai-gateway.vercel.sh/v1
xaixai_compatiblehttps://api.x.ai
zaizai_compatiblehttps://api.z.ai
zhipuzhipu_compatiblehttps://open.bigmodel.cn
vllmvllm_compatiblehttp://127.0.0.1:8000
customopenai_custom, custom_openaihttps://<openai-compatible-host>/v1

Example: OpenAI

[provider]
kind = "openai"
model = "gpt-4o"
api_key = "${OPENAI_API_KEY}"
temperature = 0.7
max_tokens = 4096

Example: Kimi

[provider]
kind = "kimi"
model = "kimi-k2-0725-preview"
api_key = "${MOONSHOT_API_KEY}"

Example: Local Ollama

[provider]
kind = "ollama"
model = "llama3.2"
base_url = "http://localhost:11434"

providers

Map of named provider profiles for multi-provider configurations.
FieldTypeDefaultValid ValuesDescription
[providers.<profile_id>]table--Provider profile configuration
default_for_kindbooleanfalsetrue, falseWhether this is the default for its provider kind
All fields from provider are available under each profile.

Example

[providers.openai]
default_for_kind = true
kind = "openai"
model = "gpt-4o"
api_key = "${OPENAI_API_KEY}"

[providers.kimi_pro]
kind = "kimi"
model = "kimi-k2-0725-preview"
api_key = "${MOONSHOT_API_KEY}"

tools

Configuration for tool execution and approval policies.
FieldTypeDefaultValid ValuesDescription
file_rootstring?Current directoryPathRoot directory for file operations
shell_allowstring[][]Command namesAllowed shell commands
shell_denystring[][]Command namesDenied shell commands
shell_default_modestring"deny""deny", "allow"Default for unknown commands
Notes:
  • tools includes strict numeric/domain diagnostics for browser/web/web_search/delegate child runtime limits.
  • shell_default_mode is documented with supported operational values ("deny", "allow").

tools.approval

FieldTypeDefaultValid ValuesDescription
modestring"disabled""disabled", "medium_balanced", "strict"Tool approval mode
approved_callsstring[][]Tool call patternsPre-approved tool calls
denied_callsstring[][]Tool call patternsDenied tool calls

tools.sessions

FieldTypeDefaultValid ValuesDescription
enabledbooleantruetrue, falseEnable session management tools
visibilitystring"children""self", "children"Session visibility
list_limitinteger1001+Maximum sessions in list
history_limitinteger2001+Maximum messages in history

tools.messages

FieldTypeDefaultValid ValuesDescription
enabledbooleanfalsetrue, falseEnable message management tools

tools.delegate

FieldTypeDefaultValid ValuesDescription
enabledbooleantruetrue, falseEnable delegate subagent tool
max_depthinteger11+Maximum delegation depth
max_active_childreninteger51+Maximum concurrent child delegates
timeout_secondsinteger601+Delegate timeout
child_tool_allowliststring[]["file.read", "file.write"]Tool namesTools allowed in children
allow_shell_in_childbooleanfalsetrue, falseAllow shell commands in children

tools.delegate.child_runtime.web

FieldTypeDefaultValid RangeDescription
allow_private_hostsboolean?nulltrue, falseAllow private network hosts
allowed_domainsstring[][]Domain namesAllowed domain list
blocked_domainsstring[][]Domain namesBlocked domain list
timeout_secondsinteger?null1 - 120Web fetch timeout override
max_bytesinteger?null1024 - 5242880Max response bytes override
max_redirectsinteger?null0 - 10Max redirects override

tools.delegate.child_runtime.browser

FieldTypeDefaultValid RangeDescription
max_sessionsinteger?null1 - 32Max browser sessions override
max_linksinteger?null1 - 200Max links per page override
max_text_charsinteger?null256 - 20000Max text extraction chars override

tools.browser

FieldTypeDefaultValid Range/ValuesDescription
enabledbooleantruetrue, falseEnable browser automation
max_sessionsinteger81 - 32Maximum concurrent browser sessions
max_linksinteger401 - 200Maximum links per page
max_text_charsinteger6000256 - 20000Maximum text extraction characters

tools.browser_companion

FieldTypeDefaultValid Range/ValuesDescription
enabledbooleanfalsetrue, falseEnable browser companion
commandstring?nullPathBrowser companion command path
expected_versionstring?nullVersion stringExpected companion version
timeout_secondsinteger301+Companion timeout (seconds)

tools.web

FieldTypeDefaultValid Range/ValuesDescription
enabledbooleantruetrue, falseEnable web fetch
allow_private_hostsbooleanfalsetrue, falseAllow private network access
allowed_domainsstring[][]Domain namesAllowed domain whitelist
blocked_domainsstring[][]Domain namesBlocked domain blacklist
max_bytesinteger10485761024 - 5242880Maximum response size (bytes)
timeout_secondsinteger151 - 120Request timeout
max_redirectsinteger30 - 10Maximum redirects to follow
FieldTypeDefaultValid Range/ValuesDescription
enabledbooleantruetrue, falseEnable web search
default_providerstring"duckduckgo""duckduckgo", "ddg", "brave", "tavily"Search provider
timeout_secondsinteger301 - 60Search timeout
max_resultsinteger51 - 10Maximum results
brave_api_keystring?nullAPI key stringBrave Search API key
tavily_api_keystring?nullAPI key stringTavily API key

Example

[tools]
shell_allow = ["git", "cargo", "npm"]
shell_default_mode = "deny"

[tools.approval]
mode = "medium_balanced"
approved_calls = ["tool:file_read"]

[tools.browser]
max_sessions = 8
max_links = 40

[tools.web_search]
default_provider = "brave"
brave_api_key = "${BRAVE_API_KEY}"

memory

Configuration for conversation memory and history management.
FieldTypeDefaultValid ValuesDescription
backendstring"sqlite""sqlite"Storage backend
profilestring"window_only""window_only", "window_plus_summary", "profile_plus_window"Memory mode profile
systemstring"builtin""builtin"Memory system implementation
fail_openbooleantruetrue, falseAllow fallback on memory errors
ingest_modestring"sync_minimal""sync_minimal", "async_background"Message ingestion mode
sqlite_pathstring~/.loong/memory.sqlite3PathSQLite database location
sliding_windowinteger121 - 128Turns to retain in window
summary_max_charsinteger1200256+ (effective floor)Summary character budget
profile_notestring?nullTextOptional profile description
Note: memory.summary_max_chars values below 256 are accepted but normalized to an effective minimum of 256 at runtime.

Memory Profiles

ProfileDescription
window_onlyRetain only recent messages in sliding window
window_plus_summaryWindow + compressed summary of older messages
profile_plus_windowUser profile + recent window

Example

[memory]
profile = "window_plus_summary"
sliding_window = 24
summary_max_chars = 2000
sqlite_path = "~/.loong/memory.sqlite3"

conversation

Configuration for conversation runtime behavior. Notes:
  • Several conversation fields are runtime-normalized (for example clamped thresholds and minimum floors) instead of emitting validate-config errors.
FieldTypeDefaultValid Range/ValuesDescription
context_enginestring?nullEngine IDContext engine ID
turn_middlewaresstring[][]Middleware IDsActive middleware chain
compact_enabledbooleantruetrue, falseEnable conversation compaction
compact_min_messagesinteger?null1+Messages threshold for compaction
compact_trigger_estimated_tokensinteger?null1+Token threshold for compaction
compact_fail_openbooleantruetrue, falseAllow fallback on compaction errors
hybrid_lane_enabledbooleantruetrue, falseEnable fast/safe lane routing
safe_lane_plan_execution_enabledbooleanfalsetrue, falseEnable plan-based execution
fast_lane_max_tool_steps_per_turninteger11+Max tool calls per fast lane turn
fast_lane_parallel_tool_execution_enabledbooleanfalsetrue, falseEnable parallel tool execution
fast_lane_parallel_tool_execution_max_in_flightinteger41+Max parallel tool calls
safe_lane_max_tool_steps_per_turninteger11+Max tool calls per safe lane turn
safe_lane_node_max_attemptsinteger21+Max retries per plan node
safe_lane_plan_max_wall_time_msinteger300001+Max plan execution time (ms)
safe_lane_verify_output_non_emptybooleantruetrue, falseRequire non-empty output
safe_lane_verify_min_output_charsinteger81+Minimum output length
safe_lane_verify_require_status_prefixbooleantruetrue, falseRequire status prefix
safe_lane_verify_adaptive_anchor_escalationbooleantruetrue, falseEnable adaptive escalation
safe_lane_verify_anchor_escalation_after_failuresinteger21+Escalation threshold
safe_lane_verify_anchor_escalation_min_matchesinteger11+Min anchor matches
safe_lane_emit_runtime_eventsbooleantruetrue, falseEmit runtime events
safe_lane_event_sample_everyinteger11+Event sampling rate
safe_lane_event_adaptive_samplingbooleantruetrue, falseAdaptive event sampling
safe_lane_event_adaptive_failure_thresholdinteger11+Failure threshold for sampling
safe_lane_verify_deny_markersstring[]See belowMarker stringsDeny markers for verification
safe_lane_replan_max_roundsinteger11+Max replan iterations
safe_lane_replan_max_node_attemptsinteger41+Max node attempts per replan
safe_lane_session_governor_enabledbooleantruetrue, falseEnable session governor
safe_lane_session_governor_window_turnsinteger961+Governor window size
safe_lane_session_governor_failed_final_status_thresholdinteger31+Failure threshold
safe_lane_session_governor_backpressure_failure_thresholdinteger11+Backpressure threshold
safe_lane_session_governor_trend_enabledbooleantruetrue, falseEnable trend analysis
safe_lane_session_governor_trend_min_samplesinteger41+Min samples for trend
safe_lane_session_governor_trend_ewma_alphafloat0.350.01 - 1.0EWMA smoothing factor
safe_lane_session_governor_trend_failure_ewma_thresholdfloat0.600.0 - 1.0Failure EWMA threshold
safe_lane_session_governor_trend_backpressure_ewma_thresholdfloat0.200.0 - 1.0Backpressure EWMA threshold
safe_lane_session_governor_recovery_success_streakinteger31+Success streak for recovery
safe_lane_session_governor_recovery_max_failure_ewmafloat0.250.0 - 1.0Max failure EWMA for recovery
safe_lane_session_governor_recovery_max_backpressure_ewmafloat0.100.0 - 1.0Max backpressure for recovery
safe_lane_session_governor_force_no_replanbooleantruetrue, falseForce no replan in recovery
safe_lane_session_governor_force_node_max_attemptsinteger11+Force node attempts in recovery
safe_lane_backpressure_guard_enabledbooleantruetrue, falseEnable backpressure guard
safe_lane_backpressure_max_total_attemptsinteger321+Max total attempts
safe_lane_backpressure_max_replansinteger81+Max replans
safe_lane_risk_thresholdinteger41+Risk assessment threshold
safe_lane_complexity_thresholdinteger61+Complexity threshold
fast_lane_max_input_charsinteger4001+Max input characters
tool_result_payload_summary_limit_charsinteger2048256 - 64000Tool result summary limit
safe_lane_health_truncation_warn_thresholdfloat0.300.0 - 1.0Truncation warning threshold
safe_lane_health_truncation_critical_thresholdfloat0.600.0 - 1.0Truncation critical threshold
safe_lane_health_verify_failure_warn_thresholdfloat0.400.0 - 1.0Verify failure warning threshold
safe_lane_health_replan_warn_thresholdfloat0.500.0 - 1.0Replan warning threshold
high_risk_keywordsstring[]See belowKeywordsHigh-risk keyword list
Note: conversation.tool_result_payload_summary_limit_chars is normalized to an effective runtime range of 256 to 64000.

conversation.turn_loop

FieldTypeDefaultValid RangeDescription
max_roundsinteger41+Maximum conversation rounds
max_tool_steps_per_roundinteger11+Max tool calls per round
max_repeated_tool_call_roundsinteger21+Max repeated tool calls
max_ping_pong_cyclesinteger21+Max ping-pong cycles
max_same_tool_failure_roundsinteger31+Max failures for same tool
max_followup_tool_payload_charsinteger80001+Max followup payload
max_followup_tool_payload_chars_totalinteger200001+Max total followup payload
max_discovery_followup_roundsinteger21+Max discovery rounds

Default Deny Markers

safe_lane_verify_deny_markers = [
  "tool_failure",
  "provider_error",
  "no_kernel_context",
  "tool_not_found"
]

Default High-Risk Keywords

high_risk_keywords = [
  "rm -rf",
  "drop table",
  "delete",
  "credential",
  "token",
  "secret",
  "prod",
  "production",
  "deploy",
  "payment",
  "wallet"
]

Example

[conversation]
compact_enabled = true
fast_lane_max_tool_steps_per_turn = 2
safe_lane_max_tool_steps_per_turn = 1

[conversation.turn_loop]
max_rounds = 6
max_tool_steps_per_round = 2

acp

Configuration for Agent Control Plane (ACP). Notes:
  • ACP identifiers are normalized and checked when dispatch/session logic resolves them.
  • Most ACP numeric controls are runtime-resolved (for example fallback to defaults when unset or non-positive) rather than validated as numeric-range diagnostics by validate-config.
FieldTypeDefaultValid ValuesDescription
enabledbooleanfalsetrue, falseEnable ACP
backendstring?nullBackend IDBackend implementation ID
default_agentstring?nullAgent IDDefault agent ID
allowed_agentsstring[][]Agent IDsAllowed agent IDs
max_concurrent_sessionsinteger?81+Max concurrent sessions
session_idle_ttl_msinteger?9000001+Session idle TTL (ms)
startup_timeout_msinteger?150001+Startup timeout (ms)
turn_timeout_msinteger?1200001+Turn timeout (ms)
queue_owner_ttl_msinteger?300001+Queue owner TTL (ms)
bindings_enabledbooleanfalsetrue, falseEnable bindings
emit_runtime_eventsbooleanfalsetrue, falseEmit runtime events
allow_mcp_server_injectionbooleanfalsetrue, falseAllow MCP server injection

acp.dispatch

FieldTypeDefaultValid ValuesDescription
enabledbooleantruetrue, falseEnable dispatch
conversation_routingstring"agent_prefixed_only""agent_prefixed_only", "all"Routing mode
allowed_channelsstring[][]Channel IDsAllowed channel IDs
allowed_account_idsstring[][]Account IDsAllowed account IDs
bootstrap_mcp_serversstring[][]Server namesAuto-start MCP servers
working_directorystring?nullPathDefault working directory
thread_routingstring"all""all", "thread_only", "root_only"Thread routing mode

acp.backends.acpx

FieldTypeDefaultValid ValuesDescription
commandstring?nullCommand pathBackend command
expected_versionstring?nullVersion stringExpected version
cwdstring?nullPathWorking directory
permission_modestring?nullPermission mode stringPermission mode
non_interactive_permissionsstring?nullPermissions stringNon-interactive permissions
strict_windows_cmd_wrapperboolean?nulltrue, falseStrict Windows wrapper
timeout_secondsfloat?null> 0Timeout (seconds)
queue_owner_ttl_secondsfloat?null>= 0Queue TTL (seconds)

acp.backends.acpx.mcp_servers

FieldTypeDefaultValid ValuesDescription
[acp.backends.acpx.mcp_servers.<name>]table--MCP server configuration
commandstringRequiredCommand pathServer command
argsstring[][]ArgumentsCommand arguments
envmap{}Key-value pairsEnvironment variables

Example

[acp]
enabled = true
backend = "acpx"
default_agent = "codex"
allowed_agents = ["codex", "custom"]

[acp.dispatch]
conversation_routing = "agent_prefixed_only"
allowed_channels = ["cli", "telegram"]

[acp.backends.acpx]
command = "acpx-server"

[acp.backends.acpx.mcp_servers.filesystem]
command = "npx"
args = ["-y", "@modelcontextprotocol/server-filesystem", "/home/user"]

external_skills

Configuration for external skill management.
FieldTypeDefaultValid ValuesDescription
enabledbooleanfalsetrue, falseEnable external skills
require_download_approvalbooleantruetrue, falseRequire approval for downloads
allowed_domainsstring[][]Domain namesAllowed download domains
blocked_domainsstring[][]Domain namesBlocked download domains
install_rootstring?nullPathCustom install directory
auto_expose_installedbooleanfalsetrue, falseAuto-expose installed skills

Example

[external_skills]
enabled = true
require_download_approval = true
allowed_domains = ["github.com", "gist.github.com"]

audit

Configuration for audit logging.
FieldTypeDefaultValid ValuesDescription
modestring"fanout""in_memory", "jsonl", "fanout"Audit mode
pathstring~/.loong/audit/events.jsonlPathLog file path
retain_in_memorybooleantruetrue, falseKeep events in memory

Audit Modes

ModeDescription
in_memoryEvents stored only in memory
jsonlEvents written to JSONL file
fanoutEvents sent to multiple sinks

Example

[audit]
mode = "jsonl"
path = "~/.loong/audit/events.jsonl"

channels

Configuration for input/output channels. Channel configuration uses top-level TOML tables such as [cli], [telegram], [feishu], and [matrix]; do not nest them under [channels.*].

cli

FieldTypeDefaultValid ValuesDescription
enabledbooleantruetrue, falseEnable CLI channel
system_promptstringDefault promptPrompt textSystem prompt template
prompt_pack_idstring?"loongclaw-core-v1"Pack IDPrompt pack ID
personalitystring?"calm_engineering""calm_engineering", "friendly_collab", "autonomous_executor"Personality preset
system_prompt_addendumstring?nullPrompt textAdditional prompt text
exit_commandsstring[]["/exit", "/quit"]CommandsCommands to exit chat

telegram

FieldTypeDefaultValid ValuesDescription
enabledbooleanfalsetrue, falseEnable Telegram bot
account_idstring?nullAccount IDBot account identifier
default_accountstring?nullAccount IDDefault account
bot_tokenstring?nullToken stringBot token (use env preferred)
bot_token_envstring?"TELEGRAM_BOT_TOKEN"Env var nameEnv var for bot token
base_urlstring"https://api.telegram.org"URLAPI base URL
polling_timeout_sinteger151+Polling timeout (seconds)
allowed_chat_idsinteger[][]Chat IDsAllowed chat IDs
acptable{}ACP config tableACP overrides for this channel
accountsmap{}Account ID -> account configPer-account overrides

telegram.accounts

FieldTypeDefaultValid ValuesDescription
enabledboolean?nulltrue, falseWhether account is enabled
account_idstring?nullAccount IDAccount identifier
bot_tokenstring?nullToken stringAccount bot token
bot_token_envstring?nullEnv var nameEnv var for token
base_urlstring?nullURLAPI base URL override
polling_timeout_sinteger?null1+Polling timeout override
allowed_chat_idsinteger[]?nullChat IDsAllowed chat IDs
acptable?null-ACP configuration

feishu

FieldTypeDefaultValid ValuesDescription
enabledbooleanfalsetrue, falseEnable Feishu bot
account_idstring?nullAccount IDApp account identifier
default_accountstring?nullAccount IDDefault account
app_idstring?nullApp IDApp ID
app_id_envstring?"FEISHU_APP_ID"Env var nameEnv var for app ID
app_secretstring?nullSecret stringApp secret
app_secret_envstring?"FEISHU_APP_SECRET"Env var nameEnv var for app secret
verification_tokenstring?nullToken stringVerification token
verification_token_envstring?"FEISHU_VERIFICATION_TOKEN"Env var nameEnv var for verification token
encrypt_keystring?nullKey stringEncryption key
encrypt_key_envstring?"FEISHU_ENCRYPT_KEY"Env var nameEnv var for encrypt key
domainstring"feishu""feishu", "lark"Domain
base_urlstring?nullURLAPI base URL override
modestring?null"webhook", "websocket"Serve mode
receive_id_typestring"chat_id"ID type stringReceive ID type
webhook_bindstring"127.0.0.1:8080"AddressWebhook bind address
webhook_pathstring"/feishu/events"PathWebhook path
allowed_chat_idsstring[][]Chat IDsAllowed chat IDs
ignore_bot_messagesbooleantruetrue, falseIgnore bot messages
acptable{}ACP config tableACP overrides for this channel
accountsmap{}Account ID -> account configPer-account overrides

feishu.accounts

FieldTypeDefaultValid ValuesDescription
enabledboolean?nulltrue, falseWhether account is enabled
account_idstring?nullAccount IDAccount identifier
app_idstring?nullApp IDApp ID
app_id_envstring?nullEnv var nameEnv var for app ID
app_secretstring?nullSecret stringApp secret
app_secret_envstring?nullEnv var nameEnv var for app secret
domainstring?null"feishu", "lark"Domain override
base_urlstring?nullURLBase URL override
modestring?null"webhook", "websocket"Serve mode
receive_id_typestring?nullID typeReceive ID type
webhook_bindstring?nullAddressWebhook bind override
webhook_pathstring?nullPathWebhook path override
verification_tokenstring?nullToken stringVerification token
verification_token_envstring?nullEnv var nameEnv var for token
encrypt_keystring?nullKey stringEncryption key
encrypt_key_envstring?nullEnv var nameEnv var for encrypt key
allowed_chat_idsstring[]?nullChat IDsAllowed chat IDs
ignore_bot_messagesboolean?nulltrue, falseIgnore bot messages override
acptable?null-ACP configuration

matrix

FieldTypeDefaultValid ValuesDescription
enabledbooleanfalsetrue, falseEnable Matrix bot
account_idstring?nullAccount IDAccount identifier
default_accountstring?nullAccount IDDefault account
user_idstring?nullUser IDMatrix user ID
access_tokenstring?nullToken stringAccess token
access_token_envstring?"MATRIX_ACCESS_TOKEN"Env var nameEnv var for token
base_urlstring?nullURLHomeserver URL
sync_timeout_sinteger301+Sync timeout (seconds)
allowed_room_idsstring[][]Room IDsAllowed room IDs
ignore_self_messagesbooleantruetrue, falseIgnore own messages
acptable{}-ACP configuration
accountsmap{}-Account configurations

matrix.accounts

FieldTypeDefaultValid ValuesDescription
enabledboolean?nulltrue, falseWhether account is enabled
account_idstring?nullAccount IDAccount identifier
user_idstring?nullUser IDMatrix user ID
access_tokenstring?nullToken stringAccess token
access_token_envstring?nullEnv var nameEnv var for token
base_urlstring?nullURLHomeserver URL
sync_timeout_sinteger?null1+Sync timeout override
allowed_room_idsstring[]?nullRoom IDsAllowed room IDs
ignore_self_messagesboolean?nulltrue, falseIgnore own messages override
acptable?null-ACP configuration

Example

[cli]
system_prompt = "You are a helpful assistant."
exit_commands = ["exit", "quit", "bye"]

[telegram]
enabled = true
bot_token_env = "TELEGRAM_BOT_TOKEN"
allowed_chat_ids = [123456789]

[feishu]
enabled = true
app_id_env = "FEISHU_APP_ID"
app_secret_env = "FEISHU_APP_SECRET"

feishu_integration

Configuration for Feishu OAuth integration.
FieldTypeDefaultValid RangeDescription
sqlite_pathstring~/.loong/feishu.sqlite3PathSQLite database path
oauth_state_ttl_sinteger60060 - 86400OAuth state TTL
request_timeout_sinteger203 - 120Request timeout
retry_max_attemptsinteger41 - 8Max retry attempts
retry_initial_backoff_msinteger2000 - 30000Initial backoff
retry_max_backoff_msinteger2000retry_initial_backoff_ms - 60000Max backoff
default_scopesstring[]See belowOAuth scopesDefault OAuth scopes

Default Scopes

default_scopes = [
  "offline_access",
  "docx:document:readonly",
  "im:message:readonly",
  "im:message.group_msg:readonly",
  "search:message",
  "calendar:calendar:readonly"
]

Complete Example Configurations

Minimal OpenAI Setup

[provider]
kind = "openai"
model = "gpt-4o"
api_key = "${OPENAI_API_KEY}"

Development Environment with Ollama

[provider]
kind = "ollama"
model = "llama3.2"
base_url = "http://localhost:11434"

[tools]
shell_allow = ["git", "cargo", "make"]
shell_default_mode = "deny"

[memory]
profile = "window_only"
sliding_window = 24

Multi-Provider Production Setup

active_provider = "openai_prod"

[providers.openai_prod]
default_for_kind = true
kind = "openai"
model = "gpt-4o"
api_key = "${OPENAI_API_KEY}"
request_timeout_ms = 90000

[providers.kimi_backup]
kind = "kimi"
model = "kimi-k2-0725-preview"
api_key = "${MOONSHOT_API_KEY}"

[tools]
shell_allow = ["git", "docker"]

[tools.approval]
mode = "strict"

[memory]
profile = "window_plus_summary"
sliding_window = 48

[conversation]
compact_enabled = true
hybrid_lane_enabled = true

Telegram Bot with ACP

[provider]
kind = "openai"
model = "gpt-4o-mini"
api_key = "${OPENAI_API_KEY}"

[telegram]
enabled = true
bot_token_env = "TELEGRAM_BOT_TOKEN"
allowed_chat_ids = [123456789, -1001234567890]

[acp]
enabled = true
backend = "acpx"
default_agent = "codex"
allowed_agents = ["codex"]

[acp.dispatch]
enabled = true
conversation_routing = "all"
allowed_channels = ["telegram"]

Validation

Validate your configuration:
# Validate default config
loong validate-config

# Validate specific config
loong validate-config --config /path/to/config.toml

# JSON output for programmatic use
loong validate-config --json

# Fail on any diagnostics (warnings or errors)
loong validate-config --fail-on-diagnostics

Common Validation Errors

ErrorCauseFix
config.env_pointer.dollar_prefixUsed $VAR instead of ${VAR} or VARRemove $ prefix from env pointer
config.numeric_rangeValue outside allowed rangeAdjust to valid range
config.channel_account.duplicate_idDuplicate normalized account IDUse unique account identifiers
config.unknown_search_providerInvalid web search providerUse duckduckgo (or ddg), brave, or tavily

Environment Variable References

For sensitive values, use environment variable references:
# Preferred forms
api_key = "${OPENAI_API_KEY}"
api_key_env = "OPENAI_API_KEY"

# Avoid (validation warning)
api_key_env = "$OPENAI_API_KEY"  # Don't use $ prefix
Common environment variables:
VariableUsed For
OPENAI_API_KEYOpenAI provider
MOONSHOT_API_KEYKimi provider
KIMI_CODING_API_KEYKimi Coding provider
DEEPSEEK_API_KEYDeepSeek provider
ANTHROPIC_API_KEYAnthropic provider
BRAVE_API_KEYBrave Search
TAVILY_API_KEYTavily Search
TELEGRAM_BOT_TOKENTelegram bot
FEISHU_APP_ID / FEISHU_APP_SECRETFeishu bot
MATRIX_ACCESS_TOKENMatrix bot