audit

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClassifyOperation

func ClassifyOperation(toolName string) string

ClassifyOperation determines the operation type from a tool name.

func ScoreRisk

func ScoreRisk(toolName string, arguments map[string]any) (int, []string)

ScoreRisk computes a risk score (0-100) for a tool call.

Types

type ApprovalManager

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

ApprovalManager handles pause/approve/deny flows for tool calls that require human approval before proceeding.

func NewApprovalManager

func NewApprovalManager() *ApprovalManager

NewApprovalManager creates a new ApprovalManager.

func (*ApprovalManager) Approve

func (a *ApprovalManager) Approve(id string) bool

Approve approves the pending request with the given ID. Returns false if the ID is not found or was already consumed.

func (*ApprovalManager) Deny

func (a *ApprovalManager) Deny(id string) bool

Deny denies the pending request with the given ID. Returns false if the ID is not found or was already consumed.

func (*ApprovalManager) WaitForApproval

func (a *ApprovalManager) WaitForApproval(ctx context.Context, id string, timeout time.Duration) ApprovalStatus

WaitForApproval blocks until the given approval ID is approved, denied, the timeout elapses, or ctx is cancelled. A cancelled context (e.g. shutdown) returns ApprovalTimedOut so the caller fails the paused call safely rather than letting it proceed unapproved.

type ApprovalStatus added in v0.3.9

type ApprovalStatus string

ApprovalStatus describes the outcome of a pause/approval flow.

const (
	ApprovalApproved   ApprovalStatus = "approved"
	ApprovalDenied     ApprovalStatus = "denied"
	ApprovalTimedOut   ApprovalStatus = "timed_out"
	ApprovalNoApprover ApprovalStatus = "no_approver"
)

Jump to

Keyboard shortcuts

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