Skip to content
Komando

Settings and files

Change komando's settings, and see where it keeps its data and the key that opens it.

Change a setting

komando config show                          # every setting: KEY VALUE DEFAULT ALLOWED, and where the files are
komando config get parallel
komando config set parallel 20
komando config set default_timeout 10m
komando doctor                               # check the setup, the inventory and its security

Typed alone, komando config set asks for the setting, then its value.

config set says what changed:

parallel: 10 → 20

In JSON, config show gives each setting in data.keys.

Settings

KeyWhat it controlsValuesDefault
host_key_policywhat happens with a server komando has not seen beforeaccept-new (remember it and show its fingerprint), strict (refuse it until you run komando host trust), off (turns a check off)accept-new
default_userlogin name when a server has nonea login name; empty = the account komando runs as (from the system, not $USER)(empty)
default_timeouthow long a command may run on each servera duration above 0 (30s, 5m, 1h)5m
connect_timeouthow long to wait for a server to answera duration above 015s
parallelhow many servers to work on at once1 or more10
max_output_bytesoutput kept per stream per server1024 or more262144 (256 KiB)
auditkeep the audit logon, off (turns a check off)on
audit_sqlhow SQL text is kept in the audit logfull, hash (a SHA-256, so repeated queries can be matched), off (turns a check off)full
audit_syslogalso send each audit record to a central log server (a SIEM)udp://HOST:514, tcp://HOST:514, tls://HOST:6514, off (any change turns a check off)off
mask_personalwhere AI agents see email addresses, phone numbers, card numbers and IBANs hidden (see Personal data)protected, all, off (showing more turns a check off)protected
login_forhow long komando login SERVER keeps a server's login for later commands, an AI agent's tooa duration, such as 2h; an AI agent needs a person's yes to make it longer8h
approval_languagethe language of the approval window (see Safety)auto (Indonesian when your system language is Indonesian, else English), en, idauto
vpn_idleclose a VPN that komando started after this long with no command and no open connection through ita duration; 0 = never close. Making it longer, or 0, asks first (an AI agent needs a person's yes)30m

A change that turns a check off asks you first at your terminal (This turns off a komando safety check: ... Continue? [y/N]); an AI agent or a script adds --yes after a person agrees. See What needs a yes.

komando config set host_key_policy strict    # refuse servers you have not trusted yet
komando config set audit_sql hash            # keep SQL text out of the history
komando config set vpn_idle 0                # never close a VPN for being unused
komando config set audit_syslog tls://siem.example:6514   # also send the audit to a log server (komando asks first)

With audit_syslog set, each audit record also goes to the log server as it is written: syslog (RFC 5424, facility authpriv, program komando, message id audit, the record's JSON as the message) over UDP, TCP or TLS. The local log stays the record: when the log server does not answer, komando says so once on stderr and the command goes on. A copy on another machine keeps the history even if someone with your user account rewrites the local file.

Negative values are refused. Every change is recorded in komando audit with the old and the new value.

Most settings also have a flag for one run: --timeout, --connect-timeout, --parallel (-P), --max-output and --host-key-policy. Left out, the flag takes the setting: komando schema shows such a flag with "default": "0" (not given) and "default_from": "setting:default_timeout" (the setting it reads).

--host-key-policy takes accept-new, strict or off (in any case); anything else is a USAGE error, never a looser check. A flag looser than the setting host_key_policy (accept-new while the setting is strict, or off) needs the same yes as loosening the setting with config set: SAFETY_SETTING for an AI agent or a script without --yes. An agent's --dry-run connects with the setting instead.

Ask for a code before an agent's risky command

When an AI agent adds --yes, --allow-dangerous or --reveal, komando opens an "Allow once" window on your screen (see Safety). To need more than a click on Linux, BSD or Windows, turn on an approval code: the window then also asks for the 6-digit code from the authenticator app on your phone. On macOS the window asks for Touch ID, an Apple Watch or your login password after Allow once instead, and does not use the code. The code stays set for Linux, BSD and Windows when they use the same vault.

komando config approval-code             # shows a secret to add to your authenticator app
komando config approval-code --off       # turn it off again (komando asks first)

On a Linux or BSD desktop the code is required: another of your programs could press the window's buttons there, so without the code komando opens no window and the agent asks you to run the command yourself.

The code stops an agent that only works through komando or is held in a sandbox. A program that runs freely as you can read the vault and compute codes itself; see Limits.

Each code works once. komando remembers, in its sealed store, the last code it took; the same code, or an older one, does not allow a second window, even within the same 30 seconds. Wait for the next code your app shows. The code you type while turning it on counts as used too.

Only a person at a terminal can turn it on: the secret is shown once, there. Turning it off is a yes like any other safety change, so for an AI agent it needs the window and the code too. komando config show says whether it is on.

On Windows the window counts only a click or key press from a real mouse or keyboard: another program cannot press "Allow once" for you. This also means a screen reader or other tool that presses buttons for you cannot press it. On macOS a program that has Accessibility permission (System Settings, Privacy & Security) can click buttons in any window, this one included. So "Allow once" on macOS counts only after Touch ID, an Apple Watch or your login password, which no program can give for you, and a terminal that has that permission gets the window too. Only where that check cannot run does such a terminal get no window: the agent asks you to run the command yourself (see Safety).

Environment variables

VariableWhat it does
KOMANDO_HOMEwhere komando keeps its data (default ~/.komando, on Windows %USERPROFILE%\.komando). For an AI agent, every command with another folder stops, a dry run too (see Safety); if you keep the data elsewhere, make ~/.komando a link to it instead
KOMANDO_VAULT_PASSoptional: the vault's passphrase, instead of a key in the keychain or in store.key. A new vault takes it at your first secret; komando secret passphrase adds or changes it later (see below)
KOMANDO_KEYCHAINoff: komando uses no keychain, and a new vault keeps its key in store.key (CI runners, containers, test runs). On a Mac, a path to a keychain file to use instead of the login keychain, for the store's key and its change count. An AI agent cannot move the keychain: its off does not move the change count (the old-copy check), and its path is not used at all, so an agent's call keeps the key and the count in the login keychain. A store whose key is in your own keychain file is opened only by your commands, not an agent's. The other way round, a store an agent made keeps its key in the login keychain, so your commands with KOMANDO_KEYCHAIN set to a file do not find it there
KOMANDO_ACTORthe name recorded in komando audit (for example claude)
KOMANDO_OUTPUTdefault output: json or text
KOMANDO_AGENT, AI_AGENTmark the caller as an AI agent, for agents komando does not know by their own variables: output hides secrets and --yes, --allow-dangerous and --reveal need a person to allow them (see Safety). Any value counts, also 0 or empty
KOMANDO_NO_DIALOGany value: never show the approval window, as over SSH. An AI agent's --yes, --allow-dangerous or --reveal is then refused, and the agent asks you to run the command in your own terminal
CIa CI job (any value but false or 0): komando never asks anything, even on a terminal
KOMANDO_EXPERIMENTALturn on features still being tested, by name (ssm: komando's own AWS Session Manager client, see Servers)
KOMANDO_EXPERIMENTAL_VPNturn on VPN kinds still being tested (fortinet,pulse, or all; see VPNs)
KOMANDO_IPSEC_DEBUG1 writes the IPsec exchange to the VPN's log, to find why a server does not answer
KOMANDO_APPROVAL_DEBUGany value: each macOS approval window adds what it saw to approval-debug.log in ~/Library/Application Support/komando/run/ (mode 0600): each key it got (named only while the window's own buttons or script have the focus; in a text field only digit, letter, Tab, arrow or other), which control had the focus, handler errors, how it ended and how osascript exited, with its error output. The texts the window shows are replaced by [panel text]
NO_COLORturn off colors in status lines

Variables for password managers and cloud logins are listed in Servers.

komando takes KOMANDO_VAULT_PASS and the password managers' unlock variables (KOMANDO_KDBX_PASSWORD, KOMANDO_KDBX_KEYFILE, KOMANDO_BW_PASSWORD, KOMANDO_BW_CLIENT_SECRET, OP_CONNECT_TOKEN, VAULT_TOKEN, BAO_TOKEN) out of its environment when it starts: the programs it runs do not inherit them, and its background tunnels, VPN sessions and logins get them on their input instead.

Where komando keeps its data

Everything is in ~/.komando/ (on Windows %USERPROFILE%\.komando; change it with KOMANDO_HOME). Only you can read it:

  • macOS and Linux: the folder is mode 0700 and the files 0600.
  • Windows: file modes do nothing there, so komando gives the folder an access list of its own: your user and the system only, passed on to every file inside. komando doctor warns about any file someone else can open, and prints the icacls commands that fix it.

komando keeps your data sealed in one file:

FileContains
store.dbservers, conns, VPNs, keys, recipes, settings, secrets, remembered server fingerprints and the history of every action, each record sealed (AES-256-GCM). Only a random ID, the kind, a version and the time of a change can be read without the key
store.keythe store's key, only where there is no keychain (not there when the key is in the keychain or you use KOMANDO_VAULT_PASS)
store.madea note that this folder has had a store. komando writes it with the store and keeps it, so a lost store.db is noticed (below). It holds no secret
runtime.jsonthe jobs, tunnels, server logins and VPN sessions komando started (sealed with the runtime key, made from the store's key; it opens only with the mark store.db keeps for it, so an old copy put back reads as empty)
runtime.pidsonly the process IDs of komando's own background work, so it can tell whether they still run without opening the store
vpn/, tunnels/, login/VPN, tunnel and server login logs (one that nothing running uses is removed after a week), and the state of built-in VPN clients

Copy store.db only with komando running nothing, or a copy taken during a change may be broken. Back this folder up and keep it private.

komando reads only store.db. A folder that had a store but lost store.db stops with STATE_CORRUPT until you put store.db back from a backup. These show it had one: store.made, store.key or store.key.new, store.db-journal, runtime.pids, a sealed runtime.json, or a change count the keychain keeps for the folder. Every store leaves store.made, also one whose key is in the keychain (it has no store.key); a store made by an older komando gets it the next time komando opens it. The lock files do not count: a command that was refused leaves them too.

When the store's key is in the OS keychain, the keychain also remembers how many changes the store has had. An older copy of store.db put back (from a backup, or by someone) stops every command with STORE_OLD_COPY, because its servers, rules, secrets or pinned host keys may be old. komando doctor and dry runs still work, and only look: they write nothing into the old copy, and never start a new store where store.db is missing. If you restored the folder on purpose, run komando doctor --accept-old-copy in your own terminal.

With the key in store.key or a passphrase, the store is compared only when the keychain keeps a count for this folder: then it is a backup from before komando secret keychain. When the keychain cannot say whether it keeps one (locked, or no answer), komando reads such a store but changes nothing (KEYCHAIN_FAILED, or KEYCHAIN_SLOW): it may be that backup. Unlock the keychain and run it again. On a computer with no working keychain, a person sets KOMANDO_KEYCHAIN=off (an AI agent's off still asks the keychain). Where the keychain answers that it keeps no count, there is nothing to compare with, and komando doctor says so.

Keys made from the store's key

komando makes one key for each use from the store's key (HKDF-SHA256, one label per use). None is made from another, so a program that holds one of them can make none of the others:

KeySeals or signs
row keyeach record of store.db and the history
value keyeach secret's value, inside its record
runtime keyruntime.json
ticket keythe tickets komando's background commands check
policy keythe policy MAC over the safety rows (below)

The row key opens and seals the records. It opens no secret value, makes no ticket, and cannot change a safety row unseen.

Safety rows

Some of what store.db holds decides what komando lets an AI agent do, and komando asks a person before it loosens any of it. These safety rows carry a policy MAC: an HMAC-SHA256 under the policy key, kept beside them. Every read and write of the store checks it, and every change komando makes writes it again in the same step.

RecordWhat the MAC covers
serverprotected, forward_agent, proxy_command
connprotected, and the login program a person trusted on import (trusted_plugin, plugin_program, plugin_search_path)
VPNprotected, mfa, legacy_crypto, allow_pap
settingshost_key_policy, your deny rules (extra_deny_patterns), audit, audit_sql, audit_syslog, mask_personal, login_for, vpn_idle, approval_code and the last code step it took
pinned host keysall of it: the keys, and the login-ask logins made with them
revoked host keysall of it
trusted host CAsall of it
the settings row's sealed copyall of it (key mode, salt, scrypt cost)

Names, notes, addresses, groups, labels and display settings are not covered. An ssh-gate key's --network and --shell-access are not in store.db: they are on the key's line in ~/.ssh/authorized_keys. While extra_deny_patterns holds a rule, no --shell-access key opens a shell: komando does not see what is typed in one.

A safety row changed by something other than komando stops every command with POLICY_MAC_FAILED, which names the row. Find out what changed it, then put the folder back from a backup made before the change. Today every komando process makes the policy key from the store's key, so the MAC stops a program that holds only the row key; a program that can read the store's key (the keychain, store.key or the passphrase) can still make it.

A store made by an older komando gets its policy MAC once, the first time this komando opens it: every record is sealed again under the row key, in one step, while the store's lock is held. From then on a store without its MAC stops with POLICY_MAC_FAILED, and an older komando no longer opens it (STORE_NEWER): update every komando that uses the folder, and stop and start again the VPN sessions, tunnels and server logins started before the update.

Where the vault's key lives

The store's key is kept in one of three ways: in the OS keychain, in store.key, or made from a passphrase. komando doctor says which one is in use, and komando secret keychain and komando secret passphrase move and change it (see Secrets).

A new vault keeps its key in the OS keychain, so a copy of this folder does not open the vault:

  • macOS: the keychain, through /usr/bin/security.
  • Linux: the Secret Service, through secret-tool in /usr/bin, /bin or /usr/local/bin.
  • Windows: Credential Manager, as a credential for your user on this computer only (it does not roam to other computers).

komando never looks for these tools in PATH. It makes the key at your first secret, reads it back, and only then counts on it. A key the keychain already holds for this folder (from a vault you moved aside) is used, never replaced.

komando stores a new key only when the keychain says it holds nothing for this folder. On Linux a locked collection hides its keys from a lookup (and KeePassXC hides them from a search too), while secret-tool store asks to unlock the default collection and then overwrites an item there. So komando first asks the Secret Service, through gdbus or busctl from the same system folders, whether the default collection is unlocked, and only then checks that secret-tool search --all lists no item.

Where the keychain cannot keep the key or cannot tell, the key goes into store.key and komando doctor warns. That happens on:

  • a Linux server without secret-tool or a desktop session, a default collection that is locked, or no gdbus or busctl;
  • a Mac reached over SSH with its keychain locked, or a Mac user with no default keychain (a changed HOME, as under sudo -E, a sandbox or CI: komando asks security default-keychain first, so macOS shows no "Keychain Not Found" dialog);
  • a Windows computer without Credential Manager;
  • an item for this folder that stays locked, a container, or a keychain that does not answer within a few seconds.

Before komando makes a new store, it asks the keychain whether it still remembers a change count for this folder: then the folder had a store that was removed, and komando does not start an empty one in its place (STORE_OLD_COPY, as for an old copy above). When the keychain says it has no count, or there is no keychain at all (no secret-tool, no Credential Manager, KOMANDO_KEYCHAIN=off), the new store starts as above.

When the keychain cannot say (a keychain locked over SSH, no default keychain for this HOME, no desktop session for secret-tool, or no answer within a second):

  • A person or a script in a folder that never had a store (none of the files listed under Where komando keeps its data, store.made among them) gets the new store all the same. Its key goes into store.key, never the keychain, and komando prints one note on stderr: the store is guarded by its key file only. The command that made it goes on. Later commands only read while the keychain cannot be read; on a computer with no working keychain, set KOMANDO_KEYCHAIN=off.
  • An AI agent's command makes no store: STORE_OLD_COPY, or KEYCHAIN_SLOW when the keychain did not answer in time. Ask a person to run the command once in their own terminal.
  • In a folder that had a store (store.made, store.key or another of those files), nobody's command makes one, whoever runs it. Put store.db back from a backup. To start an empty store on purpose once the keychain answers, a person runs komando doctor --accept-old-copy (when the keychain remembers the store's count), or moves the folder aside.

A vault whose key is in store.key keeps it there until you move it: run komando secret keychain. It works before or after your first secret: the vault gets a new key as it moves, kept only in the keychain, so a copy of store.key made before (in a backup or a synced folder's history) opens nothing, not even the secrets you had then (--off moves the key back into store.key, and komando asks first). Only a person at a terminal can run it: an AI agent or a script gets NEEDS_PERSON, since the keychain may ask to be unlocked. On Linux it stops, and asks you to unlock the keychain, while the default collection is locked. It refuses when the keychain already holds another key for this folder (most likely the only key of a vault you moved aside): put that vault back, or delete the item from the keychain yourself once no vault needs it. A vault whose key is in the keychain opens only where that keychain is unlocked: on a Mac you reach over SSH, unlock it first (security unlock-keychain), or use a passphrase.

When the keychain does not answer within a few seconds, komando still reads the store but changes nothing: a command that would change something stops with KEYCHAIN_SLOW. Try again in a moment.

A passphrase instead of the keychain

KOMANDO_VAULT_PASS is the other way to protect the vault, mainly for a computer without a keychain (a Linux server without secret-tool). A new vault takes its mode at your first secret: with the variable set to 15 or more characters, it gets that passphrase. Setting or changing the variable on its own does nothing to a vault that exists already; komando secret passphrase does that. A passphrase vault needs the same passphrase in every shell and background process.

To change the passphrase, or to give a passphrase to a vault whose key is in store.key or the keychain, run komando secret passphrase in your terminal. It asks for the new passphrase twice (hidden, 15 or more characters) and re-encrypts every secret under it; if one cannot be decrypted, nothing changes. When KOMANDO_VAULT_PASS holds the new value already, it asks for the current one. The old store.key or keychain item is removed only after the new vault is saved and read back. Then put the new passphrase in KOMANDO_VAULT_PASS wherever you set it, and restart background tunnels and VPN sessions: they still hold the old key. --off goes back to a new random key in store.key (komando asks first). Only a person at a terminal can run it, never an AI agent. A KOMANDO_VAULT_PASS changed without it opens none of the secrets (nothing is lost: set the old value again); komando doctor says so.

To move to another computer, see Move to another computer: komando export (no passwords), or the whole folder once the vault has a passphrase.

Update komando

To update komando itself, see Install, update, remove.

Limits

  • The keychain keeps the key away from someone who copies this folder. It does not keep it away from other programs you run yourself, and that includes an AI agent with a shell:
    • macOS: komando reads the item through /usr/bin/security, so any program of your user can read it the same way, with no prompt. It could also lower the change count komando keeps there, and then put back an old copy of store.db without STORE_OLD_COPY. Only a signed komando that keeps its items for itself can close this.
    • Windows: Credential Manager gives the item to any program of your user.
    • Linux: while the keychain is unlocked, secret-tool gives the item to any program of your user.
  • komando's rules (masked secrets, the approval window, protected servers) hold for an AI agent that uses komando. A program that runs as your own user and ignores those rules can open the vault itself, whichever way the key is kept: it reads store.key, asks the keychain for the item as komando does, or reads KOMANDO_VAULT_PASS from the shell that started it. Only two things stop such a program: running it as another OS user (or in a container or virtual machine without your home folder and keychain), or the signed komando Mac app (not released yet), which keeps the key for itself.
  • One case komando cannot see when it stores a new key: an item in a KeePassXC database other than the default one, while that database is locked.

Troubleshooting

ErrorWhat it meansWhat to do
SAFETY_SETTING (exit 6)the change turns one of komando's checks offat your terminal komando asks first; an AI agent or a script adds --yes after a person agrees
STORE_OLD_COPY (exit 6)an older copy of store.db was put back, store.db is missing while the keychain remembers its change count, or the keychain cannot say whether it doesif you restored it on purpose, run komando doctor --accept-old-copy in your own terminal; otherwise find out who put it back
STATE_CORRUPT (exit 1)store.db is missing in a folder that had a store, or does not open with the key, or its settings row was changed outside komando; or runtime.json does not openfor store.db: put the folder back from a backup, then komando doctor --accept-old-copy in your own terminal; for runtime.json: move it away and connect again (it holds only running VPNs, logins, jobs and tunnels); for a changed settings row: komando doctor --reseal-meta in your own terminal (see Import)
POLICY_MAC_FAILED (exit 1)a safety row (a protection, deny rule, safety setting, pinned host key, host CA or the settings row's sealed copy) was changed outside komando, or the store lost its policy MAC; the message names the rowfind out what changed it, then put the folder back from a backup made before the change (see Safety rows)
KEYCHAIN_SLOW (exit 1)the keychain did not answer in time, so nothing was changedrun it again in a moment; komando doctor if it keeps happening
VAULT_LOCKED, VAULT_DECRYPT, VAULT_KEY (exit 1)the vault does not opensee Secrets
AUDIT_UNAVAILABLE (exit 1)the audit log cannot be written, so nothing runskomando doctor shows why

Source: docs/features/settings.md in sgnd/komando at commit b622784.