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:
JianweiWang
2026-04-17 14:42:22 +08:00
committed by GitHub
parent 94b40aab9a
commit 9128cbf729
5 changed files with 85 additions and 69 deletions

View File

@@ -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
}