Skip to main content
Comis uses a single YAML file for configuration. If you used the setup wizard (comis init), it already created a working config. This guide explains what is in that file and how to customize it.
You don’t need to understand the technical details to use this feature. The configuration examples below are copy-paste ready.

Where config lives

When you set COMIS_CONFIG_PATHS, Comis reads config from that path instead of the default. You can point to multiple files using colon-separated paths (same convention as PATH):
Later files override values from earlier ones.

Minimal working config

This is a minimal agent definition. It still needs a usable credential, OAuth profile, or local provider:
The schema supplies defaults for the other sections. Logging defaults to debug; the gateway defaults to loopback port 4766; local state uses SQLite. Credentials are resolved through SecretManager, whose default writable backend is the encrypted store.

Required: Agent configuration

Required: You must configure at least one agent with a name, provider, and model.
Every agent needs three fields:
Store the credential with comis secrets set ANTHROPIC_API_KEY, or provide it through a protected environment variable.
Never store API keys, tokens, or passwords directly in config.yaml. Use the .env file or Secret Manager for credential management.
The gateway enables the web dashboard and API access. It is enabled by default, but you can customize its settings.
The tokens section is optional. Without it, the gateway accepts unauthenticated requests on localhost. Add a token when you expose the gateway to a network.
Channels connect your agent to messaging platforms like Telegram, Discord, and Slack.
Here is an example with Telegram — the simplest channel to configure:
Store TELEGRAM_BOT_TOKEN with comis secrets set TELEGRAM_BOT_TOKEN, or provide it through a protected environment variable, using the token from @BotFather.
Each platform has different settings. See the Channels section for step-by-step setup guides for all supported platforms.

Optional: Common settings

These settings have sensible defaults. Change them only when you need to.
tenantId and agent IDs provide logical routing and storage scope inside one trusted Comis deployment. They do not create separate processes, filesystems, daemon accounts, or host boundaries for mutually hostile tenants. Use separate deployments when you require process or host isolation.

Secrets and API keys

Comis resolves ${VAR_NAME} references through SecretManager. New wizard setups use security.storage: encrypted, place credential ciphertext in ~/.comis/secrets.db, and keep SECRETS_MASTER_KEY in the owner-readable ~/.comis/.env file. Back up that key separately; losing it makes the database unrecoverable. Plain environment variables and the file storage mode are explicit alternatives. They do not provide the encrypted store’s at-rest protection.
Per-agent secret access is unrestricted unless you configure a non-empty agents.<id>.secrets.allow list. An omitted or empty list means the agent’s scoped secret manager may resolve every secret available through the base manager; it does not mean “deny all.” Configure explicit glob patterns for least privilege:
Common static-key providers use these names. See Environment Variables for the complete catalog, aliases, and multi-value provider requirements. The wizard initializes encrypted storage automatically. For a manual setup, run comis secrets init, back up the generated master key, then add values with comis secrets set <NAME>. See Secrets Management.
Never store API keys, tokens, or passwords directly in config.yaml. Use the .env file or Secret Manager for credential management.

$include directive

Split your config into multiple files for organization:
The included file path is relative to the file that contains the $include directive. This is useful for separating channel credentials from the main config or sharing a base config across environments.

Validate your config

Check your config file for syntax errors and missing fields:
Expected output for a valid config:
If there are errors, you will see the specific field and issue:
To see the fully resolved config with all defaults filled in:

Context engine

The context engine manages what your agent sees each turn. The default mode is DAG. Most users do not need to change any context engine settings — the defaults work well.
~/.comis/config.yaml
The DAG mode (the dag engine version) is the default: version defaults to "dag" (set "pipeline" to opt into the simpler engine). Canonical messages and tool results remain recoverable, but the active model prompt is still token-budgeted. It keeps a verbatim fresh tail and represents older regions with selected raw steps or explicitly lossy summaries. The in-session ctx_* tools recover underlying detail on demand; they do not put the full canonical transcript into every provider call. See Compaction for details.
See Config Reference for the complete list of all 27 context engine fields.

Advanced configuration

The config schema supports 41 top-level sections. This guide covered the essential ones. The remaining sections control memory, security, routing, scheduling, monitoring, plugins, and more.
For the complete reference of all configuration sections, see Config YAML Reference.

Next steps

Verify Installation

Run diagnostic commands to confirm everything is working.

Connect a Channel

Step-by-step guides for Telegram, Discord, Slack, and more.

Security

Understand the security protections built into Comis.

Config Reference

Complete reference for all 41 configuration sections.