Documentation
¶
Overview ¶
Package policy decides whether a tool call may run (SPEC §3.7 step 2, T5). It is pure.
The API's mode is a ceiling. A per-tool override can always tighten a decision (confirm, deny) but can never lift a tool above what the mode allows: under read-only, writes are denied even with "allow"; under confirm-writes they still need confirmation.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrInvalid = errors.New("invalid policy value")
ErrInvalid is returned for an unknown mode or override.
Functions ¶
Types ¶
type Limiter ¶
type Limiter struct {
// contains filtered or unexported fields
}
Limiter is a token bucket: a burst of N calls, refilled at N per period.
func NewLimiter ¶
NewLimiter starts a full bucket. now is the clock (time.Now if nil).
type Override ¶
type Override string
Override is a per-tool policy.
const ( None Override = "" OverrideAllow Override = "allow" OverrideConfirm Override = "confirm" OverrideDeny Override = "deny" )
Per-tool overrides.
func ParseOverride ¶
ParseOverride parses a per-tool override ("" means none).