Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AllowCommand ¶
func AllowCommand(profile Profile, risk CommandRisk, interactive bool) error
AllowCommand decides whether a slash command can run under current policy profile.
Types ¶
type AuditEntry ¶
type AuditEntry struct {
Time time.Time
Profile Profile
Tool string
Args map[string]any
Allow bool
Reason string // empty when allowed
}
AuditEntry is the data passed to an optional audit hook.
type CommandRisk ¶
type CommandRisk string
CommandRisk describes slash-command risk level.
const ( RiskLow CommandRisk = "low" RiskMedium CommandRisk = "medium" RiskHigh CommandRisk = "high" )
type Config ¶
type Config struct {
Profile Profile
Workspace string
Interactive bool
OnAudit func(AuditEntry) // nil = no auditing
}
Config configures the policy engine.
Click to show internal directories.
Click to hide internal directories.