Skip to content

Configuration

ka-agent.toml (default ~/.ka-agent/config.toml, or ~/.ka-agent/profiles/<name>/config.toml for a named profile; $KA_AGENT_HOME moves the whole tree, $KA_AGENT_CONFIG overrides) is strict TOML: unknown keys are hard errors. A $schema key is tolerated for editors. The schema lives in crates/ka-agent-core/src/config.rs; a fully commented copy ships in examples/config/ka-agent.toml, and a machine-readable JSON Schema for editors is committed at docs/schema/ka-agent.schema.json (ka-agent config schema --json-schema prints the same document; a drift test fails CI when a registered key is missing from it). Edit through ka-agent config set <key> <value> or ka-agent config edit: comments and key order survive, every write keeps the previous file one generation as <config>.bak, safe changes apply to the running agent live, the rest tells you to ka-agent restart.

Key Type Default Meaning
workspace path ~/.ka-agent/profiles/default/workspace The single workspace directory every engine runs in. ~ expands against $HOME.
model selector engine decides Default Ka model selector for new sessions.
fallback list of selectors none Models tried in order when the main one fails (outage, rate limit); at most 2. /status shows the chain.
mode string ask Permission mode: ask, accept_edits, allow or readonly; the old names guarded, free and plan still parse and normalize at load. Re-asserted by the worker after every attach. Under allow no sandbox is composed, so bash never raises the engine’s sandbox-grant ask.
timezone IANA name system zone Every reminder and cron time is interpreted here.
language en | es en The operator language: assistant replies and channel chrome follow it (a per-turn instruction riding the same context the timezone does).
approval_ttl_secs 1..=86400 900 Approval card TTL; expiry denies (fail closed).
turn_grace_secs 1..=600 10 Grace after /stop before abort escalates: SIGTERM, then SIGKILL.
worker_idle_timeout_secs seconds 900 Stop an engine worker after this much idle time to release it; the next message spawns a new one.
effort off | low | medium | high | max model default Reasoning effort sent to the engine for every turn. /effort [level] changes it for the running session; /new clears the override. model also takes a per-model suffix: vendor/model@high.
background_model selector main model Model for background turns: crons, the briefing, and ka-agent ask --background.
sandbox auto | fs | off auto OS sandbox for engine bash: auto uses the filesystem sandbox when a backend exists on the platform. Not composed at all when mode = "allow" or grants.full = true (see [grants]).
busy_messages steer | queue steer What a message that arrives mid-turn does: ride the running reply (delivered at the next tool-batch boundary), or queue durably for the next turn.
interrupts on | off on A bare short interrupt word (“stop”, “wait”) mid-turn aborts the cycle and makes the message the next turn (see sessions); off restores plain busy_messages behavior.
Key Default Meaning
enabled true The web control panel (ka-agent dashboard); set false to run headless.
port 8480 Listen port on 127.0.0.1.
bind 127.0.0.1 Listen IP (IPv6 literals work). A wildcard bind only behind TLS or a reverse proxy; doctor warns when the panel is bound beyond loopback (pairing codes travel over it).
public_url none Absolute http(s) base for login and pairing links (ka-agent setup web writes it); with an https URL the session cookie gains Secure.
api_token none A secret (ka-agent secret set web.api_token), not a plain key: when set, POST /api/ask and POST /api/notify on the panel accept Authorization: Bearer <token> for scripts; unset, both answer 404.
Key Default Meaning
digest_time 08:00 Local wall-clock time for the daily digest of /calendar add sources. Changing it applies live: existing digest crons are retimed to the new hour.
Key Meaning
quiet_hours Local time window ("22:00-07:00"): scheduled prompts, crons and the briefing that fall due inside it wait until it ends. Reminders and approvals are never held.
Key Meaning
provider Voice-note transcription: openai, groq, or local (an OpenAI-compatible Whisper server; set its base_url). Set up with ka-agent setup voice.
Key Meaning
provider Web search for the engine’s web_search tool: tavily, brave or bing (optional base_url). The key lives in the engine .env tier (TAVILY_API_KEY / BRAVE_API_KEY / BING_API_KEY); set up with ka-agent setup search.

External MCP servers (managed by ka-agent mcp add): name, plus exactly one of command + args (stdio) or url (streamable HTTP), with optional env and headers. secret:<name> values resolve from the secret store when the agent starts and never live in this file.

Key Meaning
auto_review Opt-in (true): the engine’s auto-review may auto-allow unmistakably safe exec calls, never deny.

Widens (or narrows) what the engine may do without an approval card, enforced between the engine layer and the __guard hook. ka agent’s own files stay protected in every mode (see approvals & safety).

Key Default Meaning
install false Install-class commands (sudo apt, npm -g, pip, cargo/go install, dpkg -i, pacman -S, nix-env -i) run unasked. With the default they are denied with the error naming this key.
full false Full access: the OS sandbox is off, installs are granted, deny paths are ignored, and bash and file writes are pre-approved. Self-protection stays.
advisory true Keep the one-line ⚠ full access warning in /status and doctor while full is on; false silences both without changing access.

Per-directory grants are [[grants.path]] entries: dir (absolute; duplicates are a config error) plus access, where always still reads as allow:

Access Meaning
allow The dir is writable without asking: it joins the sandbox’s allow_write, and __guard pre-approves write/edit inside it. Any number of granted dirs behaves identically.
ask The engine’s normal ask flow decides; identical to no entry.
deny Blocked in every mode, for bash (path-shaped tokens, redirects and path= values) and the file tools (write/edit always; read/grep too). The error names the entry.

An operator engine-layer deny rule outranks every grant: a hook pre-approve may only downgrade an ask, never bypass a deny. The engine’s catastrophic hardstops (fork bomb, rm -rf /, raw devices, curl | sh) still ask under every setting here.

Shadow-git checkpoints: a snapshot before every allowed write, restorable with /rewind.

Key Default Meaning
enabled true Snapshot the session workspace into the per-user shadow repository before every approved write.
keep_days 30 Rows and shadow repos this old are pruned by the retention pass (1..=3650; destructive: past the window the history is gone).
Key Default Meaning
extraction_min_turns 5 Recorded turns a session needs before memory_propose is allowed (the warm-up gate; 0..=1000, 0 = off). See memory.

The read-only research child (see scout).

Key Default Meaning
enabled false Offer kagent__scout to the model. Off by default; off removes the tool entirely.
max_concurrent 2 Scout children allowed to run at once (1..=8); the rest queue, then answer busy. They also count against runtime.max_workers.
timeout_secs 90 Per-child deadline (10..=119, kept under the __mcp relay’s 120 s read timeout).
max_summary_chars 6000 Cap on the summary a scout returns to its parent (500..=60000).

Attribution for commits the agent makes (set into the sanitized worker environment as GIT_AUTHOR_*/GIT_COMMITTER_*, per user). Unset keys keep today’s behavior.

Key Default Meaning
name ka-agent (<username>) Author and committer name for agent commits.
email <username>@ka-agent.local Author and committer email for agent commits.

The profile-wide engine baseline, subtractive, written in the engine’s own [features] disable grammar (tool:bash, mcp:github, …) and validated against it before any worker spawns. It applies to the admin’s toolset too; roles narrow it further (see [[role]] and roles).

Key Meaning
disable Engine feature specs removed from every worker this profile spawns (for example ["tool:bash", "mcp:github"]).

One entry per role: each linked identity acts through the user it binds to and that user’s role (see roles); admin is implicit and reserved as a name. Users, groups and quotas are store-side (the user CLI and the panel), not config.

Key Meaning
name [a-z0-9-]{1,32}, unique; admin is reserved.
mode The role’s default and ceiling: ask, accept_edits, allow or readonly; a looser /mode clamps to it, and the worker re-asserts it after a strand replay.
allow | disable Exactly one: exact engine hand names allowed per turn, or subtractive disable specs on top of [tools].
escalate Optional list of tools (same spec grammar as allow) whose asks always go to the admin queue, even in self-scope (see approvals).
workspace Optional; absolute or ~-relative. May not nest with the profile workspace, ka agent’s own tree, or another role’s workspace. Default <data>/users/<name>/workspace.
budget_daily_usd Optional role USD cap on the role’s own state; unset means the profile [budgets] apply, and a per-user quota overrides this.
commands The role’s chat command surface; help and status are always available, and update, keys, quit, persona, config stay admin-only whatever the list says. model is not admin-only: every caller’s picker is filtered to what their groups allow.
[[role.grants.path]] The only path grants a role session sees (same rules as [grants]: absolute, unique, allow/ask/deny); install, full and advisory are admin-only and refused on a role.
Key Default Meaning
backoff_start_ms 1000 First backoff after a worker crash.
backoff_max_ms 60000 Backoff ceiling.
crash_window_secs 600 Crash-loop window.
crash_max 5 Crashes inside the window that degrade the session (resume then needs /resume or /new).

The staged deadline for a turn that is open but silent (the engine is alive and emitting nothing), the wedge the error classes cannot see:

Key Default Meaning
silent_secs 180 Seconds of engine silence before one ⏳ still working notice goes out (0..=86400; 0 disables the notice). Any engine event resets the clock.
abort_secs 900 Seconds of engine silence before the turn is aborted exactly like /stop (0..=86400; 0 never aborts). When both stages are armed it must exceed silent_secs.

Both are hot-reload (the settings form carries them). The clock starts when the turn is claimed, and a pending approval gate is legitimate blocking that never triggers either stage.

Key Meaning
daily_usd Daily USD cap across sessions. Omit for none.
daily_tokens Daily token cap (input+output+cache); the only cap that binds for unpriced models. Omit for none.

Per-user caps live on the account (ka-agent user set <name> --quota), not in this file: a user quota overrides the role cap, which overrides [budgets]. See users & accounts.

Key Default Meaning
max_workers 8 Live engine workers at once (1..=64). Over the cap an idle worker is evicted (least-recently-active first); if every worker is mid-turn the message queues for a slot. Applies at restart. See sessions.
sandbox_engine false Wrap each worker in the engine bubblewrap profile (mount + PID namespace, network shared for provider egress). Off by default: the ADR-0003 spike measured 2.7x spawn time and +12% memory per engine.

Deletion windows for turn history and attachments; 0 keeps everything, which is the default. The audit chain is never pruned.

Key Default Meaning
turns_days 0 Delete turns (and their search rows) older than this many days (0..=3650). Applies live.
attachments_days 0 Delete attachment files older than this many days (0..=3650). Applies live.
Key Meaning
engine_layer Optional path to a Ka engine layer in ka’s own strict ka.toml format, validated with Config::parse_layer by the worker. config set also checks it at set time (readable, valid TOML) instead of failing on the next turn. See examples/config/engine.toml.
Key Meaning
enabled Turn the channel on.
token_secret Name of the bot token in the secret store (see below).
stream Stream replies as Bot API drafts while the turn runs (default true). Changing it takes effect at the next daemon restart.
api_base Bot API base URL; tests point this at a fake server.
allow_user_ids Deprecated. Migrates into the identity table at startup; link identities with ka-agent identity link instead.
Key Meaning
enabled Turn the channel on.
homeserver Required when enabled. Plain HTTP/1.1 base URL: a local homeserver or your TLS-terminating reverse proxy.
user_id The bot account (its own events are skipped).
token_secret Name of the access token in the secret store.

The workplace channel: Socket Mode (one outbound WebSocket, no public endpoint). See the Slack channel.

Key Meaning
enabled Turn the channel on.
app_token_secret Secret-store name of the app-level token (xapp-…, connections:write), used only to open the Socket Mode connection.
bot_token_secret Secret-store name of the bot token (xoxb-…) used for Web API calls.
teams Workspace ids allowed to talk to this daemon (T0123…); anything else is ignored with one audit row.
auto_provision Create a user (role channels.default_role) for an unknown sender in an allowed workspace.
api_base API base override; tests point this at a local fake.

The gateway bot: one outbound WebSocket, no public endpoint. See the Discord channel.

Key Meaning
enabled Turn the channel on.
bot_token_secret Secret-store name of the bot token.
guilds Guild ids allowed to talk to this daemon.
auto_provision Create a user (role channels.default_role) for an unknown sender in an allowed guild.
api_base API base override; tests point this at a local fake.

Policy shared by the workplace channels (Slack, Discord):

Key Default Meaning
shared_channel_role channel The role a shared-channel turn runs as: a per-channel account, never a person’s memory or grants. The built-in channel role is read-only and grants nothing.
default_role member The role an auto-provisioned workspace user gets.

Operator hooks (plan 2.7): shell commands the daemon runs when something happens. ka-agent hooks list shows them; ka-agent hooks test <event> runs the matching agent hooks against a synthetic envelope (JSON on stdin, KA_HOOK_EVENT and KA_HOOK_SUMMARY in the environment, workspace as cwd).

Key Meaning
on The event: an agent event (message_received, turn_finished, approval_requested, approval_settled, reminder_fired, cron_finished, session_paused, memory_proposed) or an engine event (pre_tool_use, post_tool_use, user_prompt_submit, session_start, session_end, stop, turn_end, pre_compact).
command sh -c <command> for agent events (on Windows, cmd /C); engine events follow the engine’s own hook contract.
tool Restrict an engine tool-call hook to this one tool name.
timeout_secs Agent-event timeout, 1 to 60 (default 10); engine events use the engine’s own 30 s ceiling.

Engine hooks run inside the engine; agent hooks run in the daemon and their failure is visible, never fatal.

Secrets never live in ka-agent.toml; the config names them.

  • Provider keys: ka-agent key set ANTHROPIC_API_KEY writes a 0600 entry in the engine’s .env tier under the data root: exactly what ka’s own key prompt would write.
  • Channel and connector tokens: ka-agent secret set <name> writes a 0600 file under <data>/secrets/, referenced by name from the config. The store also resolves $KA_AGENT_SECRET_<NAME> (name uppercased, dots become underscores) first, then <data>/secrets/<name>.

So telegram.bot_token resolves from $KA_AGENT_SECRET_TELEGRAM_BOT_TOKEN or <data>/secrets/telegram.bot_token.