MCPcopy Create free account
hub / github.com/astercloud/aster / IsSafeForAutoApproval

Method IsSafeForAutoApproval

pkg/tools/annotations.go:219–224  ·  view source on GitHub ↗

IsSafeForAutoApproval 判断是否可以自动批准 在 SmartApprove 模式下,只读且不涉及外部系统的工具可以自动批准

()

Source from the content-addressed store, hash-verified

217// IsSafeForAutoApproval 判断是否可以自动批准
218// 在 SmartApprove 模式下,只读且不涉及外部系统的工具可以自动批准
219func (a *ToolAnnotations) IsSafeForAutoApproval() bool {
220 if a == nil {
221 return false
222 }
223 return a.ReadOnly && !a.OpenWorld && !a.RequiresConfirmation
224}
225
226// RiskLevelName 获取风险级别名称
227func (a *ToolAnnotations) RiskLevelName() string {

Callers 4

TestAnnotationsNilSafetyFunction · 0.95
TestGetAnnotationsFunction · 0.80

Calls

no outgoing calls

Tested by 3

TestAnnotationsNilSafetyFunction · 0.76
TestGetAnnotationsFunction · 0.64