permissions

package
v0.0.0-...-23898a9 Latest Latest
Warning

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

Go to latest
Published: May 5, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package permissions re-exports the internal permissions package via type aliases so external consumers (e.g. iterion) get identity-compatible types without duplicating 1600+ lines of policy engine code.

Index

Constants

View Source
const (
	ModeReadOnly         = permissions.ModeReadOnly
	ModeWorkspaceWrite   = permissions.ModeWorkspaceWrite
	ModeDangerFullAccess = permissions.ModeDangerFullAccess
	ModePrompt           = permissions.ModePrompt
	ModeAllow            = permissions.ModeAllow

	// CLI-facing aliases.
	ModeDefault           = permissions.ModeDefault
	ModeAcceptEdits       = permissions.ModeAcceptEdits
	ModeBypassPermissions = permissions.ModeBypassPermissions
	ModePlan              = permissions.ModePlan
)
View Source
const (
	DecisionAsk   = permissions.DecisionAsk
	DecisionAllow = permissions.DecisionAllow
	DecisionDeny  = permissions.DecisionDeny
)
View Source
const (
	ScopeOnce   = permissions.ScopeOnce
	ScopeAlways = permissions.ScopeAlways
)
View Source
const (
	OverrideAllow = permissions.OverrideAllow
	OverrideDeny  = permissions.OverrideDeny
	OverrideAsk   = permissions.OverrideAsk
)
View Source
const DefaultLLMClassifierCacheSize = permissions.DefaultLLMClassifierCacheSize

DefaultLLMClassifierCacheSize is the FIFO eviction cap used by the default classifier cache.

View Source
const DefaultLLMClassifierCacheTTL = permissions.DefaultLLMClassifierCacheTTL

DefaultLLMClassifierCacheTTL is the TTL used by the default classifier cache.

View Source
const DefaultLLMClassifierModel = permissions.DefaultLLMClassifierModel

DefaultLLMClassifierModel is the default classification model used by NewLLMClassifier when no override is supplied.

Variables

View Source
var LoadRuleset = permissions.LoadRuleset

LoadRuleset reads .claude/settings.json and returns a Ruleset.

View Source
var NewClassifierCache = permissions.NewClassifierCache

NewClassifierCache builds a TTL+FIFO classifier cache with the default size cap.

View Source
var NewClassifierCacheWithSize = permissions.NewClassifierCacheWithSize

NewClassifierCacheWithSize builds a TTL+FIFO classifier cache with a custom size cap.

View Source
var NewLLMClassifier = permissions.NewLLMClassifier

NewLLMClassifier builds an LLMClassifier with sensible defaults (RuleClassifier fast-path, in-memory cache, fail-safe to Ask).

View Source
var NewLLMClassifierManager = permissions.NewLLMClassifierManager

NewLLMClassifierManager returns a Manager pre-wired with an LLMClassifier.

NewManager creates a Manager with the given mode and ruleset.

View Source
var NewPermissionContext = permissions.NewPermissionContext

NewPermissionContext creates a context with optional override.

View Source
var NewPermissionPolicy = permissions.NewPermissionPolicy

NewPermissionPolicy creates a policy with the given active mode.

View Source
var NewRuleClassifier = permissions.NewRuleClassifier

NewRuleClassifier returns a RuleClassifier with the documented default safe-list.

View Source
var ParsePermissionMode = permissions.ParsePermissionMode

ParsePermissionMode converts a CLI string to a PermissionMode.

View Source
var RulesetFromLists = permissions.RulesetFromLists

RulesetFromLists builds a Ruleset from plain allow/deny tool name slices.

View Source
var WithClassifierCache = permissions.WithClassifierCache

WithClassifierCache installs an in-memory decision cache.

View Source
var WithFallbackClassifier = permissions.WithFallbackClassifier

WithFallbackClassifier installs a Classifier consulted before the LLM.

WithLogger installs an io.Writer for classifier diagnostics.

View Source
var WithMaxTokens = permissions.WithMaxTokens

WithMaxTokens caps the classifier model's response length.

Functions

This section is empty.

Types

type Classifier

type Classifier = permissions.Classifier

Classifier evaluates a tool invocation under ModeAuto and returns a Decision.

type ClassifierCache

type ClassifierCache = permissions.ClassifierCache

ClassifierCache is the in-memory TTL+FIFO cache used by LLMClassifier.

type ClassifierLogger

type ClassifierLogger = permissions.ClassifierLogger

ClassifierLogger is the minimal logging surface Manager uses to surface classifier errors and panics. Set via Manager.SetClassifierLogger.

type Decision

type Decision = permissions.Decision

Decision is the outcome of a permission check.

type HookPermissionOverride

type HookPermissionOverride = permissions.HookPermissionOverride

HookPermissionOverride represents a hook's permission decision.

type LLMClassifier

type LLMClassifier = permissions.LLMClassifier

LLMClassifier delegates Allow/Ask/Deny decisions to a small fast model, short-circuiting via a Fallback Classifier (typically RuleClassifier) for well-known cases.

type LLMClassifierOption

type LLMClassifierOption = permissions.LLMClassifierOption

LLMClassifierOption configures an LLMClassifier built via NewLLMClassifier.

type Manager

type Manager = permissions.Manager

Manager enforces permissions for tool execution.

type PermissionContext

type PermissionContext = permissions.PermissionContext

PermissionContext provides additional permission context supplied by hooks.

type PermissionMode

type PermissionMode = permissions.PermissionMode

PermissionMode represents the security level of a session or tool requirement.

type PermissionOutcome

type PermissionOutcome = permissions.PermissionOutcome

PermissionOutcome is the final authorization result.

type PermissionOverride

type PermissionOverride = permissions.PermissionOverride

PermissionOverride represents a hook-provided override.

type PermissionPolicy

type PermissionPolicy = permissions.PermissionPolicy

PermissionPolicy evaluates permission mode requirements plus allow/deny/ask rules.

type PermissionPromptDecision

type PermissionPromptDecision = permissions.PermissionPromptDecision

PermissionPromptDecision is the outcome of prompting the user.

type PermissionPrompter

type PermissionPrompter = permissions.PermissionPrompter

PermissionPrompter is the interface for interactive permission decisions.

type PermissionRequest

type PermissionRequest = permissions.PermissionRequest

PermissionRequest describes a tool requesting permission.

type Rule

type Rule = permissions.Rule

Rule is a single permission entry matching a tool and optionally an input pattern.

type RuleClassifier

type RuleClassifier = permissions.RuleClassifier

RuleClassifier is the default Classifier with a conservative read-only safe-list.

type Ruleset

type Ruleset = permissions.Ruleset

Ruleset is an ordered list of rules; the first match wins.

type Scope

type Scope = permissions.Scope

Scope controls how long a user-granted decision is remembered.

Jump to

Keyboard shortcuts

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