mirror of
https://github.com/alibaba/higress.git
synced 2026-05-27 22:27:29 +08:00
fix(ai-security-guard): 移除Suggestion=block的兜底逻辑,改为基于阈值判断 || fix(ai-security-guard): Remove the cover-up logic of Suggestion=block and change it to based on threshold judgment (#3731)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
This commit is contained in:
@@ -807,11 +807,6 @@ func evaluateRiskMultiModal(data Data, config AISecurityConfig, consumer string)
|
||||
}
|
||||
}
|
||||
|
||||
// 3. Data.Suggestion=block fallback
|
||||
if data.Suggestion == "block" {
|
||||
return RiskBlock
|
||||
}
|
||||
|
||||
if hasMask {
|
||||
return RiskMask
|
||||
}
|
||||
@@ -821,9 +816,6 @@ func evaluateRiskMultiModal(data Data, config AISecurityConfig, consumer string)
|
||||
// detailTriggersBlock returns whether this single detail should trigger blocking,
|
||||
// given the resolved dimension action and threshold evaluation result.
|
||||
func detailTriggersBlock(detail Detail, dimAction string, exceeds bool) bool {
|
||||
if detail.Suggestion == "block" {
|
||||
return true
|
||||
}
|
||||
if dimAction == "block" {
|
||||
return exceeds
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user