Add optional name field to rules #2

Open
opened 2026-04-09 13:37:50 +00:00 by jbr870 · 0 comments
Owner

Summary

Add an optional name field to deny/ask/allow/deny_promote rules in config.toml. Currently rules are identified only by positional index (e.g., deny[2]: tool=Bash), which breaks traceability when rules are reordered.

User Stories Served

  • US-4: Understand denials — "blocked by rule 'no-rm-rf'" is much clearer than "blocked by deny[2]"
  • US-10: Rule hit counts — can't track a rule across config edits without a stable identifier

Proposed Format

[[deny]]
name = 'no-rm-rf'
tool = 'Bash'
[deny.fields]
command = 'rm\s+.*-rf\s+(/|~)'
  • name is optional — unnamed rules fall back to positional index
  • Logged in rule_matched field: "deny[no-rm-rf]: tool=Bash" or "deny[2]: tool=Bash" if unnamed
  • Auto-promoted rules should also get names (derived from LLM suggestion or auto-generated)

Context

See wiki: Data Capture Analysis — "Structural Issues §1: Rules need identity"

## Summary Add an optional `name` field to deny/ask/allow/deny_promote rules in config.toml. Currently rules are identified only by positional index (e.g., `deny[2]: tool=Bash`), which breaks traceability when rules are reordered. ## User Stories Served - **US-4:** Understand denials — "blocked by rule 'no-rm-rf'" is much clearer than "blocked by deny[2]" - **US-10:** Rule hit counts — can't track a rule across config edits without a stable identifier ## Proposed Format ```toml [[deny]] name = 'no-rm-rf' tool = 'Bash' [deny.fields] command = 'rm\s+.*-rf\s+(/|~)' ``` - `name` is optional — unnamed rules fall back to positional index - Logged in `rule_matched` field: `"deny[no-rm-rf]: tool=Bash"` or `"deny[2]: tool=Bash"` if unnamed - Auto-promoted rules should also get names (derived from LLM suggestion or auto-generated) ## Context See wiki: [Data Capture Analysis](https://git.wihslon.com/jbr870/claude-permit/wiki/product%2Fdata-capture-analysis) — "Structural Issues §1: Rules need identity"
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
jbr870/claude-permit#2
No description provided.