Configuration is strict TOML: unknown keys are hard errors carrying the TOML position, so typos never silently pass. ka config set <key> <value> / ka config get <key> / ka config path read and write one scalar key (a set refreshes the ka.schema.json sidecar its #:schema header points at, so editors keep autocompleting); ka config schema emits the full JSON schema and ka config print the resolved result.
Lowest to highest; each textual layer overlays the last and set fields win:
built-in defaults
→ ~/.config/ka/ka.toml (user)
→ ~/.config/ka/profiles/<name>.toml (profile, selected with --profile <name>)
→ .ka/ka.toml (project, trust-gated)
→ extra --config files (repeatable, last wins)
→ environment (KA_MODEL, KA_MODE, plus one KA_<KEY> variable per key: __ spells the dot, so KA_TUI__MOUSE sets tui.mouse; unknown KA_* names are ignored)
→ CLI flags
Arrays merge across layers. Where order carries priority ([[rules]], [[model_pins]], [[search]], [fallback] models, project_doc_fallback_filenames), the more specific layer’s entries sort first: a project-layer deny is evaluated before a user-layer allow. The rest ([[hooks]], allow lists, [sandbox] allow_write, [[verify.lints]], [features], [[mcp]] by name) append with dedupe.
Project layers are loaded only after the trust gate accepts the directory (first use prompts; the decision is stored in ~/.local/state/ka/trust.json).
ka serve and ka acp run the same chain minus the CLI-flag layer (no CLI model/mode/feature flags on those surfaces), and only apply the project layer when the directory is already trusted: a server never prompts.
The project layer is anchored at the project root: the nearest .git ancestor of the launch directory (stopping at $HOME and the filesystem root; the launch directory itself if there is none). The whole project-scope .ka/ layer lives there (config, skills, rules, agents, commands, hooks, plus everything ka generates: plans, staged memories, always-allow saves), so sessions started in a subdirectory share one .ka.
Tool the rule applies to (bash, write, mcpserver__tool, …), or the special loop domain (below)
pattern
none
Glob on the call’s primary argument; omitted = every call
verdict
✓
allow | ask | deny
A rule with tool = "loop" governs what happens when a call repeats with identical arguments: allow never trips, ask asks at the third repeat, deny denies at three. Without a loop rule, the shipped behavior stands: identical calls auto-error at four.
Tool names auto-allowed without asking for the session; “always” answers append here (project layer)
profile
Activate a named [permissions.profiles.<name>] bundle
profiles.<name>
Named rule bundle: a [[rules]]-shaped rules list plus a one-level extends (inherits another profile); profile rules evaluate before [[rules]], more specific first
prompt_policy
"ask" (default) poses reviewable asks to the surface; "deny" auto-denies them, the stance for ka serve and CI
ka rules check <command> dry-runs your rules against a command line without running it.
"ask" (the normal gate, default) | "auto" (skip asks; deny-class verdicts and hardstops still apply) | "writes" (only tools advertised readOnlyHint = false ask)
tool_timeout_secs / output_limit
Per-server call timeout and output cap
oauth
true for OAuth against HTTP servers (dynamic client registration, CIMD, loopback callback, token cache with refresh in the data dir); oauth_client_id / oauth_scopes for pre-registered clients
bearer_token_env / headers_helper
Static bearer token env, or a command whose stdout builds the auth headers
Runtime feature toggles: what the model can use, decided at startup. Same spec grammar as the --disable/--enable flags and /features; changes made mid-session are recorded on the strand and restored on resume. Precedence: flags → resumed strand → [features] → defaults (see feature toggles).
Key
Default
Meaning
disable
[]
Specs disabled at startup: agents, skills, mcp, hooks, web, lsp, debug, or one item as mcp:<server>, skill:<name>, tool:<hand>, agent:<name>. Strict: an unknown spec is a hard startup error
allow
[]
Positive hand allowlist: unlisted hands are hidden from the model and rejected at admit time; disable still wins
A file whose free-form text replaces ka’s built-in identity sentence in the system prompt; re-read every turn, capped at 8 KiB (one fallback note per session if it cannot be read). Ignored in safe mode
identity_inline
none
Replace the identity sentence with this string inline (identity_file still wins); --system-prompt replaces the whole prompt for one run
"fs" = bash children write only cwd//tmp/XDG dirs, via bwrap/firejail/landlock/macOS seatbelt, fail-closed (no backend on Windows: "fs" refuses with a platform-named error)
allow_write
[]
Extra writable directories; a sandbox-expansion “always” grant appends here (project layer)
net_allow_domains
[]
With entries set, sandboxed bash children run behind a loopback CONNECT proxy: only these domains are reachable (wildcards, deny-first, IP literals explicit; each host resolved once and pinned; private/loopback targets refused unless explicitly allowlisted)
The aider-style auto-lint / auto-test loop: after a turn that edited files, the test command runs once (test, 15-minute cap) and a failure feeds the output back to the model for one automatic fix round. Lint rules run per edited file, first matching glob wins.
Key
Default
Meaning
test
none
Test command run in cwd after an editing turn, e.g. cargo test
[[verify.lints]] pattern
none
Glob on the edited path (or basename)
[[verify.lints]] command
✓
Lint command; {file} substitutes the edited file, e.g. rustfmt --check {file}
Theme name; TOML files in .ka/themes/ or ~/.config/ka/themes/ (Nocturne fallback); /theme previews live
title
true
Set the terminal title dynamically
status_line
built-in
Segments to show, in order: any of model / mode / session / effort / context / cost / tokens / cache / toggles / update
notify_on
built-in
Which turn events fire the notify command
notify_unfocused
false
Suppress notifications while the terminal has focus (terminal focus reporting)
mouse
"capture"
"native" opts out of mouse capture: plain drag selects/pastes with the terminal’s bindings, the wheel scrolls via alternate-scroll, click affordances fall back to their keys (Ctrl+M toggles at runtime and persists)
bell
true
Ring the terminal bell when a turn finishes or a permission ask appears
notify
none
Command run when a turn finishes, JSON {event, stop} on stdin, e.g. notify-send ka "turn done"
herdr
false
Report the agent’s idle/working/blocked state, its resume command, and exit to the Herdr pane hosting it (requires Herdr’s pane environment, so it is inert outside Herdr)
Action-id → chord remapping for the TUI. An unknown action or a chord already bound elsewhere is a hard config error; /help shows the effective bindings.
GitHub owner/name releases are fetched from (default jaltez/ka-harness; set it for self-hosted forks)
check
"startup" (default) or "off": the TUI checks availability once per 24 h (cached in ~/.local/state/ka/update/), never installs (ka update stays the only install path), and stays quiet offline; a newer release shows a ⤴ badge in the status bar plus one transcript line