basic

package
v2.1.1 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2026 License: MIT Imports: 4 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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.
	// Retry-hint handling is enabled by default, independently of allow/block filters.
	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