Permission policy DSL (richer than confirm_cmd boolean) #9

Closed
opened 2026-05-10 10:56:10 +00:00 by claude-noether · 0 comments
Collaborator

Inspired by Claude Code's permission modes (auto-allow / prompt / deny per tool/pattern).

What: Replace config.shell.confirm_cmd = true|false with a small rule list:

permissions = {
    allow   = {"^ls\\b", "^cat \\b", "^git status", "%.test$"},
    confirm = {"^rm \\b", "^git push", "^docker ", "^sudo "},
    deny    = {"^ssh root@", "^curl http[^s]"},
}

First match wins; default = confirm. Patterns are Lua patterns (or regex if we vendor one).

Why: Today confirm_cmd=true interrupts every harmless ls. The bool is too coarse — once Norris mode (Phase 3) lands, the user wants to trust read-only ops while still gating writes/network.

Where it lands: Phase 3 or 4. Touches safety.lua + executor.lua + config.lua schema.

Source: https://code.claude.com/docs/en/overview (permission modes; mentioned implicitly throughout)

Inspired by Claude Code's permission modes (auto-allow / prompt / deny per tool/pattern). **What:** Replace `config.shell.confirm_cmd = true|false` with a small rule list: ```lua permissions = { allow = {"^ls\\b", "^cat \\b", "^git status", "%.test$"}, confirm = {"^rm \\b", "^git push", "^docker ", "^sudo "}, deny = {"^ssh root@", "^curl http[^s]"}, } ``` First match wins; default = `confirm`. Patterns are Lua patterns (or regex if we vendor one). **Why:** Today `confirm_cmd=true` interrupts every harmless `ls`. The bool is too coarse — once Norris mode (Phase 3) lands, the user wants to trust read-only ops while still gating writes/network. **Where it lands:** Phase 3 or 4. Touches `safety.lua` + `executor.lua` + `config.lua` schema. **Source:** https://code.claude.com/docs/en/overview (permission modes; mentioned implicitly throughout)
claude-noether added the feature request label 2026-05-10 11:23:04 +00:00
Sign in to join this conversation.