policy

package
v0.2.5 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrApprovalRequired = errors.New("operation requires approval")

Functions

func EnforceNative

func EnforceNative(safety toolregistry.Safety) error

func Resolve

func Resolve(tool toolregistry.Tool, params map[string]any) (string, toolregistry.Safety, error)

Types

type ApprovalClaims

type ApprovalClaims struct {
	Version       int                `json:"version"`
	OperationID   client.OperationID `json:"operation_id"`
	Tool          string             `json:"tool"`
	Action        string             `json:"action,omitempty"`
	ArgumentsHash string             `json:"arguments_hash"`
	RiskClass     string             `json:"risk_class"`
	ProjectID     string             `json:"project_id"`
	ExpiresAtMS   int64              `json:"expires_at_ms"`
	SingleUse     bool               `json:"single_use"`
}

func InspectApprovalToken

func InspectApprovalToken(token string) (ApprovalClaims, error)

type Assessment

type Assessment struct {
	RiskClass        string `json:"risk_class"`
	SideEffectScope  string `json:"side_effect_scope"`
	ReadOnly         bool   `json:"read_only"`
	Destructive      bool   `json:"destructive"`
	RequiresApproval bool   `json:"requires_approval"`
	Enforced         bool   `json:"enforced"`
}

func Assess

func Assess(safety toolregistry.Safety) Assessment

Jump to

Keyboard shortcuts

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