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

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