Skip to Content
CLIAdmin & policycmdop permissions

cmdop permissions

cmdop permissions manages the rules that gate remote-agent tool calls on this machine. Every rule is a plain string; the gate evaluates them against each incoming call and allows it, prompts you, or denies it.

cmdop permissions list cmdop permissions allow 'execute_command(git *)' cmdop permissions mode strict

Rules live in a config file under your user configuration directory (~/.config/cmdop/permissions.yaml on Linux; the platform equivalent elsewhere). A rule you add becomes live when the agent reloads or restarts; when the agent is not running, the file itself is the source of truth.

Rule grammar

A rule is a bare string naming a tool, optionally narrowed by a pattern in parentheses:

read_file execute_command(git *) connect(exec:prod-*) write_file(.env*)

* matches any run of characters, so execute_command(git *) covers every git invocation and connect(exec:prod-*) covers exec against any machine whose name starts with prod-.

Precedence

Deny beats ask beats allow. A deny rule is the strongest block you can write, so adding one is the reliable way to shut something off regardless of what else matches.

Underneath all of it sits a hardcoded floor — paths such as ~/.ssh/** and .env*, and commands such as rm -rf /. No rule and no mode can unblock the floor.

Add and remove rules

cmdop permissions allow read_file cmdop permissions allow 'connect(exec:prod-*)' --reason="trusted cluster" cmdop permissions ask 'execute_command(kubectl *)' cmdop permissions deny 'write_file(.env*)' cmdop permissions revoke 'execute_command(git *)'
CommandEffect
allow <rule>The matching call runs without prompting.
ask <rule>The matching call prompts you at call time.
deny <rule>The matching call is blocked outright.
revoke <rule>Removes the first rule whose raw form matches, whatever its action.

allow, ask, and deny each take an optional --reason note that is saved alongside the rule. For revoke, run cmdop permissions list first and pass the exact raw form it prints.

Modes

The mode decides what happens when no rule matches a call:

cmdop permissions mode cmdop permissions mode strict
ModeBehavior with no matching rule
defaultPrompt you in the terminal. The prompt denies the call if you do not answer within 60 seconds.
strictDeny everything not explicitly allowed.
bypassAllow everything except the hardcoded floor. Requires --token set to the bypass token stored in the permissions file.

Run cmdop permissions mode with no argument to print the current mode.

Audit the decisions

cmdop permissions audit cmdop permissions audit --tail 200 cmdop permissions audit --follow

The audit log records one line per decision — allow, deny, prompt-allowed, prompt-denied, prompt-timeout, or floor-deny — with the tool name, the target argument, the rule that matched, and timing. --tail <n> sets how many lines to print (default 50) and -f/--follow streams new ones.

Last updated on