policy

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package policy provides permission checks for tool execution.

Policy is the host-side safety gate between model-requested tool calls and tool execution. The model can request a tool call, but policy must allow it before ActStage runs the tool.

The default Engine allows explicit read tools. It denies write, exec, empty, and unknown permissions unless the request-scoped allowed permissions include the requested permission. A policy denial aborts the run before tool execution.

This package is not a full RBAC or approval system. It is the Agent-side enforcement point that host applications can replace with their own PolicyEngine.

Index

Constants

View Source
const (
	PermissionRead  = ports.PermissionRead
	PermissionWrite = ports.PermissionWrite
	PermissionExec  = ports.PermissionExec
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Decision

type Decision = ports.PolicyDecision

type Engine

type Engine struct{}

func NewEngine

func NewEngine() *Engine

func (*Engine) Decide

func (e *Engine) Decide(req Request) Decision

type Permission

type Permission = ports.Permission

type Request

type Request = ports.PolicyRequest

Jump to

Keyboard shortcuts

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