You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
triage: an allow rule lets commands and writes run in --permission-mode read-only and plan mode #3412
USAGE.md:214 says read-only "does not allow workspace mutation, network-fetch/search tools, or arbitrary command execution." But an allow rule in the user's settings overrides this: if ~/.claw.json allows bash, a session started with --permission-mode read-only runs any bash command, with no prompt.
This matters for a common setup: a user keeps "allow": ["bash"] so bash does not prompt in normal work, then opens an unfamiliar repository with --permission-mode read-only to review it safely. Commands and writes still run.
Steps (temporary HOME; <work> is a git repository with an empty folder protected/):
claw --output-format json --permission-mode read-only "Use the bash tool to run exactly this command: touch <work>/protected/canary.txt"</dev/null
Refused, as expected: tool 'bash' requires danger-full-access permission; current mode is read-only.
Add an allow rule: {"permissions": {"defaultMode": "danger-full-access", "allow": ["bash", "REPL"]}}. Run the same command: it succeeds ("is_error":false), protected/canary.txt is created, no prompt.
Writes: with "allow": ["write_file", "edit_file"], write_file to <work>/protected/canary.txt also succeeds in read-only ("type": "create").
Plan mode, which is parsed as read-only (rust/crates/runtime/src/config.rs:2088): put {"permissions": {"defaultMode": "plan"}} in <work>/.claw/settings.local.json and keep the allow rule. The command runs; without the allow rule it is refused with current mode is read-only.
Cause: rust/crates/runtime/src/permissions.rs:312-316 returns Allow when an allow rule matches, before the mode is checked:
// The ladder, in one place. An `allow` rule is an explicit grant for// this tool and outranks the mode; otherwise the mode decides through// [`PermissionMode::covers`].if allow_rule.is_some() || current_mode.covers(required_mode){returnPermissionOutcome::Allow;
The comment shows the order is deliberate, but USAGE.md:214 does not mention this exception.
Safe next action
Fix docs: say in USAGE.md:214 (and where plan is described) that permissions.allow rules outrank read-only and plan mode. Or, with owner review, change the code: in read-only and plan, check the mode first, so allow rules only skip prompts and cannot lift the mode's limit.
Activity
Yeachan-Heo commentedon Nov 29, 2026
Status: Fix PR Created with Design Concern
PR #3413 implements the read-only ceiling fix but surfaces a design decision that needs owner input.
Confirmed Root Cause
✓ Verified: rust/crates/runtime/src/permissions.rs line 312-316 allows an allow rule to bypass permission mode entirely.
✓ Escalation Path: Untrusted Project-scope
.claw/settings.jsoncan shippermissions.allowrules (only hooks are stripped, not permissions).Fix Implemented
PR #3413 makes read-only a true ceiling:
Blocking Design Question
The fix reveals an ambiguity in the config parser:
"default","plan", and"read-only"all map to the same PermissionMode::ReadOnly.Problem: Users with
"defaultMode": "default"who rely on allow rules would experience silent breakage (tools suddenly denied).Three Options Needed Decision:
PR #3413 is ready to rebase once the 'default' alias mapping is decided.
See PR comment for full design discussion.