Documentation
¶
Overview ¶
Package keep is an API-level policy engine for AI agents.
Index ¶
Constants ¶
Decision constants re-exported from the engine package.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AuditEntry ¶
type AuditEntry = engine.AuditEntry
type CallContext ¶
type CallContext = engine.CallContext
type Engine ¶
type Engine struct {
// contains filtered or unexported fields
}
Engine holds compiled evaluators for each policy scope.
func Load ¶
Load reads rule files from rulesDir, compiles all CEL expressions and redact patterns, and returns a ready-to-use Engine.
func (*Engine) Close ¶
func (e *Engine) Close()
Close stops the rate counter GC goroutine. Call this when the engine is no longer needed to prevent goroutine leaks.
func (*Engine) Evaluate ¶
func (e *Engine) Evaluate(call Call, scope string) (EvalResult, error)
Evaluate runs all rules in the given scope against the call and returns the policy decision.
type EvalResult ¶
type EvalResult = engine.EvalResult
type Option ¶
type Option func(*engineConfig)
Option configures Load behavior.
func WithForceEnforce ¶
func WithForceEnforce() Option
WithForceEnforce overrides every scope's mode to "enforce".
func WithPacksDir ¶
WithPacksDir sets the directory to load starter pack YAML files from.
func WithProfilesDir ¶
WithProfilesDir sets the directory to load profile YAML files from.
type RedactedField ¶
type RedactedField = engine.RedactedField
type RuleResult ¶
type RuleResult = engine.RuleResult
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
keep
command
|
|
|
keep-llm-gateway
command
|
|
|
keep-mcp-relay
command
|
|
|
internal
|
|
|
audit
Package audit provides structured audit logging for Keep evaluations.
|
Package audit provides structured audit logging for Keep evaluations. |
|
cel
content.go — text-analysis helpers for Keep rule expressions.
|
content.go — text-analysis helpers for Keep rule expressions. |
|
config
Package config parses and validates Keep rule files, profiles, and starter packs.
|
Package config parses and validates Keep rule files, profiles, and starter packs. |
|
engine
Package engine implements Keep's core policy evaluation.
|
Package engine implements Keep's core policy evaluation. |
|
rate
Package rate provides an in-memory sliding window counter store for Keep's rateCount() CEL function.
|
Package rate provides an in-memory sliding window counter store for Keep's rateCount() CEL function. |
|
redact
Package redact handles regex-based field redaction for Keep's redact action.
|
Package redact handles regex-based field redaction for Keep's redact action. |
|
sse
Package sse implements Server-Sent Events parsing and writing per the WHATWG spec (https://html.spec.whatwg.org/multipage/server-sent-events.html).
|
Package sse implements Server-Sent Events parsing and writing per the WHATWG spec (https://html.spec.whatwg.org/multipage/server-sent-events.html). |