Skip to content

feat(execpolicy): add typed permission rules and config schema#2046

Open
greyfreedom wants to merge 10 commits into
Hmbown:mainfrom
greyfreedom:feat/execpolicy-typed-rules
Open

feat(execpolicy): add typed permission rules and config schema#2046
greyfreedom wants to merge 10 commits into
Hmbown:mainfrom
greyfreedom:feat/execpolicy-typed-rules

Conversation

@greyfreedom
Copy link
Copy Markdown
Contributor

Rebased replacement for #1189 on current main after the v0.8.41 CodeWhale rebrand.

Summary

  • Add typed persistent permission rules with allow, deny, and ask decisions.
  • Support exec_shell command-prefix matching and workspace-relative path glob matching.
  • Preserve compatibility with existing auto_allow / auto_deny config lists.
  • Reuse the existing execpolicy ruleset layering and bash arity matching.
  • Harden path matching with normalized paths and globset for glob evaluation.

Validation

  • cargo fmt --all
  • cargo test -p codewhale-execpolicy -p codewhale-config -p codewhale-app-server -p codewhale-cli --all-features
  • cargo test -p codewhale-tui pandoc_convert_rejects_inline_request_for_binary_format --all-features
  • cargo test -p codewhale-tui execute_rejects_absolute_path --all-features
  • cargo test -p codewhale-tui tasks_panel_collapses_stale_running_tool_rows --all-features
  • cargo clippy -p codewhale-execpolicy -p codewhale-config -p codewhale-app-server -p codewhale-cli --all-targets --all-features -- -D warnings

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request implements a granular tool permission system, introducing typed rules for tool names, command prefixes, and path globs while maintaining legacy compatibility. Feedback focuses on performance optimizations for rule resolution and glob matching, refining denial logic to prevent over-blocking, and improving configuration merging to allow overriding global lists with empty ones.

Comment thread crates/execpolicy/src/lib.rs
Comment thread crates/execpolicy/src/lib.rs Outdated
Comment thread crates/execpolicy/src/lib.rs
Comment thread crates/config/src/lib.rs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant