@highflame/policy 2.1.36 → 2.1.37
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/_schemas/ai_gateway/context.json +431 -11
- package/_schemas/ai_gateway/schema.cedarschema +91 -11
- package/_schemas/ai_gateway/templates/defaults/agent_security.cedar +66 -43
- package/_schemas/ai_gateway/templates/defaults/baseline.cedar +9 -11
- package/_schemas/ai_gateway/templates/defaults/semantic.cedar +63 -40
- package/_schemas/ai_gateway/templates/defaults/tools.cedar +48 -36
- package/_schemas/ai_gateway/templates/llm_default_allow.cedar +9 -10
- package/_schemas/ai_gateway/templates/mcp_server_allowlist.cedar +22 -14
- package/_schemas/ai_gateway/templates/mcp_tool_permissions.cedar +29 -27
- package/_schemas/ai_gateway/templates/pii_redaction.cedar +38 -33
- package/_schemas/ai_gateway/templates/templates.json +42 -47
- package/_schemas/guardrails/context.json +12 -12
- package/_schemas/guardrails/schema.cedarschema +12 -12
- package/_schemas/guardrails/templates/defaults/agent_identity.cedar +60 -56
- package/_schemas/guardrails/templates/defaults/agentic_safety.cedar +83 -58
- package/_schemas/guardrails/templates/defaults/baseline.cedar +9 -12
- package/_schemas/guardrails/templates/defaults/injection.cedar +48 -36
- package/_schemas/guardrails/templates/defaults/pii.cedar +27 -20
- package/_schemas/guardrails/templates/defaults/secrets.cedar +39 -22
- package/_schemas/guardrails/templates/defaults/security_patterns.cedar +38 -25
- package/_schemas/guardrails/templates/defaults/semantic.cedar +47 -31
- package/_schemas/guardrails/templates/defaults/tool_risk.cedar +34 -26
- package/_schemas/guardrails/templates/defaults/toxicity.cedar +57 -47
- package/_schemas/guardrails/templates/mcp_tool_permissions.cedar +60 -43
- package/_schemas/guardrails/templates/profiles/a2a_security/cross_origin.cedar +29 -42
- package/_schemas/guardrails/templates/profiles/a2a_security/escalation_detection.cedar +43 -57
- package/_schemas/guardrails/templates/profiles/a2a_security/identity_enforcement.cedar +40 -57
- package/_schemas/guardrails/templates/profiles/a2a_security/inter_agent_injection.cedar +48 -62
- package/_schemas/guardrails/templates/profiles/a2a_security/supply_chain.cedar +40 -56
- package/_schemas/guardrails/templates/profiles/advanced_detection/pii.cedar +24 -34
- package/_schemas/guardrails/templates/profiles/advanced_detection/secrets.cedar +45 -37
- package/_schemas/guardrails/templates/profiles/advanced_detection/threat_severity.cedar +11 -16
- package/_schemas/guardrails/templates/profiles/chat_assistant/privacy.cedar +22 -9
- package/_schemas/guardrails/templates/profiles/chat_assistant/security.cedar +27 -15
- package/_schemas/guardrails/templates/profiles/chat_assistant/trust_safety.cedar +37 -22
- package/_schemas/guardrails/templates/profiles/code_agent/agentic_security.cedar +68 -47
- package/_schemas/guardrails/templates/profiles/code_agent/encoding.cedar +17 -21
- package/_schemas/guardrails/templates/profiles/code_agent/path_security.cedar +74 -73
- package/_schemas/guardrails/templates/profiles/code_agent/security.cedar +13 -9
- package/_schemas/guardrails/templates/profiles/code_agent/supply_chain.cedar +36 -58
- package/_schemas/guardrails/templates/profiles/data_pipeline/agentic_security.cedar +22 -15
- package/_schemas/guardrails/templates/profiles/data_pipeline/data_protection.cedar +52 -0
- package/_schemas/guardrails/templates/profiles/data_pipeline/privacy.cedar +41 -18
- package/_schemas/guardrails/templates/profiles/data_pipeline/security.cedar +18 -36
- package/_schemas/guardrails/templates/profiles/multi_agent/agent_safety.cedar +86 -79
- package/_schemas/guardrails/templates/profiles/multi_agent/agent_trust.cedar +73 -70
- package/_schemas/guardrails/templates/templates.json +188 -210
- package/_schemas/overwatch/context.json +14 -14
- package/_schemas/overwatch/schema.cedarschema +12 -12
- package/_schemas/sentry/context.json +11 -11
- package/_schemas/sentry/schema.cedarschema +11 -11
- package/_schemas/sentry/templates/defaults/baseline.cedar +8 -12
- package/_schemas/sentry/templates/defaults/clipboard.cedar +43 -42
- package/_schemas/sentry/templates/defaults/content_safety.cedar +38 -68
- package/_schemas/sentry/templates/defaults/file_safety.cedar +18 -26
- package/_schemas/sentry/templates/defaults/organization.cedar +10 -17
- package/_schemas/sentry/templates/defaults/pii.cedar +52 -73
- package/_schemas/sentry/templates/defaults/secrets.cedar +65 -58
- package/_schemas/sentry/templates/defaults/semantic.cedar +40 -59
- package/_schemas/sentry/templates/templates.json +46 -46
- package/dist/ai_gateway-context.gen.d.ts +18 -4
- package/dist/ai_gateway-context.gen.js +18 -4
- package/dist/ai_gateway-defaults.gen.d.ts +1 -1
- package/dist/ai_gateway-defaults.gen.js +377 -313
- package/dist/guardrails-context.gen.d.ts +5 -5
- package/dist/guardrails-context.gen.js +5 -5
- package/dist/guardrails-defaults.gen.d.ts +1 -1
- package/dist/guardrails-defaults.gen.js +2070 -1849
- package/dist/overwatch-context.gen.d.ts +5 -5
- package/dist/overwatch-context.gen.js +5 -5
- package/dist/overwatch-defaults.gen.d.ts +1 -1
- package/dist/overwatch-defaults.gen.js +547 -573
- package/dist/sentry-context.gen.d.ts +3 -3
- package/dist/sentry-context.gen.js +3 -3
- package/dist/sentry-defaults.gen.d.ts +1 -1
- package/dist/sentry-defaults.gen.js +379 -460
- package/dist/service-schemas.gen.d.ts +4 -4
- package/dist/service-schemas.gen.js +249 -99
- package/package.json +1 -1
|
@@ -1,38 +1,32 @@
|
|
|
1
1
|
// =============================================================================
|
|
2
|
-
// Content Safety
|
|
2
|
+
// Content Safety (Default)
|
|
3
3
|
// =============================================================================
|
|
4
|
-
//
|
|
5
|
-
//
|
|
4
|
+
// Blocks violent, harmful, hateful, sexual, and profane content across
|
|
5
|
+
// messages and file uploads. Paste-targeted content rules live in
|
|
6
|
+
// clipboard.cedar.
|
|
6
7
|
//
|
|
7
|
-
//
|
|
8
|
-
//
|
|
8
|
+
// Thresholds:
|
|
9
|
+
// - violence, weapons, sexual, crime: >= 80 (critical/high)
|
|
10
|
+
// - hate_speech: >= 75 (lower threshold, zero tolerance)
|
|
11
|
+
// - profanity: >= 90 (higher threshold, allows normal expression)
|
|
9
12
|
//
|
|
10
|
-
//
|
|
11
|
-
//
|
|
13
|
+
// Context keys consumed:
|
|
14
|
+
// - violence_score, weapons_score, hate_speech_score: Long (0-100)
|
|
15
|
+
// - crime_score, sexual_score, profanity_score: Long (0-100)
|
|
12
16
|
//
|
|
13
17
|
// Compliance:
|
|
14
|
-
// NIST 800-53 SI-4
|
|
15
|
-
// EU AI Act Art. 52 (Transparency for AI Systems)
|
|
16
|
-
// OWASP LLM02 (Insecure Output Handling)
|
|
17
|
-
// ISO 42001 (AI Management System)
|
|
18
|
+
// - NIST 800-53 SI-4; EU AI Act Art. 52; ISO 42001; OWASP LLM02
|
|
18
19
|
//
|
|
19
|
-
// Category:
|
|
20
|
+
// Category: trust-safety
|
|
20
21
|
// Namespace: Sentry
|
|
21
22
|
// =============================================================================
|
|
22
23
|
|
|
23
|
-
|
|
24
|
-
// Section 1: Violence & Weapons
|
|
25
|
-
// Blocks content promoting, describing, or instructing violence and weapons.
|
|
26
|
-
// Applies to messages and file uploads.
|
|
27
|
-
// ---------------------------------------------------------------------------
|
|
28
|
-
|
|
29
|
-
// Block violent content across all input channels
|
|
30
|
-
@id("sentry-cs-block-violence")
|
|
24
|
+
@id("trust-safety.block-violence")
|
|
31
25
|
@name("Block violent content")
|
|
32
|
-
@description("
|
|
26
|
+
@description("Blocks process_prompt and upload_file when violence_score >= 80.")
|
|
33
27
|
@severity("critical")
|
|
34
|
-
@tags("
|
|
35
|
-
@reject_message("Content blocked: violent content detected.
|
|
28
|
+
@tags("category:trust-safety,threat:violence,detection:ml,compliance:nist-si-4,compliance:iso-42001")
|
|
29
|
+
@reject_message("Content blocked: violent content detected.")
|
|
36
30
|
forbid (
|
|
37
31
|
principal,
|
|
38
32
|
action in [Sentry::Action::"process_prompt", Sentry::Action::"upload_file"],
|
|
@@ -42,13 +36,12 @@ when {
|
|
|
42
36
|
context has violence_score && context.violence_score >= 80
|
|
43
37
|
};
|
|
44
38
|
|
|
45
|
-
|
|
46
|
-
@id("sentry-cs-block-weapons")
|
|
39
|
+
@id("trust-safety.block-weapons")
|
|
47
40
|
@name("Block weapons content")
|
|
48
|
-
@description("
|
|
41
|
+
@description("Blocks process_prompt and upload_file when weapons_score >= 80.")
|
|
49
42
|
@severity("critical")
|
|
50
|
-
@tags("
|
|
51
|
-
@reject_message("Content blocked: weapons-related content detected.
|
|
43
|
+
@tags("category:trust-safety,threat:weapons,detection:ml,compliance:nist-si-4")
|
|
44
|
+
@reject_message("Content blocked: weapons-related content detected.")
|
|
52
45
|
forbid (
|
|
53
46
|
principal,
|
|
54
47
|
action in [Sentry::Action::"process_prompt", Sentry::Action::"upload_file"],
|
|
@@ -58,18 +51,12 @@ when {
|
|
|
58
51
|
context has weapons_score && context.weapons_score >= 80
|
|
59
52
|
};
|
|
60
53
|
|
|
61
|
-
|
|
62
|
-
// Section 2: Hate Speech & Discrimination
|
|
63
|
-
// Lower threshold (75) — enterprises have zero tolerance for hate speech.
|
|
64
|
-
// ---------------------------------------------------------------------------
|
|
65
|
-
|
|
66
|
-
// Block hate speech content
|
|
67
|
-
@id("sentry-cs-block-hate-speech")
|
|
54
|
+
@id("trust-safety.block-hate-speech")
|
|
68
55
|
@name("Block hate speech")
|
|
69
|
-
@description("
|
|
56
|
+
@description("Blocks process_prompt and upload_file when hate_speech_score >= 75.")
|
|
70
57
|
@severity("critical")
|
|
71
|
-
@tags("hate-speech,
|
|
72
|
-
@reject_message("Content blocked: hate speech or discriminatory content detected.
|
|
58
|
+
@tags("category:trust-safety,threat:hate-speech,detection:ml,compliance:nist-si-4,compliance:eu-ai-act")
|
|
59
|
+
@reject_message("Content blocked: hate speech or discriminatory content detected.")
|
|
73
60
|
forbid (
|
|
74
61
|
principal,
|
|
75
62
|
action in [Sentry::Action::"process_prompt", Sentry::Action::"upload_file"],
|
|
@@ -79,17 +66,12 @@ when {
|
|
|
79
66
|
context has hate_speech_score && context.hate_speech_score >= 75
|
|
80
67
|
};
|
|
81
68
|
|
|
82
|
-
|
|
83
|
-
// Section 3: Criminal Content
|
|
84
|
-
// ---------------------------------------------------------------------------
|
|
85
|
-
|
|
86
|
-
// Block criminal content
|
|
87
|
-
@id("sentry-cs-block-crime")
|
|
69
|
+
@id("trust-safety.block-crime")
|
|
88
70
|
@name("Block criminal content")
|
|
89
|
-
@description("
|
|
71
|
+
@description("Blocks process_prompt and upload_file when crime_score >= 80.")
|
|
90
72
|
@severity("high")
|
|
91
|
-
@tags("
|
|
92
|
-
@reject_message("Content blocked: criminal activity content detected.
|
|
73
|
+
@tags("category:trust-safety,threat:crime,detection:ml,compliance:nist-si-4")
|
|
74
|
+
@reject_message("Content blocked: criminal activity content detected.")
|
|
93
75
|
forbid (
|
|
94
76
|
principal,
|
|
95
77
|
action in [Sentry::Action::"process_prompt", Sentry::Action::"upload_file"],
|
|
@@ -99,17 +81,12 @@ when {
|
|
|
99
81
|
context has crime_score && context.crime_score >= 80
|
|
100
82
|
};
|
|
101
83
|
|
|
102
|
-
|
|
103
|
-
// Section 4: Sexual Content
|
|
104
|
-
// ---------------------------------------------------------------------------
|
|
105
|
-
|
|
106
|
-
// Block sexual content
|
|
107
|
-
@id("sentry-cs-block-sexual")
|
|
84
|
+
@id("trust-safety.block-sexual")
|
|
108
85
|
@name("Block sexual content")
|
|
109
|
-
@description("
|
|
86
|
+
@description("Blocks process_prompt and upload_file when sexual_score >= 80.")
|
|
110
87
|
@severity("high")
|
|
111
|
-
@tags("
|
|
112
|
-
@reject_message("Content blocked:
|
|
88
|
+
@tags("category:trust-safety,threat:sexual,detection:ml,compliance:eu-ai-act,compliance:iso-42001")
|
|
89
|
+
@reject_message("Content blocked: sexually explicit content detected.")
|
|
113
90
|
forbid (
|
|
114
91
|
principal,
|
|
115
92
|
action in [Sentry::Action::"process_prompt", Sentry::Action::"upload_file"],
|
|
@@ -119,18 +96,12 @@ when {
|
|
|
119
96
|
context has sexual_score && context.sexual_score >= 80
|
|
120
97
|
};
|
|
121
98
|
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
// ---------------------------------------------------------------------------
|
|
126
|
-
|
|
127
|
-
// Block excessive profanity
|
|
128
|
-
@id("sentry-cs-block-profanity")
|
|
129
|
-
@name("Block profanity")
|
|
130
|
-
@description("Block content when the ML profanity detection score exceeds threshold (90/100). Higher threshold allows normal expression while blocking abusive or harassing language patterns.")
|
|
99
|
+
@id("trust-safety.block-profanity")
|
|
100
|
+
@name("Block excessive profanity")
|
|
101
|
+
@description("Blocks process_prompt when profanity_score >= 90.")
|
|
131
102
|
@severity("medium")
|
|
132
|
-
@tags("
|
|
133
|
-
@reject_message("Content blocked: excessive profanity detected
|
|
103
|
+
@tags("category:trust-safety,threat:profanity,detection:ml,surface:process-prompt")
|
|
104
|
+
@reject_message("Content blocked: excessive profanity detected — please rephrase in professional language.")
|
|
134
105
|
forbid (
|
|
135
106
|
principal,
|
|
136
107
|
action == Sentry::Action::"process_prompt",
|
|
@@ -139,4 +110,3 @@ forbid (
|
|
|
139
110
|
when {
|
|
140
111
|
context has profanity_score && context.profanity_score >= 90
|
|
141
112
|
};
|
|
142
|
-
|
|
@@ -1,54 +1,46 @@
|
|
|
1
1
|
// =============================================================================
|
|
2
|
-
// File & Attachment Safety
|
|
2
|
+
// File & Attachment Safety (Default)
|
|
3
3
|
// =============================================================================
|
|
4
4
|
// Blocks file uploads to AI chat services when document content contains
|
|
5
5
|
// secrets or PII.
|
|
6
6
|
//
|
|
7
|
-
//
|
|
8
|
-
//
|
|
9
|
-
//
|
|
7
|
+
// Context keys consumed:
|
|
8
|
+
// - secrets_detected: Bool
|
|
9
|
+
// - pii_detected: Bool
|
|
10
10
|
//
|
|
11
11
|
// Compliance:
|
|
12
|
-
// NIST 800-53 SC-28
|
|
13
|
-
// GDPR Art. 32 (Security of Processing)
|
|
12
|
+
// - NIST 800-53 SC-28; GDPR Art. 32
|
|
14
13
|
//
|
|
15
|
-
// Category:
|
|
14
|
+
// Category: file-safety
|
|
16
15
|
// Namespace: Sentry
|
|
17
16
|
// =============================================================================
|
|
18
17
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
// ---------------------------------------------------------------------------
|
|
23
|
-
|
|
24
|
-
// Block text files with secrets
|
|
25
|
-
@id("sentry-file-block-secrets")
|
|
26
|
-
@name("Block text files with secrets")
|
|
27
|
-
@description("Block file uploads when secrets or credentials are detected in document content. Prevents uploading configuration files, code, or documents containing API keys, tokens, or passwords to AI services.")
|
|
18
|
+
@id("file-safety.block-upload-secrets")
|
|
19
|
+
@name("Block file uploads with secrets")
|
|
20
|
+
@description("Blocks upload_file when secrets_detected is true.")
|
|
28
21
|
@severity("critical")
|
|
29
|
-
@tags("
|
|
30
|
-
@reject_message("
|
|
22
|
+
@tags("category:file-safety,threat:secrets,detection:rule,surface:upload-file,owasp:llm06")
|
|
23
|
+
@reject_message("File upload blocked: secrets or credentials detected in document content.")
|
|
31
24
|
forbid (
|
|
32
25
|
principal,
|
|
33
26
|
action == Sentry::Action::"upload_file",
|
|
34
27
|
resource
|
|
35
28
|
)
|
|
36
29
|
when {
|
|
37
|
-
context has
|
|
30
|
+
context has secrets_detected && context.secrets_detected == true
|
|
38
31
|
};
|
|
39
32
|
|
|
40
|
-
|
|
41
|
-
@
|
|
42
|
-
@
|
|
43
|
-
@description("Block file uploads when PII is detected in document content. Prevents sharing of documents containing personal data (customer lists, HR records, medical files) with AI services.")
|
|
33
|
+
@id("file-safety.block-upload-pii")
|
|
34
|
+
@name("Block file uploads with PII")
|
|
35
|
+
@description("Blocks upload_file when pii_detected is true.")
|
|
44
36
|
@severity("critical")
|
|
45
|
-
@tags("pii,
|
|
46
|
-
@reject_message("File upload blocked: personally identifiable information detected in
|
|
37
|
+
@tags("category:file-safety,threat:pii,detection:rule,surface:upload-file,compliance:gdpr")
|
|
38
|
+
@reject_message("File upload blocked: personally identifiable information detected in document content.")
|
|
47
39
|
forbid (
|
|
48
40
|
principal,
|
|
49
41
|
action == Sentry::Action::"upload_file",
|
|
50
42
|
resource
|
|
51
43
|
)
|
|
52
44
|
when {
|
|
53
|
-
context has pii_detected && context.pii_detected
|
|
45
|
+
context has pii_detected && context.pii_detected == true
|
|
54
46
|
};
|
|
@@ -1,29 +1,22 @@
|
|
|
1
1
|
// =============================================================================
|
|
2
|
-
// Organization Rules
|
|
2
|
+
// Organization Rules (Default)
|
|
3
3
|
// =============================================================================
|
|
4
4
|
// Cross-cutting organization-wide rules that don't fit other categories.
|
|
5
|
-
//
|
|
6
|
-
// in clipboard.cedar.
|
|
5
|
+
// Currently: session-aware threat escalation circuit breaker.
|
|
7
6
|
//
|
|
8
|
-
//
|
|
9
|
-
// -
|
|
7
|
+
// Context keys consumed:
|
|
8
|
+
// - session_threat_turns: Long
|
|
10
9
|
//
|
|
11
|
-
// Category:
|
|
10
|
+
// Category: organization
|
|
12
11
|
// Namespace: Sentry
|
|
13
12
|
// =============================================================================
|
|
14
13
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
// ---------------------------------------------------------------------------
|
|
19
|
-
|
|
20
|
-
// Block all actions after repeated threat detection
|
|
21
|
-
@id("sentry-org-session-threat-escalation")
|
|
22
|
-
@name("Escalate after repeated threats")
|
|
23
|
-
@description("Block all actions when threats have been detected in 3+ turns of the session. Repeated threat detections indicate either a persistent attacker or a compromised data source requiring investigation.")
|
|
14
|
+
@id("organization.block-session-threat-escalation")
|
|
15
|
+
@name("Block session after repeated threats")
|
|
16
|
+
@description("Blocks all actions when session_threat_turns >= 3.")
|
|
24
17
|
@severity("high")
|
|
25
|
-
@tags("
|
|
26
|
-
@reject_message("
|
|
18
|
+
@tags("category:organization,detection:aggregate,posture:catch-all,scope:org-wide")
|
|
19
|
+
@reject_message("Request blocked: 3+ threat turns in this session — the session has been flagged; please start a new session or contact your security team.")
|
|
27
20
|
forbid (
|
|
28
21
|
principal,
|
|
29
22
|
action,
|
|
@@ -1,65 +1,57 @@
|
|
|
1
1
|
// =============================================================================
|
|
2
|
-
// PII Detection
|
|
2
|
+
// PII Detection (Default)
|
|
3
3
|
// =============================================================================
|
|
4
|
-
//
|
|
5
|
-
//
|
|
4
|
+
// Blocks personally identifiable information across messages and file uploads
|
|
5
|
+
// using multi-layered detection: detector boolean, granular PII type
|
|
6
|
+
// matching, ML classifier confidence, threat category aggregation, and bulk
|
|
7
|
+
// exposure thresholds.
|
|
6
8
|
//
|
|
7
9
|
// Paste-targeted PII rules live in clipboard.cedar.
|
|
8
10
|
//
|
|
9
|
-
//
|
|
10
|
-
//
|
|
11
|
-
//
|
|
12
|
-
//
|
|
13
|
-
//
|
|
14
|
-
//
|
|
15
|
-
//
|
|
16
|
-
// ssn, credit_card, email, phone_us, ip_address, date_of_birth,
|
|
17
|
-
// passport, iban, aws_key, api_key_generic
|
|
11
|
+
// Context keys consumed:
|
|
12
|
+
// - pii_detected: Bool
|
|
13
|
+
// - pii_types: Set<String>
|
|
14
|
+
// - pii_count: Long
|
|
15
|
+
// - pii_score: Long (0-100)
|
|
16
|
+
// - detected_threats: Set<String>
|
|
17
|
+
// - threat_categories: Set<String>
|
|
18
18
|
//
|
|
19
19
|
// Compliance:
|
|
20
|
-
// PCI DSS 3.4
|
|
21
|
-
// GDPR Art. 32 (Security of Processing)
|
|
22
|
-
// HIPAA §164.312 (Technical Safeguards)
|
|
23
|
-
// CCPA §1798.150 (Data Protection)
|
|
24
|
-
// OWASP LLM06 (Sensitive Information Disclosure)
|
|
20
|
+
// - PCI DSS 3.4/4.1, GDPR Art. 32, HIPAA §164.312, CCPA §1798.150
|
|
25
21
|
//
|
|
26
|
-
// Category:
|
|
22
|
+
// Category: privacy
|
|
27
23
|
// Namespace: Sentry
|
|
28
24
|
// =============================================================================
|
|
29
25
|
|
|
30
26
|
// ---------------------------------------------------------------------------
|
|
31
|
-
// Section 1: Primary PII
|
|
32
|
-
// Fires when the detection pipeline identifies PII in any content.
|
|
27
|
+
// Section 1: Primary PII detection
|
|
33
28
|
// ---------------------------------------------------------------------------
|
|
34
29
|
|
|
35
|
-
|
|
36
|
-
@id("sentry-pii-block-messages")
|
|
30
|
+
@id("privacy.block-pii")
|
|
37
31
|
@name("Block messages and uploads with PII")
|
|
38
|
-
@description("
|
|
32
|
+
@description("Blocks process_prompt and upload_file when pii_detected is true.")
|
|
39
33
|
@severity("critical")
|
|
40
|
-
@tags("pii,
|
|
41
|
-
@reject_message("Content blocked: personally identifiable information
|
|
34
|
+
@tags("category:privacy,threat:pii,detection:rule,compliance:gdpr,owasp:llm06")
|
|
35
|
+
@reject_message("Content blocked: personally identifiable information detected — remove before sending to AI services.")
|
|
42
36
|
forbid (
|
|
43
37
|
principal,
|
|
44
38
|
action in [Sentry::Action::"process_prompt", Sentry::Action::"upload_file"],
|
|
45
39
|
resource
|
|
46
40
|
)
|
|
47
41
|
when {
|
|
48
|
-
context has pii_detected && context.pii_detected
|
|
42
|
+
context has pii_detected && context.pii_detected == true
|
|
49
43
|
};
|
|
50
44
|
|
|
51
45
|
// ---------------------------------------------------------------------------
|
|
52
|
-
// Section 2: Granular PII
|
|
53
|
-
// Blocks specific PII types based on regulatory requirements.
|
|
46
|
+
// Section 2: Granular PII type blocking
|
|
54
47
|
// ---------------------------------------------------------------------------
|
|
55
48
|
|
|
56
|
-
|
|
57
|
-
@id("sentry-pii-block-credit-cards")
|
|
49
|
+
@id("privacy.block-credit-card")
|
|
58
50
|
@name("Block credit card numbers")
|
|
59
|
-
@description("
|
|
51
|
+
@description("Blocks process_prompt and upload_file when pii_types or detected_threats contains \"credit_card\".")
|
|
60
52
|
@severity("critical")
|
|
61
|
-
@tags("
|
|
62
|
-
@reject_message("Content blocked: credit card number patterns detected
|
|
53
|
+
@tags("category:privacy,threat:pii,detection:pattern,compliance:pci-dss")
|
|
54
|
+
@reject_message("Content blocked: credit card number patterns detected — PCI DSS prohibits raw PAN handling.")
|
|
63
55
|
forbid (
|
|
64
56
|
principal,
|
|
65
57
|
action in [Sentry::Action::"process_prompt", Sentry::Action::"upload_file"],
|
|
@@ -70,13 +62,12 @@ when {
|
|
|
70
62
|
(context has detected_threats && context.detected_threats.contains("credit_card"))
|
|
71
63
|
};
|
|
72
64
|
|
|
73
|
-
|
|
74
|
-
@id("sentry-pii-block-ssn")
|
|
65
|
+
@id("privacy.block-ssn")
|
|
75
66
|
@name("Block Social Security Numbers")
|
|
76
|
-
@description("
|
|
67
|
+
@description("Blocks process_prompt and upload_file when pii_types or detected_threats contains \"ssn\".")
|
|
77
68
|
@severity("critical")
|
|
78
|
-
@tags("
|
|
79
|
-
@reject_message("Content blocked: Social Security Number patterns detected.
|
|
69
|
+
@tags("category:privacy,threat:pii,detection:pattern,compliance:gdpr")
|
|
70
|
+
@reject_message("Content blocked: Social Security Number patterns detected.")
|
|
80
71
|
forbid (
|
|
81
72
|
principal,
|
|
82
73
|
action in [Sentry::Action::"process_prompt", Sentry::Action::"upload_file"],
|
|
@@ -87,13 +78,12 @@ when {
|
|
|
87
78
|
(context has detected_threats && context.detected_threats.contains("ssn"))
|
|
88
79
|
};
|
|
89
80
|
|
|
90
|
-
|
|
91
|
-
@id("sentry-pii-block-passport")
|
|
81
|
+
@id("privacy.block-passport")
|
|
92
82
|
@name("Block passport numbers")
|
|
93
|
-
@description("
|
|
83
|
+
@description("Blocks process_prompt and upload_file when pii_types contains \"passport\".")
|
|
94
84
|
@severity("critical")
|
|
95
|
-
@tags("
|
|
96
|
-
@reject_message("Content blocked: passport number patterns detected.
|
|
85
|
+
@tags("category:privacy,threat:pii,detection:pattern,compliance:gdpr")
|
|
86
|
+
@reject_message("Content blocked: passport number patterns detected.")
|
|
97
87
|
forbid (
|
|
98
88
|
principal,
|
|
99
89
|
action in [Sentry::Action::"process_prompt", Sentry::Action::"upload_file"],
|
|
@@ -103,13 +93,12 @@ when {
|
|
|
103
93
|
context has pii_types && context.pii_types.contains("passport")
|
|
104
94
|
};
|
|
105
95
|
|
|
106
|
-
|
|
107
|
-
@id("sentry-pii-block-iban")
|
|
96
|
+
@id("privacy.block-iban")
|
|
108
97
|
@name("Block bank account numbers")
|
|
109
|
-
@description("
|
|
98
|
+
@description("Blocks process_prompt and upload_file when pii_types contains \"iban\".")
|
|
110
99
|
@severity("critical")
|
|
111
|
-
@tags("
|
|
112
|
-
@reject_message("Content blocked: bank account number (IBAN) patterns detected.
|
|
100
|
+
@tags("category:privacy,threat:pii,detection:pattern,compliance:gdpr,compliance:pci-dss")
|
|
101
|
+
@reject_message("Content blocked: bank account number (IBAN) patterns detected.")
|
|
113
102
|
forbid (
|
|
114
103
|
principal,
|
|
115
104
|
action in [Sentry::Action::"process_prompt", Sentry::Action::"upload_file"],
|
|
@@ -119,13 +108,12 @@ when {
|
|
|
119
108
|
context has pii_types && context.pii_types.contains("iban")
|
|
120
109
|
};
|
|
121
110
|
|
|
122
|
-
|
|
123
|
-
@id("sentry-pii-block-bulk-exposure")
|
|
111
|
+
@id("privacy.block-pii-bulk")
|
|
124
112
|
@name("Block bulk PII exposure")
|
|
125
|
-
@description("
|
|
113
|
+
@description("Blocks process_prompt and upload_file when pii_count >= 3.")
|
|
126
114
|
@severity("critical")
|
|
127
|
-
@tags("pii,
|
|
128
|
-
@reject_message("Content blocked:
|
|
115
|
+
@tags("category:privacy,threat:pii,threat:exfiltration,detection:aggregate,compliance:gdpr")
|
|
116
|
+
@reject_message("Content blocked: 3+ PII items detected — bulk personal data must not be shared with AI services.")
|
|
129
117
|
forbid (
|
|
130
118
|
principal,
|
|
131
119
|
action in [Sentry::Action::"process_prompt", Sentry::Action::"upload_file"],
|
|
@@ -136,38 +124,30 @@ when {
|
|
|
136
124
|
};
|
|
137
125
|
|
|
138
126
|
// ---------------------------------------------------------------------------
|
|
139
|
-
// Section 3:
|
|
140
|
-
// Catches PII patterns via ML classifier that escape regex detection.
|
|
127
|
+
// Section 3: ML classifier and aggregation
|
|
141
128
|
// ---------------------------------------------------------------------------
|
|
142
129
|
|
|
143
|
-
|
|
144
|
-
@
|
|
145
|
-
@
|
|
146
|
-
@description("Block messages and file uploads when the PII confidence score exceeds threshold (80/100). Catches novel PII patterns including names, addresses, and identifiers that regex rules may miss.")
|
|
130
|
+
@id("privacy.block-pii-ml")
|
|
131
|
+
@name("Block high-confidence PII (ML)")
|
|
132
|
+
@description("Blocks process_prompt and upload_file when pii_score >= 80.")
|
|
147
133
|
@severity("critical")
|
|
148
|
-
@tags("pii,
|
|
149
|
-
@reject_message("Content blocked: the ML classifier detected personally identifiable information with high confidence.
|
|
134
|
+
@tags("category:privacy,threat:pii,detection:ml,compliance:gdpr,compliance:hipaa")
|
|
135
|
+
@reject_message("Content blocked: the ML classifier detected personally identifiable information with high confidence.")
|
|
150
136
|
forbid (
|
|
151
137
|
principal,
|
|
152
138
|
action in [Sentry::Action::"process_prompt", Sentry::Action::"upload_file"],
|
|
153
139
|
resource
|
|
154
140
|
)
|
|
155
141
|
when {
|
|
156
|
-
context has
|
|
142
|
+
context has pii_score && context.pii_score >= 80
|
|
157
143
|
};
|
|
158
144
|
|
|
159
|
-
|
|
160
|
-
// Section 4: PII Threat Category
|
|
161
|
-
// Defense-in-depth via threat aggregation layer.
|
|
162
|
-
// ---------------------------------------------------------------------------
|
|
163
|
-
|
|
164
|
-
// Block PII threat category
|
|
165
|
-
@id("sentry-pii-block-threat-category")
|
|
145
|
+
@id("privacy.block-pii-category")
|
|
166
146
|
@name("Block PII threat category")
|
|
167
|
-
@description("
|
|
147
|
+
@description("Blocks process_prompt and upload_file when threat_categories contains \"pii\".")
|
|
168
148
|
@severity("high")
|
|
169
|
-
@tags("pii,
|
|
170
|
-
@reject_message("Content blocked: threat scanners
|
|
149
|
+
@tags("category:privacy,threat:pii,detection:aggregate,compliance:gdpr")
|
|
150
|
+
@reject_message("Content blocked: threat scanners aggregated a PII threat category.")
|
|
171
151
|
forbid (
|
|
172
152
|
principal,
|
|
173
153
|
action in [Sentry::Action::"process_prompt", Sentry::Action::"upload_file"],
|
|
@@ -176,4 +156,3 @@ forbid (
|
|
|
176
156
|
when {
|
|
177
157
|
context has threat_categories && context.threat_categories.contains("pii")
|
|
178
158
|
};
|
|
179
|
-
|