reftoolpolicy

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const ID = "ref-tool-policy"

ID is the YAML id for the proof feature (design §19 tool-policy).

Variables

This section is empty.

Functions

func NewToolCatalogFilter

func NewToolCatalogFilter(cfg Config) toolcatalog.Filter

NewToolCatalogFilter removes blocked tools from the call before the backend.

func NewToolReactor

func NewToolReactor(cfg Config) sdk.ToolReactor

NewToolReactor swallows tool stream events for blocked tool names.

Types

type Config

type Config struct {
	Order *int `yaml:"order"`
	// BlockNames is exact tool names to drop.
	BlockNames []string `yaml:"block_names"`
	// BlockPrefixes: tool names with any of these prefixes are dropped.
	BlockPrefixes []string `yaml:"block_prefixes"`
}

Config lists tools removed from the catalog; the reactor also swallows stream events for those tool names to prove catalog vs event enforcement.

func DecodeConfig

func DecodeConfig(n yaml.Node) (Config, error)

DecodeConfig decodes the feature YAML.

type ToolCallPolicy

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

func NewToolCallPolicy

func NewToolCallPolicy(cfg Config) ToolCallPolicy

NewToolCallPolicy denies canonical tool-call stream events that match the same block rules as NewToolCatalogFilter (deterministic fail-closed denial before tool reactors run).

func (ToolCallPolicy) FailureMode

func (p ToolCallPolicy) FailureMode() sdk.FailureMode

func (ToolCallPolicy) Handle

func (ToolCallPolicy) ID

func (p ToolCallPolicy) ID() string

func (ToolCallPolicy) Order

func (p ToolCallPolicy) Order() int

Jump to

Keyboard shortcuts

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