Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultPath ¶
DefaultPath returns the default permissions file path for a project directory.
Types ¶
type AutoModeState ¶
type AutoModeState struct {
// contains filtered or unexported fields
}
AutoModeState tracks auto-allow decisions for learning user preferences.
func NewAutoModeState ¶
func NewAutoModeState() *AutoModeState
NewAutoModeState creates a new auto-mode state.
func (*AutoModeState) Record ¶
func (a *AutoModeState) Record(toolName, summary string, allowed bool)
Record records a permission decision.
func (*AutoModeState) ShouldAutoAllow ¶
func (a *AutoModeState) ShouldAutoAllow(toolName, summary string) (bool, bool)
ShouldAutoAllow checks if a tool should be automatically allowed.
type BypassKillswitch ¶
type BypassKillswitch struct {
// contains filtered or unexported fields
}
BypassKillswitch disables permission checks globally.
func NewBypassKillswitch ¶
func NewBypassKillswitch() *BypassKillswitch
NewBypassKillswitch creates a new bypass killswitch.
func (*BypassKillswitch) Disable ¶
func (b *BypassKillswitch) Disable()
Disable disables the bypass killswitch.
func (*BypassKillswitch) Enable ¶
func (b *BypassKillswitch) Enable()
Enable enables the bypass killswitch.
func (*BypassKillswitch) IsEnabled ¶
func (b *BypassKillswitch) IsEnabled() bool
IsEnabled checks if the bypass killswitch is enabled.
type Classifier ¶
type Classifier struct {
// contains filtered or unexported fields
}
Classifier classifies commands as safe or dangerous.
func NewClassifier ¶
func NewClassifier() *Classifier
NewClassifier creates a new permission classifier.
func (*Classifier) Classify ¶
func (c *Classifier) Classify(command string) string
Classify classifies a command as safe, unsafe, or unknown.
type Rule ¶
type Rule struct {
Tool string `json:"tool"` // tool name, e.g. "Bash"
Pattern string `json:"pattern"` // glob pattern, e.g. "go test*"
Action string `json:"action"` // "allow" or "deny"
}
Rule captures a single permission rule for persistence.
type ShadowedRuleDetector ¶
type ShadowedRuleDetector struct{}
ShadowedRuleDetector detects when permission rules shadow each other.
func (*ShadowedRuleDetector) DetectShadowedRules ¶
func (d *ShadowedRuleDetector) DetectShadowedRules(allowRules, denyRules []string) []string
DetectShadowedRules finds shadowed permission rules.