basic

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package basic provides a simple policy.Engine implementation that enforces optional allow/block lists and honors planner retry hints. It is intended to cover the common case where teams want lightweight filtering without building a bespoke policy service.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Engine

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

Engine implements policy.Engine with allow/block filtering and retry-hint awareness.

func New

func New(opts Options) (*Engine, error)

New builds a new Engine using the supplied options.

func (*Engine) Decide

func (e *Engine) Decide(_ context.Context, input policy.Input) (policy.Decision, error)

Decide evaluates the tool allowlist for the current turn.

type Options

type Options struct {
	// AllowTags restricts tool execution to metadata tags. Empty means no tag filter.
	AllowTags []string
	// BlockTags excludes tools containing any of these tags.
	BlockTags []string
	// AllowTools explicitly allowlists tool IDs. Takes precedence over tags.
	AllowTools []string
	// BlockTools explicitly block tool IDs.
	BlockTools []string
	// DisableRetryHints disables automatic handling of planner RetryHints. Enabled by default.
	DisableRetryHints bool
	// Label annotates emitted policy labels; defaults to "basic".
	Label string
}

Options configures the basic policy engine.

Jump to

Keyboard shortcuts

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