feat: add ToolPolicyConfig for per-agent tool filtering
Add ToolPolicyConfig struct with Allow/Deny string slices supporting both individual tool names and group refs (e.g. "group:web"). Add ToolPolicy field to AgentConfig. Backward compatible: nil = full access.
This commit is contained in:
parent
148623f07e
commit
f3a838fe45
1 changed files with 9 additions and 0 deletions
|
|
@ -100,6 +100,14 @@ func (m AgentModelConfig) MarshalJSON() ([]byte, error) {
|
|||
return json.Marshal(raw{Primary: m.Primary, Fallbacks: m.Fallbacks})
|
||||
}
|
||||
|
||||
// ToolPolicyConfig defines allow/deny lists for per-agent tool filtering.
|
||||
// Tool names can be individual (e.g. "exec") or group refs (e.g. "group:web").
|
||||
// nil = full access (no filtering applied).
|
||||
type ToolPolicyConfig struct {
|
||||
Allow []string `json:"allow,omitempty"` // tool names or group refs
|
||||
Deny []string `json:"deny,omitempty"` // tool names or group refs
|
||||
}
|
||||
|
||||
type AgentConfig struct {
|
||||
ID string `json:"id"`
|
||||
Default bool `json:"default,omitempty"`
|
||||
|
|
@ -111,6 +119,7 @@ type AgentConfig struct {
|
|||
Skills []string `json:"skills,omitempty"`
|
||||
Capabilities []string `json:"capabilities,omitempty"`
|
||||
Subagents *SubagentsConfig `json:"subagents,omitempty"`
|
||||
ToolPolicy *ToolPolicyConfig `json:"tool_policy,omitempty"`
|
||||
}
|
||||
|
||||
type SubagentsConfig struct {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue