Expand description
Safe command registry: defines which commands and subcommands are safe to execute.
This module implements the “safe-by-subcommand” pattern from Codex: Instead of blocking entire commands, we maintain granular allowlists of safe subcommands and forbid specific dangerous options.
Example:
git branch ✓ safe (read-only)
git reset ✗ dangerous (destructive)
git status ✓ safe (read-only)
find . ✓ safe
find . -delete ✗ dangerous (has -delete option)
cargo check ✓ safe (read-only check)
cargo clean ✗ dangerous (destructive)Structs§
- Command
Rule - A rule for when a command is safe
- Safe
Command Registry - Registry of safe commands and their safe subcommands/options
Enums§
- Safety
Decision - Result of a command safety check