Skip to main content
ChatCLI implements an enhanced permissions system that controls which operations the agent can execute automatically, which require approval, and which are always blocked. The system combines policies from multiple sources, tracks user denials, and maintains safety defaults that are immune to bypass.

Multi-Source Policy Resolution

Permission policies are loaded and merged from multiple sources, with defined priority:
A project policy can only tighten the user/global policy — it can never widen it. This changed in the security release:
  • A project file loads only from a trusted workspace (chatcli trust [dir]); in an untrusted folder it is ignored with a warning on stderr.
  • A project rule may add an ask or deny, but a project allow rule is ignored. A project file can never grant @coder exec (or anything else) that the user/global policy does not already allow — so a project allow does not override a user deny.
  • Choosing “Always allow” at a prompt writes the new allow rule to the global file (~/.chatcli/coder_policy.json), never to the project file.
  • Unsafe CLI flags (--allow-unsafe, --allow-sudo) are honored only when the human operator sets them in the environment (CHATCLI_CODER_ALLOW_UNSAFE, CHATCLI_AGENT_ALLOW_SUDO); the same flags emitted by the model are ignored.
See the security hardening upgrade guide for the complete workspace-trust and policy model.

Policy File Format

Available Actions


Denial Tracking

The Denial Tracker monitors when the user denies permission to prevent infinite prompts:
When the user denies the same tool 3 consecutive times, it is auto-blocked for the rest of the session.
The consecutive counter is reset when the user approves an execution of the tool.

Denial Tracker Configuration


Safety Immunity (Safety Bypass)

There are 40+ operation patterns that ALWAYS require user approval, regardless of any allow rule in the policy. These patterns protect against catastrophic errors:
  • rm -rf / rm -fr and variants
  • mkfs (format filesystem)
  • dd writing to devices (of=/dev/)
  • shred (secure deletion)
  • Writing to /etc/, /boot/, /sys/, /proc/
  • Output redirection to /etc/
  • sudo any command
  • su - (user switch)
  • chmod 777 (world-writable)
  • chmod +s (setuid/setgid)
  • chown root
  • insmod, rmmod, modprobe (kernel modules)
  • sysctl -w (sysctl write)
  • iptables -F (firewall flush)
  • systemctl stop/disable/mask
  • /dev/tcp/ (bash reverse shell)
  • nc -l / ncat -l (netcat in listen mode)
  • .ssh/ (SSH keys)
  • .gnupg/ (GPG keys)
  • .aws/credentials
  • .kube/config
  • DROP DATABASE/TABLE/SCHEMA
  • TRUNCATE TABLE
  • DELETE FROM ... WHERE 1=1
  • git push --force / git push -f
  • git reset --hard
  • git clean -f
  • kill -9, killall, pkill -9
  • shutdown, reboot, poweroff, halt
These patterns are immune to bypass: even if @coder exec * is configured as allow, commands matching these patterns always prompt for confirmation.

Read-Only Command Allowlist

ChatCLI maintains an allowlist of 90+ commands that are automatically approved because they are read-only:
ls, ll, cat, head, tail, less, more, wc, file, stat, du, df, find (without -delete/-exec), tree, realpath, readlink, basename, dirname, md5sum, sha256sum

Additional Protections

Even for allowlisted commands, certain flags and patterns are not auto-approved: Additionally, commands with pipes to dangerous targets (| rm, | sudo, | xargs, | sh) or output redirection (>, >>) are never auto-approved.

Decision Flow


Next Steps

Coder Security

Details on coder mode security.

Hooks System

PreToolUse hooks for additional guardrails.

Security

General ChatCLI security model.

Plugin @coder

Reference for the tools protected by the permissions system.