refactor: update risk levels in tool definitions and validation logic to remove sensitive level

This commit is contained in:
mlogclub
2026-07-26 22:32:16 +08:00
parent c021c5568c
commit 2de50a2f3a
5 changed files with 11 additions and 9 deletions
+2 -2
View File
@@ -248,7 +248,7 @@ func (s *aIAgentService) validatePublishableAgent(db *gorm.DB, agent *models.AIA
return errorsx.InvalidParam("ai agent direct tool definition is unavailable")
}
if definition.RequireConfirmation {
return errorsx.InvalidParam("ai agent sensitive direct tools must be executed through a confirmed playbook")
return errorsx.InvalidParam("ai agent direct tool requires confirmation and cannot be executed directly")
}
}
return nil
@@ -456,7 +456,7 @@ func (s *aIAgentService) normalizeToolPolicy(raw string) (string, error) {
if level == "" {
continue
}
if level != "read" && level != "write" && level != "sensitive" {
if level != "read" && level != "write" {
return "", errorsx.InvalidParam("ai agent tool policy contains an invalid risk level")
}
if _, exists := seen[level]; exists {