🔒 (radar) Add cumulative keywords auto ban
This commit is contained in:
5
packages/env/env.ts
vendored
5
packages/env/env.ts
vendored
@@ -76,6 +76,11 @@ const baseEnv = {
|
|||||||
.min(1)
|
.min(1)
|
||||||
.transform((val) => val.split(','))
|
.transform((val) => val.split(','))
|
||||||
.optional(),
|
.optional(),
|
||||||
|
RADAR_CUMULATIVE_KEYWORDS: z
|
||||||
|
.string()
|
||||||
|
.min(1)
|
||||||
|
.transform((val) => val.split(','))
|
||||||
|
.optional(),
|
||||||
},
|
},
|
||||||
client: {
|
client: {
|
||||||
NEXT_PUBLIC_E2E_TEST: boolean.optional(),
|
NEXT_PUBLIC_E2E_TEST: boolean.optional(),
|
||||||
|
|||||||
@@ -9,8 +9,15 @@ export const computeRiskLevel = (typebot: any) => {
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
return 100
|
return 100
|
||||||
if (!env.RADAR_INTERMEDIATE_RISK_KEYWORDS) return 0
|
|
||||||
if (
|
if (
|
||||||
|
env.RADAR_CUMULATIVE_KEYWORDS &&
|
||||||
|
env.RADAR_CUMULATIVE_KEYWORDS.every((keyword) =>
|
||||||
|
stringifiedTypebot.toLowerCase().includes(keyword)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
return 100
|
||||||
|
if (
|
||||||
|
env.RADAR_INTERMEDIATE_RISK_KEYWORDS &&
|
||||||
env.RADAR_INTERMEDIATE_RISK_KEYWORDS.some((keyword) =>
|
env.RADAR_INTERMEDIATE_RISK_KEYWORDS.some((keyword) =>
|
||||||
stringifiedTypebot.toLowerCase().includes(keyword)
|
stringifiedTypebot.toLowerCase().includes(keyword)
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user