Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Extension ¶
func Extension(policy *Policy, settings *config.SettingsManager, parent extensions.Context) extensions.Factory
Extension requires an explicit policy; child agents may share their parent policy.
func SandboxMode ¶
func SandboxMode(settings *config.SettingsManager) (sandbox.Mode, error)
SandboxMode is a host constraint, independent of extension enablement.
Types ¶
type Decision ¶
type Decision struct {
Time int64 `json:"time"`
Tool string `json:"tool"`
Action Action `json:"action"`
Resolved Action `json:"resolved"`
Mode string `json:"mode"`
Rule int `json:"rule,omitempty"`
Matcher string `json:"matcher,omitempty"`
Input string `json:"input,omitempty"`
Resolution string `json:"resolution,omitempty"`
}
Decision records the matched policy and its runtime resolution.
type Policy ¶
type Policy struct {
// Sandbox is selected by native hosts; SDK callers attach native.ToolOptions
// explicitly or supply their own contained tool operations.
Sandbox sandbox.Mode `json:"sandbox,omitempty"`
Mode string `json:"mode,omitempty"`
AskFallback Action `json:"askFallback,omitempty"`
Rules []Rule `json:"rules,omitempty"`
Authorizer func(context.Context, ToolCallInfo) (Action, error) `json:"-"`
// Guards are hard deny-only constraints: any non-empty reason denies,
// even in log mode.
Guards []func(context.Context, ToolCallInfo) string `json:"-"`
// contains filtered or unexported fields
}
Policy is constructible by SDK embedders and shared with in-process children. Configure fields before attaching; SetMode is the only concurrent mutation API.
Click to show internal directories.
Click to hide internal directories.