policy

package
v1.5.4 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Chain

func Chain(rules ...Rule) agentcore.PermissionFunc

Chain composes rules in order and returns a PermissionFunc for WithPermission.

func ReadOnlyProfile

func ReadOnlyProfile(root string) agentcore.PermissionFunc

ReadOnlyProfile allows read-only tools and limits paths to root.

func WorkspaceProfile

func WorkspaceProfile(root string) agentcore.PermissionFunc

WorkspaceProfile allows common workspace file tools and excludes bash.

Types

type Rule

type Rule func(ctx context.Context, call agentcore.ToolCall) error

Rule is a lightweight permission rule for a single tool call.

func AllowTools

func AllowTools(names ...string) Rule

AllowTools permits only the listed tools and rejects all others.

func DenyTools

func DenyTools(names ...string) Rule

DenyTools rejects the listed tools and allows all others.

func RestrictPaths

func RestrictPaths(root string, names ...string) Rule

RestrictPaths limits tool paths to stay within root. If no tool names are provided, it applies to the built-in path-based tools.

Jump to

Keyboard shortcuts

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