Permission rules and plan mode

Two features decide what the agent may do without asking you: permission rules (standing decisions) and plan mode (read first, act after you approve).

Permission rules

Rules are strings such as Bash(git status:*), Edit(src/**) or Read(.env). They live in three lists:

Precedence: deny, then ask, then allow. A tool call that matches no rule falls back to the normal approval behaviour of the active agent mode.

An allow rule only skips the prompt. It never overrides a deny rule or the platform's built-in blocklist of catastrophic commands.

Files

Scope File
Project <project>/.ccd/permissions.json
User (platform admins only) ~/.ccd/permissions.json
{
  "defaultMode": "default",
  "allow": ["Bash(git status:*)", "Bash(npm test)", "Edit(src/**)"],
  "deny":  ["Bash(rm -rf:*)", "Read(.env)", "Edit(.github/**)"],
  "ask":   ["Bash(git push:*)"]
}

Rule syntax

Tool or Tool(specifier). Tool names are not case sensitive for these aliases:

Name Covers
Bash the exec tool (shell commands)
Edit edit, edit_file, multi_edit, notebook_edit, apply_patch
Write write_file
Read read_file
* every tool

Edit and Write are separate: Edit(src/**) does not cover write_file, so list Write(src/**) as well if you want both. Any other name matches the tool with exactly that name.

Bash specifiers

Path specifiers (Edit, Write, Read)

Modes

defaultMode Effect
default Normal approval behaviour
acceptEdits Auto-approves file edits and writes
bypass Auto-approves everything that is not denied
plan No edits and no commands until a plan is approved

acceptEdits and bypass are honoured only from the user file. A repository's own permissions.json can add rules and can set plan, but cannot loosen itself, so a cloned repo cannot grant itself more freedom.

Manage rules and test them

In Hyper Agent, click "always allow" on an approval prompt to add the narrowest sensible rule (for example Bash(git diff:*)). Or use the API:

# read the merged view
curl -H "X-API-Key: $CCD_API_KEY" "$CCD_URL/api/agent/permissions?project=/path/to/project"

# ask what a call would do
curl -X POST -H "X-API-Key: $CCD_API_KEY" -H "Content-Type: application/json" \
  -d '{"project":"/path/to/project","tool":"exec","args":{"cmd":"git status"}}' \
  "$CCD_URL/api/agent/permissions/test"
# -> {"decision":"allow","rule":"Bash(git status:*)","reason":"allow rule Bash(git status:*)","mode":"default"}

Setting rules with PUT /api/agent/permissions takes {"scope":"project","project":"<path>","defaultMode":"default","allow":[],"deny":[],"ask":[]}. Platform-wide rules (scope: "user") are admin only.

Plan mode

Turn on Plan mode in the chat toolbar (or run ccd --permission-mode plan). While it is on:

  1. The agent explores read-only: it can read files, search, and run read-only shell commands (ls, cat, grep, find without -exec/-delete, git status, git log, git diff, git show and similar).
  2. Writes, installs, builds and deploys are locked. Anything with ;, &, >, <, backticks or $(...) in a shell command counts as not read-only.
  3. When it understands the task it calls exit_plan_mode with a markdown plan: steps, files, commands and how it will verify.
  4. You get Approve plan, Reject, or you can type changes. - Approve: tools unlock and the agent executes the plan as approved. - Reject: it stays read-only and asks what you want instead. - Changes: it revises the plan and asks again. Tools stay locked until you approve.

Plan mode is enforced on the server, not just requested from the model.

Runs with no one to click (for example an internal sub-task dispatch) cannot pause, so a plan there is auto-approved rather than deadlocking.

Plan mode from the CLI

ccd -p --permission-mode plan "add rate limiting to the login route"

In print mode the run stops at the proposal and prints the plan, so you can review it and then run the real task.