Documentation
¶
Index ¶
- Constants
- func ExplicitWebLookupInstruction(userInput string) string
- func IsPlanSafeShellCommand(command string) bool
- func ResolveToolSets(policy skills.ToolPolicy) (map[string]struct{}, map[string]struct{})
- func SortedToolNames(set map[string]struct{}) []string
- type DecisionSource
- type EvaluateInput
- type Evaluation
- type MainDecision
- type PromptHintDecision
- type PromptHintResult
- type ReasonCode
- type ShellAssessment
- type ShellRisk
- type ToolAccessDecision
- type ToolAccessInput
- type ToolSpec
Constants ¶
View Source
const EmptyAllowlistSentinel = "__bytemind__no_tools__"
Variables ¶
This section is empty.
Functions ¶
func ExplicitWebLookupInstruction ¶
ExplicitWebLookupInstruction returns an extra system hint when the user explicitly asks for online/source-website lookup instead of local workspace inspection.
func IsPlanSafeShellCommand ¶
func ResolveToolSets ¶
func ResolveToolSets(policy skills.ToolPolicy) (map[string]struct{}, map[string]struct{})
ResolveToolSets maps active skill tool policy into allow/deny sets.
func SortedToolNames ¶
Types ¶
type DecisionSource ¶
type DecisionSource string
const ( DecisionSourceRuntime DecisionSource = "runtime" DecisionSourceSkill DecisionSource = "skill" )
type EvaluateInput ¶
type Evaluation ¶
type Evaluation struct {
MainDecision MainDecision
MainReasonCode ReasonCode
MainReason string
MainSource DecisionSource
PromptHint PromptHintResult
}
func Evaluate ¶
func Evaluate(in EvaluateInput) Evaluation
Evaluate returns a unified policy decision: one executable main decision and one optional prompt-hint sub decision.
type MainDecision ¶
type MainDecision string
const ( MainDecisionAllow MainDecision = "allow" MainDecisionDeny MainDecision = "deny" MainDecisionEscalate MainDecision = "escalate" )
type PromptHintDecision ¶
type PromptHintDecision string
const ( PromptHintDecisionHint PromptHintDecision = "hint" PromptHintDecisionNone PromptHintDecision = "none" )
type PromptHintResult ¶
type PromptHintResult struct {
Decision PromptHintDecision
ReasonCode ReasonCode
Reason string
Instruction string
}
func EvaluatePromptHint ¶
func EvaluatePromptHint(userInput string) PromptHintResult
type ReasonCode ¶
type ReasonCode string
const ( ReasonInvalidToolName ReasonCode = "invalid_tool_name" ReasonToolDeniedByDenylist ReasonCode = "tool_denied_by_denylist" ReasonToolNotInAllowlist ReasonCode = "tool_not_in_allowlist" ReasonToolAllowed ReasonCode = "tool_allowed" ReasonDestructiveToolRequiresApproval ReasonCode = "destructive_tool_requires_approval" ReasonDangerousCommandBlocked ReasonCode = "dangerous_command_blocked" ReasonPlanModeToolBlocked ReasonCode = "plan_mode_tool_blocked" ReasonWebLookupHintInjected ReasonCode = "web_lookup_hint_injected" ReasonPromptHintSkipped ReasonCode = "prompt_hint_skipped" ReasonPolicyEvaluationError ReasonCode = "policy_evaluation_error" )
type ShellAssessment ¶
func AssessShellCommand ¶
func AssessShellCommand(command string) ShellAssessment
type ToolAccessDecision ¶
func DecideToolAccess ¶
func DecideToolAccess(in ToolAccessInput) ToolAccessDecision
DecideToolAccess evaluates whether a tool can run under active allow/deny constraints.
type ToolAccessInput ¶
Click to show internal directories.
Click to hide internal directories.