policy

package
v0.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 16, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action string

Action is the policy decision for a tool execution request.

const (
	ActionAllow           Action = "allow"
	ActionDeny            Action = "deny"
	ActionRequireApproval Action = "require_approval"
)

type Config

type Config struct {
	Mode            Mode
	RequireApproval []string
}

Config contains policy settings required by the evaluator.

type Decision

type Decision struct {
	Action Action
	Reason string
}

Decision is the deterministic policy result.

type Evaluator

type Evaluator struct {
	// contains filtered or unexported fields
}

Evaluator performs pure policy decisions.

func NewEvaluator

func NewEvaluator(cfg Config) Evaluator

NewEvaluator builds a deterministic, side-effect free evaluator.

func (Evaluator) Evaluate

func (e Evaluator) Evaluate(input Input) Decision

Evaluate returns a deterministic decision for the given input.

type Input

type Input struct {
	ToolName string
}

Input is the minimum evaluation context.

type Mode

type Mode string

Mode controls evaluator behavior.

const (
	ModeStrict  Mode = "strict"
	ModeRelaxed Mode = "relaxed"
	ModeOff     Mode = "off"
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL