policy

package
v0.0.0-...-f56615f Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2026 License: MIT Imports: 10 Imported by: 0 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 policy stores explicit, user-approved execution rules.

Index

Constants

View Source
const Version = 1

Variables

This section is empty.

Functions

func CommandArgv

func CommandArgv(call provider.ToolCall) []string

func ParseCommandPrefix

func ParseCommandPrefix(command string) ([]string, bool)

func PrefixForCall

func PrefixForCall(call provider.ToolCall) string

Types

type Rule

type Rule struct {
	ID        string    `yaml:"id" json:"id"`
	Kind      string    `yaml:"kind" json:"kind"`
	Tool      string    `yaml:"tool,omitempty" json:"tool,omitempty"`
	Argv      []string  `yaml:"argv,omitempty" json:"argv,omitempty"`
	CreatedAt time.Time `yaml:"created_at" json:"created_at"`
}

type Store

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

func NewStore

func NewStore(path string) (*Store, error)

func (*Store) AddCommandPrefix

func (s *Store) AddCommandPrefix(prefix string) (Rule, error)

func (*Store) AddTool

func (s *Store) AddTool(name string) (Rule, error)

func (*Store) Allows

func (s *Store) Allows(call provider.ToolCall) (Rule, bool)

func (*Store) List

func (s *Store) List() []Rule

func (*Store) Path

func (s *Store) Path() string

func (*Store) Remove

func (s *Store) Remove(id string) (bool, error)

Jump to

Keyboard shortcuts

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