@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
|
@@ -7,67 +7,59 @@
|
|
|
7
7
|
// =============================================================================
|
|
8
8
|
// EMBEDDED CEDAR POLICY TEXT
|
|
9
9
|
// =============================================================================
|
|
10
|
-
const
|
|
11
|
-
// Baseline Permit
|
|
10
|
+
const SENTRY_ORGANIZATION_PERMIT_BASELINE_CEDAR = `// =============================================================================
|
|
11
|
+
// Baseline Permit (Default)
|
|
12
12
|
// =============================================================================
|
|
13
|
-
// Permits all actions by default. Threat-specific forbid policies
|
|
14
|
-
// this
|
|
13
|
+
// Permits all Sentry actions by default. Threat-specific forbid policies
|
|
14
|
+
// override this when detectors fire.
|
|
15
15
|
//
|
|
16
|
-
//
|
|
17
|
-
// is denied regardless of forbid rules. This baseline ensures the system
|
|
18
|
-
// is "allow unless blocked" rather than "block everything".
|
|
19
|
-
//
|
|
20
|
-
// Category: organization
|
|
16
|
+
// Category: organization
|
|
21
17
|
// Namespace: Sentry
|
|
22
18
|
// =============================================================================
|
|
23
19
|
|
|
24
|
-
@id("
|
|
25
|
-
@name("Permit
|
|
26
|
-
@description("
|
|
20
|
+
@id("organization.permit-baseline")
|
|
21
|
+
@name("Permit baseline")
|
|
22
|
+
@description("Permits all Sentry actions.")
|
|
27
23
|
@severity("low")
|
|
28
|
-
@tags("
|
|
24
|
+
@tags("category:organization,posture:permit-default")
|
|
29
25
|
permit (
|
|
30
26
|
principal,
|
|
31
27
|
action,
|
|
32
28
|
resource
|
|
33
29
|
);
|
|
34
30
|
`;
|
|
35
|
-
const
|
|
36
|
-
// Semantic Threat Detection
|
|
31
|
+
const SENTRY_SEMANTIC_DEFAULTS_CEDAR = `// =============================================================================
|
|
32
|
+
// Semantic Threat Detection (Default)
|
|
37
33
|
// =============================================================================
|
|
38
|
-
//
|
|
39
|
-
//
|
|
40
|
-
//
|
|
34
|
+
// Blocks prompt injection, jailbreak attempts, and high-severity threats in
|
|
35
|
+
// messages and file uploads. Paste-targeted semantic rules live in
|
|
36
|
+
// clipboard.cedar.
|
|
37
|
+
//
|
|
38
|
+
// Detection layers:
|
|
39
|
+
// - Rule triggers (detected_threats) — always available
|
|
40
|
+
// - ML classifier scores (injection_score, jailbreak_score) — require API token
|
|
41
|
+
// - Threat severity aggregation (highest_severity) — catch-all
|
|
41
42
|
//
|
|
42
|
-
//
|
|
43
|
-
//
|
|
44
|
-
//
|
|
45
|
-
//
|
|
43
|
+
// Context keys consumed:
|
|
44
|
+
// - detected_threats: Set<String>
|
|
45
|
+
// - injection_score: Long (0-100)
|
|
46
|
+
// - jailbreak_score: Long (0-100)
|
|
47
|
+
// - highest_severity: String
|
|
46
48
|
//
|
|
47
49
|
// Compliance:
|
|
48
|
-
// OWASP LLM01
|
|
49
|
-
//
|
|
50
|
-
// MITRE ATLAS AML.T0051 (LLM Prompt Injection)
|
|
51
|
-
// MITRE ATLAS AML.T0054 (LLM Jailbreak)
|
|
52
|
-
// NIST 800-53 SI-3, SI-4
|
|
50
|
+
// - OWASP LLM01, LLM02; MITRE ATLAS AML.T0051, AML.T0054
|
|
51
|
+
// - NIST 800-53 SI-3, SI-4
|
|
53
52
|
//
|
|
54
|
-
// Category:
|
|
53
|
+
// Category: semantic
|
|
55
54
|
// Namespace: Sentry
|
|
56
55
|
// =============================================================================
|
|
57
56
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
// Paste-targeted injection rules live in clipboard.cedar.
|
|
62
|
-
// ---------------------------------------------------------------------------
|
|
63
|
-
|
|
64
|
-
// Block messages with prompt injection patterns
|
|
65
|
-
@id("sentry-semantic-block-injection")
|
|
66
|
-
@name("Block prompt injection")
|
|
67
|
-
@description("Block messages when detection engine rules identify prompt injection patterns. Catches instruction override, role assumption, and manipulation techniques in user input (OWASP LLM01).")
|
|
57
|
+
@id("semantic.block-injection-rule")
|
|
58
|
+
@name("Block injection (rule)")
|
|
59
|
+
@description("Blocks process_prompt when detected_threats contains \\"prompt_injection\\".")
|
|
68
60
|
@severity("critical")
|
|
69
|
-
@tags("injection,
|
|
70
|
-
@reject_message("
|
|
61
|
+
@tags("category:semantic,threat:injection,detection:rule,surface:process-prompt,owasp:llm01,mitre:atlas-t0051")
|
|
62
|
+
@reject_message("Prompt blocked: prompt injection patterns detected (OWASP LLM01).")
|
|
71
63
|
forbid (
|
|
72
64
|
principal,
|
|
73
65
|
action == Sentry::Action::"process_prompt",
|
|
@@ -77,12 +69,11 @@ when {
|
|
|
77
69
|
context has detected_threats && context.detected_threats.contains("prompt_injection")
|
|
78
70
|
};
|
|
79
71
|
|
|
80
|
-
|
|
81
|
-
@
|
|
82
|
-
@
|
|
83
|
-
@description("Block content when the ML injection classifier confidence exceeds threshold (75/100). Catches novel injection techniques including polymorphic payloads, encoding tricks, and obfuscated instructions.")
|
|
72
|
+
@id("semantic.block-injection-ml")
|
|
73
|
+
@name("Block injection (ML)")
|
|
74
|
+
@description("Blocks process_prompt and upload_file when injection_score >= 75.")
|
|
84
75
|
@severity("critical")
|
|
85
|
-
@tags("injection,ml
|
|
76
|
+
@tags("category:semantic,threat:injection,detection:ml,owasp:llm01,mitre:atlas-t0051")
|
|
86
77
|
@reject_message("Content blocked: the ML classifier detected prompt injection with high confidence.")
|
|
87
78
|
forbid (
|
|
88
79
|
principal,
|
|
@@ -93,18 +84,12 @@ when {
|
|
|
93
84
|
context has injection_score && context.injection_score >= 75
|
|
94
85
|
};
|
|
95
86
|
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
// ---------------------------------------------------------------------------
|
|
100
|
-
|
|
101
|
-
// Block messages with jailbreak attempts
|
|
102
|
-
@id("sentry-semantic-block-jailbreak")
|
|
103
|
-
@name("Block jailbreak attempts")
|
|
104
|
-
@description("Block messages when detection engine rules identify jailbreak patterns: DAN-style prompts, role-play exploits, safety bypass instructions, and constraint removal attempts (OWASP LLM02).")
|
|
87
|
+
@id("semantic.block-jailbreak-rule")
|
|
88
|
+
@name("Block jailbreak (rule)")
|
|
89
|
+
@description("Blocks process_prompt when detected_threats contains \\"jailbreak\\".")
|
|
105
90
|
@severity("critical")
|
|
106
|
-
@tags("jailbreak,
|
|
107
|
-
@reject_message("
|
|
91
|
+
@tags("category:semantic,threat:jailbreak,detection:rule,surface:process-prompt,owasp:llm02,mitre:atlas-t0054")
|
|
92
|
+
@reject_message("Prompt blocked: jailbreak patterns detected (OWASP LLM02).")
|
|
108
93
|
forbid (
|
|
109
94
|
principal,
|
|
110
95
|
action == Sentry::Action::"process_prompt",
|
|
@@ -114,13 +99,12 @@ when {
|
|
|
114
99
|
context has detected_threats && context.detected_threats.contains("jailbreak")
|
|
115
100
|
};
|
|
116
101
|
|
|
117
|
-
|
|
118
|
-
@
|
|
119
|
-
@
|
|
120
|
-
@description("Block content when the ML jailbreak classifier exceeds threshold (75/100). Catches sophisticated jailbreak techniques including multi-turn manipulation and encoded payloads.")
|
|
102
|
+
@id("semantic.block-jailbreak-ml")
|
|
103
|
+
@name("Block jailbreak (ML)")
|
|
104
|
+
@description("Blocks process_prompt when jailbreak_score >= 75.")
|
|
121
105
|
@severity("critical")
|
|
122
|
-
@tags("jailbreak,ml-
|
|
123
|
-
@reject_message("
|
|
106
|
+
@tags("category:semantic,threat:jailbreak,detection:ml,surface:process-prompt,owasp:llm02,mitre:atlas-t0054")
|
|
107
|
+
@reject_message("Prompt blocked: the ML classifier detected a jailbreak attempt with high confidence.")
|
|
124
108
|
forbid (
|
|
125
109
|
principal,
|
|
126
110
|
action == Sentry::Action::"process_prompt",
|
|
@@ -130,18 +114,12 @@ when {
|
|
|
130
114
|
context has jailbreak_score && context.jailbreak_score >= 75
|
|
131
115
|
};
|
|
132
116
|
|
|
133
|
-
|
|
134
|
-
// Section 3: Threat Severity Aggregation
|
|
135
|
-
// Catch-all rules based on aggregated threat severity across all detectors.
|
|
136
|
-
// ---------------------------------------------------------------------------
|
|
137
|
-
|
|
138
|
-
// Block any content with critical severity threats
|
|
139
|
-
@id("sentry-semantic-block-critical")
|
|
117
|
+
@id("semantic.block-critical")
|
|
140
118
|
@name("Block critical threats")
|
|
141
|
-
@description("
|
|
119
|
+
@description("Blocks process_prompt and upload_file when highest_severity equals \\"critical\\".")
|
|
142
120
|
@severity("critical")
|
|
143
|
-
@tags("
|
|
144
|
-
@reject_message("Content blocked:
|
|
121
|
+
@tags("category:semantic,detection:aggregate,posture:catch-all")
|
|
122
|
+
@reject_message("Content blocked: a critical-severity threat was reported by at least one detector.")
|
|
145
123
|
forbid (
|
|
146
124
|
principal,
|
|
147
125
|
action in [Sentry::Action::"process_prompt", Sentry::Action::"upload_file"],
|
|
@@ -150,43 +128,36 @@ forbid (
|
|
|
150
128
|
when {
|
|
151
129
|
context has highest_severity && context.highest_severity == "critical"
|
|
152
130
|
};
|
|
153
|
-
|
|
154
131
|
`;
|
|
155
|
-
const
|
|
156
|
-
// Content Safety
|
|
132
|
+
const SENTRY_TRUST_SAFETY_DEFAULTS_CEDAR = `// =============================================================================
|
|
133
|
+
// Content Safety (Default)
|
|
157
134
|
// =============================================================================
|
|
158
|
-
//
|
|
159
|
-
//
|
|
135
|
+
// Blocks violent, harmful, hateful, sexual, and profane content across
|
|
136
|
+
// messages and file uploads. Paste-targeted content rules live in
|
|
137
|
+
// clipboard.cedar.
|
|
160
138
|
//
|
|
161
|
-
//
|
|
162
|
-
//
|
|
139
|
+
// Thresholds:
|
|
140
|
+
// - violence, weapons, sexual, crime: >= 80 (critical/high)
|
|
141
|
+
// - hate_speech: >= 75 (lower threshold, zero tolerance)
|
|
142
|
+
// - profanity: >= 90 (higher threshold, allows normal expression)
|
|
163
143
|
//
|
|
164
|
-
//
|
|
165
|
-
//
|
|
144
|
+
// Context keys consumed:
|
|
145
|
+
// - violence_score, weapons_score, hate_speech_score: Long (0-100)
|
|
146
|
+
// - crime_score, sexual_score, profanity_score: Long (0-100)
|
|
166
147
|
//
|
|
167
148
|
// Compliance:
|
|
168
|
-
// NIST 800-53 SI-4
|
|
169
|
-
// EU AI Act Art. 52 (Transparency for AI Systems)
|
|
170
|
-
// OWASP LLM02 (Insecure Output Handling)
|
|
171
|
-
// ISO 42001 (AI Management System)
|
|
149
|
+
// - NIST 800-53 SI-4; EU AI Act Art. 52; ISO 42001; OWASP LLM02
|
|
172
150
|
//
|
|
173
|
-
// Category:
|
|
151
|
+
// Category: trust-safety
|
|
174
152
|
// Namespace: Sentry
|
|
175
153
|
// =============================================================================
|
|
176
154
|
|
|
177
|
-
|
|
178
|
-
// Section 1: Violence & Weapons
|
|
179
|
-
// Blocks content promoting, describing, or instructing violence and weapons.
|
|
180
|
-
// Applies to messages and file uploads.
|
|
181
|
-
// ---------------------------------------------------------------------------
|
|
182
|
-
|
|
183
|
-
// Block violent content across all input channels
|
|
184
|
-
@id("sentry-cs-block-violence")
|
|
155
|
+
@id("trust-safety.block-violence")
|
|
185
156
|
@name("Block violent content")
|
|
186
|
-
@description("
|
|
157
|
+
@description("Blocks process_prompt and upload_file when violence_score >= 80.")
|
|
187
158
|
@severity("critical")
|
|
188
|
-
@tags("
|
|
189
|
-
@reject_message("Content blocked: violent content detected.
|
|
159
|
+
@tags("category:trust-safety,threat:violence,detection:ml,compliance:nist-si-4,compliance:iso-42001")
|
|
160
|
+
@reject_message("Content blocked: violent content detected.")
|
|
190
161
|
forbid (
|
|
191
162
|
principal,
|
|
192
163
|
action in [Sentry::Action::"process_prompt", Sentry::Action::"upload_file"],
|
|
@@ -196,13 +167,12 @@ when {
|
|
|
196
167
|
context has violence_score && context.violence_score >= 80
|
|
197
168
|
};
|
|
198
169
|
|
|
199
|
-
|
|
200
|
-
@id("sentry-cs-block-weapons")
|
|
170
|
+
@id("trust-safety.block-weapons")
|
|
201
171
|
@name("Block weapons content")
|
|
202
|
-
@description("
|
|
172
|
+
@description("Blocks process_prompt and upload_file when weapons_score >= 80.")
|
|
203
173
|
@severity("critical")
|
|
204
|
-
@tags("
|
|
205
|
-
@reject_message("Content blocked: weapons-related content detected.
|
|
174
|
+
@tags("category:trust-safety,threat:weapons,detection:ml,compliance:nist-si-4")
|
|
175
|
+
@reject_message("Content blocked: weapons-related content detected.")
|
|
206
176
|
forbid (
|
|
207
177
|
principal,
|
|
208
178
|
action in [Sentry::Action::"process_prompt", Sentry::Action::"upload_file"],
|
|
@@ -212,18 +182,12 @@ when {
|
|
|
212
182
|
context has weapons_score && context.weapons_score >= 80
|
|
213
183
|
};
|
|
214
184
|
|
|
215
|
-
|
|
216
|
-
// Section 2: Hate Speech & Discrimination
|
|
217
|
-
// Lower threshold (75) — enterprises have zero tolerance for hate speech.
|
|
218
|
-
// ---------------------------------------------------------------------------
|
|
219
|
-
|
|
220
|
-
// Block hate speech content
|
|
221
|
-
@id("sentry-cs-block-hate-speech")
|
|
185
|
+
@id("trust-safety.block-hate-speech")
|
|
222
186
|
@name("Block hate speech")
|
|
223
|
-
@description("
|
|
187
|
+
@description("Blocks process_prompt and upload_file when hate_speech_score >= 75.")
|
|
224
188
|
@severity("critical")
|
|
225
|
-
@tags("hate-speech,
|
|
226
|
-
@reject_message("Content blocked: hate speech or discriminatory content detected.
|
|
189
|
+
@tags("category:trust-safety,threat:hate-speech,detection:ml,compliance:nist-si-4,compliance:eu-ai-act")
|
|
190
|
+
@reject_message("Content blocked: hate speech or discriminatory content detected.")
|
|
227
191
|
forbid (
|
|
228
192
|
principal,
|
|
229
193
|
action in [Sentry::Action::"process_prompt", Sentry::Action::"upload_file"],
|
|
@@ -233,17 +197,12 @@ when {
|
|
|
233
197
|
context has hate_speech_score && context.hate_speech_score >= 75
|
|
234
198
|
};
|
|
235
199
|
|
|
236
|
-
|
|
237
|
-
// Section 3: Criminal Content
|
|
238
|
-
// ---------------------------------------------------------------------------
|
|
239
|
-
|
|
240
|
-
// Block criminal content
|
|
241
|
-
@id("sentry-cs-block-crime")
|
|
200
|
+
@id("trust-safety.block-crime")
|
|
242
201
|
@name("Block criminal content")
|
|
243
|
-
@description("
|
|
202
|
+
@description("Blocks process_prompt and upload_file when crime_score >= 80.")
|
|
244
203
|
@severity("high")
|
|
245
|
-
@tags("
|
|
246
|
-
@reject_message("Content blocked: criminal activity content detected.
|
|
204
|
+
@tags("category:trust-safety,threat:crime,detection:ml,compliance:nist-si-4")
|
|
205
|
+
@reject_message("Content blocked: criminal activity content detected.")
|
|
247
206
|
forbid (
|
|
248
207
|
principal,
|
|
249
208
|
action in [Sentry::Action::"process_prompt", Sentry::Action::"upload_file"],
|
|
@@ -253,17 +212,12 @@ when {
|
|
|
253
212
|
context has crime_score && context.crime_score >= 80
|
|
254
213
|
};
|
|
255
214
|
|
|
256
|
-
|
|
257
|
-
// Section 4: Sexual Content
|
|
258
|
-
// ---------------------------------------------------------------------------
|
|
259
|
-
|
|
260
|
-
// Block sexual content
|
|
261
|
-
@id("sentry-cs-block-sexual")
|
|
215
|
+
@id("trust-safety.block-sexual")
|
|
262
216
|
@name("Block sexual content")
|
|
263
|
-
@description("
|
|
217
|
+
@description("Blocks process_prompt and upload_file when sexual_score >= 80.")
|
|
264
218
|
@severity("high")
|
|
265
|
-
@tags("
|
|
266
|
-
@reject_message("Content blocked:
|
|
219
|
+
@tags("category:trust-safety,threat:sexual,detection:ml,compliance:eu-ai-act,compliance:iso-42001")
|
|
220
|
+
@reject_message("Content blocked: sexually explicit content detected.")
|
|
267
221
|
forbid (
|
|
268
222
|
principal,
|
|
269
223
|
action in [Sentry::Action::"process_prompt", Sentry::Action::"upload_file"],
|
|
@@ -273,18 +227,12 @@ when {
|
|
|
273
227
|
context has sexual_score && context.sexual_score >= 80
|
|
274
228
|
};
|
|
275
229
|
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
// ---------------------------------------------------------------------------
|
|
280
|
-
|
|
281
|
-
// Block excessive profanity
|
|
282
|
-
@id("sentry-cs-block-profanity")
|
|
283
|
-
@name("Block profanity")
|
|
284
|
-
@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.")
|
|
230
|
+
@id("trust-safety.block-profanity")
|
|
231
|
+
@name("Block excessive profanity")
|
|
232
|
+
@description("Blocks process_prompt when profanity_score >= 90.")
|
|
285
233
|
@severity("medium")
|
|
286
|
-
@tags("
|
|
287
|
-
@reject_message("Content blocked: excessive profanity detected
|
|
234
|
+
@tags("category:trust-safety,threat:profanity,detection:ml,surface:process-prompt")
|
|
235
|
+
@reject_message("Content blocked: excessive profanity detected — please rephrase in professional language.")
|
|
288
236
|
forbid (
|
|
289
237
|
principal,
|
|
290
238
|
action == Sentry::Action::"process_prompt",
|
|
@@ -293,43 +241,48 @@ forbid (
|
|
|
293
241
|
when {
|
|
294
242
|
context has profanity_score && context.profanity_score >= 90
|
|
295
243
|
};
|
|
296
|
-
|
|
297
244
|
`;
|
|
298
|
-
const
|
|
299
|
-
// Secrets Detection
|
|
245
|
+
const SENTRY_DATA_PROTECTION_DEFAULTS_CEDAR = `// =============================================================================
|
|
246
|
+
// Secrets Detection (Default)
|
|
300
247
|
// =============================================================================
|
|
301
|
-
//
|
|
302
|
-
//
|
|
248
|
+
// Blocks credentials and secrets across messages and file uploads. Covers
|
|
249
|
+
// general detection, high-risk credential types, common API keys, SSH and
|
|
250
|
+
// PEM key material, bulk exposure, and detector rule triggers.
|
|
303
251
|
//
|
|
304
|
-
//
|
|
252
|
+
// Context keys consumed:
|
|
253
|
+
// - secrets_detected: Bool
|
|
254
|
+
// - secret_types: Set<String>
|
|
255
|
+
// - secret_count: Long
|
|
256
|
+
// - detected_threats: Set<String>
|
|
257
|
+
//
|
|
258
|
+
// Compliance:
|
|
259
|
+
// - NIST 800-53 SC-28, IA-5; MITRE ATT&CK T1552
|
|
305
260
|
//
|
|
306
|
-
// Category:
|
|
261
|
+
// Category: data-protection
|
|
307
262
|
// Namespace: Sentry
|
|
308
263
|
// =============================================================================
|
|
309
264
|
|
|
310
|
-
|
|
311
|
-
@
|
|
312
|
-
@
|
|
313
|
-
@description("Block messages and file uploads when detection engines identify API keys, tokens, or credential patterns. First line of defense against accidental credential exposure in AI chat interactions.")
|
|
265
|
+
@id("data-protection.block-secrets")
|
|
266
|
+
@name("Block secrets in messages and uploads")
|
|
267
|
+
@description("Blocks process_prompt and upload_file when secrets_detected is true.")
|
|
314
268
|
@severity("critical")
|
|
315
|
-
@tags("secrets,
|
|
316
|
-
@reject_message("Content blocked:
|
|
269
|
+
@tags("category:data-protection,threat:secrets,detection:rule,owasp:llm06")
|
|
270
|
+
@reject_message("Content blocked: secrets such as API keys, tokens, or credentials detected — remove before sending to AI services.")
|
|
317
271
|
forbid (
|
|
318
272
|
principal,
|
|
319
273
|
action in [Sentry::Action::"process_prompt", Sentry::Action::"upload_file"],
|
|
320
274
|
resource
|
|
321
275
|
)
|
|
322
276
|
when {
|
|
323
|
-
context has
|
|
277
|
+
context has secrets_detected && context.secrets_detected == true
|
|
324
278
|
};
|
|
325
279
|
|
|
326
|
-
|
|
327
|
-
@id("sentry-org-block-high-risk-secrets")
|
|
280
|
+
@id("data-protection.block-high-risk-secrets")
|
|
328
281
|
@name("Block high-risk credential types")
|
|
329
|
-
@description("
|
|
282
|
+
@description("Blocks process_prompt and upload_file when secret_types contains a cloud, GitHub, or private-key credential.")
|
|
330
283
|
@severity("critical")
|
|
331
|
-
@tags("secrets,
|
|
332
|
-
@reject_message("Content blocked: high-risk credentials detected (cloud keys, GitHub tokens, SSH keys)
|
|
284
|
+
@tags("category:data-protection,threat:secrets,detection:rule,owasp:llm06")
|
|
285
|
+
@reject_message("Content blocked: high-risk credentials detected (cloud keys, GitHub tokens, SSH keys) — never share credentials with AI services.")
|
|
333
286
|
forbid (
|
|
334
287
|
principal,
|
|
335
288
|
action in [Sentry::Action::"process_prompt", Sentry::Action::"upload_file"],
|
|
@@ -337,22 +290,23 @@ forbid (
|
|
|
337
290
|
)
|
|
338
291
|
when {
|
|
339
292
|
context has secret_types &&
|
|
340
|
-
(
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
293
|
+
(
|
|
294
|
+
context.secret_types.contains("aws_access_key") ||
|
|
295
|
+
context.secret_types.contains("aws_secret_key") ||
|
|
296
|
+
context.secret_types.contains("gcp_service_account") ||
|
|
297
|
+
context.secret_types.contains("azure_connection_string") ||
|
|
298
|
+
context.secret_types.contains("github_token") ||
|
|
299
|
+
context.secret_types.contains("github_fine_grained") ||
|
|
300
|
+
context.secret_types.contains("private_key")
|
|
301
|
+
)
|
|
302
|
+
};
|
|
303
|
+
|
|
304
|
+
@id("data-protection.block-api-keys")
|
|
351
305
|
@name("Block API keys and tokens")
|
|
352
|
-
@description("
|
|
306
|
+
@description("Blocks process_prompt and upload_file when secret_types contains a generic API key, JWT, OpenAI, Anthropic, or Stripe key.")
|
|
353
307
|
@severity("high")
|
|
354
|
-
@tags("
|
|
355
|
-
@reject_message("Content blocked: API keys, JWT tokens, or OAuth credentials detected.
|
|
308
|
+
@tags("category:data-protection,threat:secrets,detection:rule,owasp:llm06")
|
|
309
|
+
@reject_message("Content blocked: API keys, JWT tokens, or OAuth credentials detected.")
|
|
356
310
|
forbid (
|
|
357
311
|
principal,
|
|
358
312
|
action in [Sentry::Action::"process_prompt", Sentry::Action::"upload_file"],
|
|
@@ -360,20 +314,21 @@ forbid (
|
|
|
360
314
|
)
|
|
361
315
|
when {
|
|
362
316
|
context has secret_types &&
|
|
363
|
-
(
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
317
|
+
(
|
|
318
|
+
context.secret_types.contains("generic_api_key") ||
|
|
319
|
+
context.secret_types.contains("jwt_token") ||
|
|
320
|
+
context.secret_types.contains("openai_key") ||
|
|
321
|
+
context.secret_types.contains("anthropic_key") ||
|
|
322
|
+
context.secret_types.contains("stripe_key")
|
|
323
|
+
)
|
|
368
324
|
};
|
|
369
325
|
|
|
370
|
-
|
|
371
|
-
@id("sentry-secrets-block-ssh-keys")
|
|
326
|
+
@id("data-protection.block-ssh-keys")
|
|
372
327
|
@name("Block SSH key exposure")
|
|
373
|
-
@description("
|
|
328
|
+
@description("Blocks process_prompt and upload_file when secret_types contains \\"ssh_key\\".")
|
|
374
329
|
@severity("critical")
|
|
375
|
-
@tags("secrets,
|
|
376
|
-
@reject_message("
|
|
330
|
+
@tags("category:data-protection,threat:secrets,detection:rule,compliance:nist-si-3")
|
|
331
|
+
@reject_message("Content blocked: SSH private key content or key file path detected.")
|
|
377
332
|
forbid (
|
|
378
333
|
principal,
|
|
379
334
|
action in [Sentry::Action::"process_prompt", Sentry::Action::"upload_file"],
|
|
@@ -383,13 +338,12 @@ when {
|
|
|
383
338
|
context has secret_types && context.secret_types.contains("ssh_key")
|
|
384
339
|
};
|
|
385
340
|
|
|
386
|
-
|
|
387
|
-
@
|
|
388
|
-
@
|
|
389
|
-
@description("Block when PEM private key content or certificate key file paths (.pem, .key, .p12, .pfx) are detected. AI chat services must not receive certificate credentials.")
|
|
341
|
+
@id("data-protection.block-pem-keys")
|
|
342
|
+
@name("Block PEM and certificate keys")
|
|
343
|
+
@description("Blocks process_prompt and upload_file when secret_types contains \\"pem_certificate\\".")
|
|
390
344
|
@severity("critical")
|
|
391
|
-
@tags("secrets,
|
|
392
|
-
@reject_message("
|
|
345
|
+
@tags("category:data-protection,threat:secrets,detection:rule,compliance:nist-si-3")
|
|
346
|
+
@reject_message("Content blocked: PEM private key or certificate key file detected.")
|
|
393
347
|
forbid (
|
|
394
348
|
principal,
|
|
395
349
|
action in [Sentry::Action::"process_prompt", Sentry::Action::"upload_file"],
|
|
@@ -399,13 +353,12 @@ when {
|
|
|
399
353
|
context has secret_types && context.secret_types.contains("pem_certificate")
|
|
400
354
|
};
|
|
401
355
|
|
|
402
|
-
|
|
403
|
-
@id("sentry-org-block-bulk-secrets")
|
|
356
|
+
@id("data-protection.block-secrets-bulk")
|
|
404
357
|
@name("Block bulk secret exposure")
|
|
405
|
-
@description("
|
|
358
|
+
@description("Blocks process_prompt and upload_file when secret_count >= 3.")
|
|
406
359
|
@severity("critical")
|
|
407
|
-
@tags("secrets,
|
|
408
|
-
@reject_message("Content blocked: multiple credentials detected (3+)
|
|
360
|
+
@tags("category:data-protection,threat:secrets,threat:exfiltration,detection:aggregate,owasp:llm06")
|
|
361
|
+
@reject_message("Content blocked: multiple credentials detected (3+) — possible configuration dump or credential harvesting.")
|
|
409
362
|
forbid (
|
|
410
363
|
principal,
|
|
411
364
|
action in [Sentry::Action::"process_prompt", Sentry::Action::"upload_file"],
|
|
@@ -415,13 +368,12 @@ when {
|
|
|
415
368
|
context has secret_count && context.secret_count >= 3
|
|
416
369
|
};
|
|
417
370
|
|
|
418
|
-
|
|
419
|
-
@id("sentry-org-block-detected-credentials")
|
|
371
|
+
@id("data-protection.block-credential-patterns")
|
|
420
372
|
@name("Block detected credential patterns")
|
|
421
|
-
@description("
|
|
373
|
+
@description("Blocks process_prompt and upload_file when detected_threats contains a credential-pattern rule trigger.")
|
|
422
374
|
@severity("critical")
|
|
423
|
-
@tags("secrets,
|
|
424
|
-
@reject_message("Content blocked: detection engines identified credential patterns
|
|
375
|
+
@tags("category:data-protection,threat:secrets,detection:rule,owasp:llm06")
|
|
376
|
+
@reject_message("Content blocked: detection engines identified credential patterns (secret exposure, API key leaks, or token exposure).")
|
|
425
377
|
forbid (
|
|
426
378
|
principal,
|
|
427
379
|
action in [Sentry::Action::"process_prompt", Sentry::Action::"upload_file"],
|
|
@@ -429,73 +381,67 @@ forbid (
|
|
|
429
381
|
)
|
|
430
382
|
when {
|
|
431
383
|
context has detected_threats &&
|
|
432
|
-
(
|
|
433
|
-
|
|
434
|
-
|
|
384
|
+
(
|
|
385
|
+
context.detected_threats.contains("secret_exposure") ||
|
|
386
|
+
context.detected_threats.contains("credential_leak") ||
|
|
387
|
+
context.detected_threats.contains("api_key_exposure")
|
|
388
|
+
)
|
|
435
389
|
};
|
|
436
390
|
`;
|
|
437
|
-
const
|
|
438
|
-
// PII Detection
|
|
391
|
+
const SENTRY_PRIVACY_DEFAULTS_CEDAR = `// =============================================================================
|
|
392
|
+
// PII Detection (Default)
|
|
439
393
|
// =============================================================================
|
|
440
|
-
//
|
|
441
|
-
//
|
|
394
|
+
// Blocks personally identifiable information across messages and file uploads
|
|
395
|
+
// using multi-layered detection: detector boolean, granular PII type
|
|
396
|
+
// matching, ML classifier confidence, threat category aggregation, and bulk
|
|
397
|
+
// exposure thresholds.
|
|
442
398
|
//
|
|
443
399
|
// Paste-targeted PII rules live in clipboard.cedar.
|
|
444
400
|
//
|
|
445
|
-
//
|
|
446
|
-
//
|
|
447
|
-
//
|
|
448
|
-
//
|
|
449
|
-
//
|
|
450
|
-
//
|
|
451
|
-
//
|
|
452
|
-
// ssn, credit_card, email, phone_us, ip_address, date_of_birth,
|
|
453
|
-
// passport, iban, aws_key, api_key_generic
|
|
401
|
+
// Context keys consumed:
|
|
402
|
+
// - pii_detected: Bool
|
|
403
|
+
// - pii_types: Set<String>
|
|
404
|
+
// - pii_count: Long
|
|
405
|
+
// - pii_score: Long (0-100)
|
|
406
|
+
// - detected_threats: Set<String>
|
|
407
|
+
// - threat_categories: Set<String>
|
|
454
408
|
//
|
|
455
409
|
// Compliance:
|
|
456
|
-
// PCI DSS 3.4
|
|
457
|
-
// GDPR Art. 32 (Security of Processing)
|
|
458
|
-
// HIPAA §164.312 (Technical Safeguards)
|
|
459
|
-
// CCPA §1798.150 (Data Protection)
|
|
460
|
-
// OWASP LLM06 (Sensitive Information Disclosure)
|
|
410
|
+
// - PCI DSS 3.4/4.1, GDPR Art. 32, HIPAA §164.312, CCPA §1798.150
|
|
461
411
|
//
|
|
462
|
-
// Category:
|
|
412
|
+
// Category: privacy
|
|
463
413
|
// Namespace: Sentry
|
|
464
414
|
// =============================================================================
|
|
465
415
|
|
|
466
416
|
// ---------------------------------------------------------------------------
|
|
467
|
-
// Section 1: Primary PII
|
|
468
|
-
// Fires when the detection pipeline identifies PII in any content.
|
|
417
|
+
// Section 1: Primary PII detection
|
|
469
418
|
// ---------------------------------------------------------------------------
|
|
470
419
|
|
|
471
|
-
|
|
472
|
-
@id("sentry-pii-block-messages")
|
|
420
|
+
@id("privacy.block-pii")
|
|
473
421
|
@name("Block messages and uploads with PII")
|
|
474
|
-
@description("
|
|
422
|
+
@description("Blocks process_prompt and upload_file when pii_detected is true.")
|
|
475
423
|
@severity("critical")
|
|
476
|
-
@tags("pii,
|
|
477
|
-
@reject_message("Content blocked: personally identifiable information
|
|
424
|
+
@tags("category:privacy,threat:pii,detection:rule,compliance:gdpr,owasp:llm06")
|
|
425
|
+
@reject_message("Content blocked: personally identifiable information detected — remove before sending to AI services.")
|
|
478
426
|
forbid (
|
|
479
427
|
principal,
|
|
480
428
|
action in [Sentry::Action::"process_prompt", Sentry::Action::"upload_file"],
|
|
481
429
|
resource
|
|
482
430
|
)
|
|
483
431
|
when {
|
|
484
|
-
context has pii_detected && context.pii_detected
|
|
432
|
+
context has pii_detected && context.pii_detected == true
|
|
485
433
|
};
|
|
486
434
|
|
|
487
435
|
// ---------------------------------------------------------------------------
|
|
488
|
-
// Section 2: Granular PII
|
|
489
|
-
// Blocks specific PII types based on regulatory requirements.
|
|
436
|
+
// Section 2: Granular PII type blocking
|
|
490
437
|
// ---------------------------------------------------------------------------
|
|
491
438
|
|
|
492
|
-
|
|
493
|
-
@id("sentry-pii-block-credit-cards")
|
|
439
|
+
@id("privacy.block-credit-card")
|
|
494
440
|
@name("Block credit card numbers")
|
|
495
|
-
@description("
|
|
441
|
+
@description("Blocks process_prompt and upload_file when pii_types or detected_threats contains \\"credit_card\\".")
|
|
496
442
|
@severity("critical")
|
|
497
|
-
@tags("
|
|
498
|
-
@reject_message("Content blocked: credit card number patterns detected
|
|
443
|
+
@tags("category:privacy,threat:pii,detection:pattern,compliance:pci-dss")
|
|
444
|
+
@reject_message("Content blocked: credit card number patterns detected — PCI DSS prohibits raw PAN handling.")
|
|
499
445
|
forbid (
|
|
500
446
|
principal,
|
|
501
447
|
action in [Sentry::Action::"process_prompt", Sentry::Action::"upload_file"],
|
|
@@ -506,13 +452,12 @@ when {
|
|
|
506
452
|
(context has detected_threats && context.detected_threats.contains("credit_card"))
|
|
507
453
|
};
|
|
508
454
|
|
|
509
|
-
|
|
510
|
-
@id("sentry-pii-block-ssn")
|
|
455
|
+
@id("privacy.block-ssn")
|
|
511
456
|
@name("Block Social Security Numbers")
|
|
512
|
-
@description("
|
|
457
|
+
@description("Blocks process_prompt and upload_file when pii_types or detected_threats contains \\"ssn\\".")
|
|
513
458
|
@severity("critical")
|
|
514
|
-
@tags("
|
|
515
|
-
@reject_message("Content blocked: Social Security Number patterns detected.
|
|
459
|
+
@tags("category:privacy,threat:pii,detection:pattern,compliance:gdpr")
|
|
460
|
+
@reject_message("Content blocked: Social Security Number patterns detected.")
|
|
516
461
|
forbid (
|
|
517
462
|
principal,
|
|
518
463
|
action in [Sentry::Action::"process_prompt", Sentry::Action::"upload_file"],
|
|
@@ -523,13 +468,12 @@ when {
|
|
|
523
468
|
(context has detected_threats && context.detected_threats.contains("ssn"))
|
|
524
469
|
};
|
|
525
470
|
|
|
526
|
-
|
|
527
|
-
@id("sentry-pii-block-passport")
|
|
471
|
+
@id("privacy.block-passport")
|
|
528
472
|
@name("Block passport numbers")
|
|
529
|
-
@description("
|
|
473
|
+
@description("Blocks process_prompt and upload_file when pii_types contains \\"passport\\".")
|
|
530
474
|
@severity("critical")
|
|
531
|
-
@tags("
|
|
532
|
-
@reject_message("Content blocked: passport number patterns detected.
|
|
475
|
+
@tags("category:privacy,threat:pii,detection:pattern,compliance:gdpr")
|
|
476
|
+
@reject_message("Content blocked: passport number patterns detected.")
|
|
533
477
|
forbid (
|
|
534
478
|
principal,
|
|
535
479
|
action in [Sentry::Action::"process_prompt", Sentry::Action::"upload_file"],
|
|
@@ -539,13 +483,12 @@ when {
|
|
|
539
483
|
context has pii_types && context.pii_types.contains("passport")
|
|
540
484
|
};
|
|
541
485
|
|
|
542
|
-
|
|
543
|
-
@id("sentry-pii-block-iban")
|
|
486
|
+
@id("privacy.block-iban")
|
|
544
487
|
@name("Block bank account numbers")
|
|
545
|
-
@description("
|
|
488
|
+
@description("Blocks process_prompt and upload_file when pii_types contains \\"iban\\".")
|
|
546
489
|
@severity("critical")
|
|
547
|
-
@tags("
|
|
548
|
-
@reject_message("Content blocked: bank account number (IBAN) patterns detected.
|
|
490
|
+
@tags("category:privacy,threat:pii,detection:pattern,compliance:gdpr,compliance:pci-dss")
|
|
491
|
+
@reject_message("Content blocked: bank account number (IBAN) patterns detected.")
|
|
549
492
|
forbid (
|
|
550
493
|
principal,
|
|
551
494
|
action in [Sentry::Action::"process_prompt", Sentry::Action::"upload_file"],
|
|
@@ -555,13 +498,12 @@ when {
|
|
|
555
498
|
context has pii_types && context.pii_types.contains("iban")
|
|
556
499
|
};
|
|
557
500
|
|
|
558
|
-
|
|
559
|
-
@id("sentry-pii-block-bulk-exposure")
|
|
501
|
+
@id("privacy.block-pii-bulk")
|
|
560
502
|
@name("Block bulk PII exposure")
|
|
561
|
-
@description("
|
|
503
|
+
@description("Blocks process_prompt and upload_file when pii_count >= 3.")
|
|
562
504
|
@severity("critical")
|
|
563
|
-
@tags("pii,
|
|
564
|
-
@reject_message("Content blocked:
|
|
505
|
+
@tags("category:privacy,threat:pii,threat:exfiltration,detection:aggregate,compliance:gdpr")
|
|
506
|
+
@reject_message("Content blocked: 3+ PII items detected — bulk personal data must not be shared with AI services.")
|
|
565
507
|
forbid (
|
|
566
508
|
principal,
|
|
567
509
|
action in [Sentry::Action::"process_prompt", Sentry::Action::"upload_file"],
|
|
@@ -572,38 +514,30 @@ when {
|
|
|
572
514
|
};
|
|
573
515
|
|
|
574
516
|
// ---------------------------------------------------------------------------
|
|
575
|
-
// Section 3:
|
|
576
|
-
// Catches PII patterns via ML classifier that escape regex detection.
|
|
517
|
+
// Section 3: ML classifier and aggregation
|
|
577
518
|
// ---------------------------------------------------------------------------
|
|
578
519
|
|
|
579
|
-
|
|
580
|
-
@
|
|
581
|
-
@
|
|
582
|
-
@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.")
|
|
520
|
+
@id("privacy.block-pii-ml")
|
|
521
|
+
@name("Block high-confidence PII (ML)")
|
|
522
|
+
@description("Blocks process_prompt and upload_file when pii_score >= 80.")
|
|
583
523
|
@severity("critical")
|
|
584
|
-
@tags("pii,
|
|
585
|
-
@reject_message("Content blocked: the ML classifier detected personally identifiable information with high confidence.
|
|
524
|
+
@tags("category:privacy,threat:pii,detection:ml,compliance:gdpr,compliance:hipaa")
|
|
525
|
+
@reject_message("Content blocked: the ML classifier detected personally identifiable information with high confidence.")
|
|
586
526
|
forbid (
|
|
587
527
|
principal,
|
|
588
528
|
action in [Sentry::Action::"process_prompt", Sentry::Action::"upload_file"],
|
|
589
529
|
resource
|
|
590
530
|
)
|
|
591
531
|
when {
|
|
592
|
-
context has
|
|
532
|
+
context has pii_score && context.pii_score >= 80
|
|
593
533
|
};
|
|
594
534
|
|
|
595
|
-
|
|
596
|
-
// Section 4: PII Threat Category
|
|
597
|
-
// Defense-in-depth via threat aggregation layer.
|
|
598
|
-
// ---------------------------------------------------------------------------
|
|
599
|
-
|
|
600
|
-
// Block PII threat category
|
|
601
|
-
@id("sentry-pii-block-threat-category")
|
|
535
|
+
@id("privacy.block-pii-category")
|
|
602
536
|
@name("Block PII threat category")
|
|
603
|
-
@description("
|
|
537
|
+
@description("Blocks process_prompt and upload_file when threat_categories contains \\"pii\\".")
|
|
604
538
|
@severity("high")
|
|
605
|
-
@tags("pii,
|
|
606
|
-
@reject_message("Content blocked: threat scanners
|
|
539
|
+
@tags("category:privacy,threat:pii,detection:aggregate,compliance:gdpr")
|
|
540
|
+
@reject_message("Content blocked: threat scanners aggregated a PII threat category.")
|
|
607
541
|
forbid (
|
|
608
542
|
principal,
|
|
609
543
|
action in [Sentry::Action::"process_prompt", Sentry::Action::"upload_file"],
|
|
@@ -612,188 +546,173 @@ forbid (
|
|
|
612
546
|
when {
|
|
613
547
|
context has threat_categories && context.threat_categories.contains("pii")
|
|
614
548
|
};
|
|
615
|
-
|
|
616
549
|
`;
|
|
617
|
-
const
|
|
618
|
-
// File & Attachment Safety
|
|
550
|
+
const SENTRY_FILE_SAFETY_DEFAULTS_CEDAR = `// =============================================================================
|
|
551
|
+
// File & Attachment Safety (Default)
|
|
619
552
|
// =============================================================================
|
|
620
553
|
// Blocks file uploads to AI chat services when document content contains
|
|
621
554
|
// secrets or PII.
|
|
622
555
|
//
|
|
623
|
-
//
|
|
624
|
-
//
|
|
625
|
-
//
|
|
556
|
+
// Context keys consumed:
|
|
557
|
+
// - secrets_detected: Bool
|
|
558
|
+
// - pii_detected: Bool
|
|
626
559
|
//
|
|
627
560
|
// Compliance:
|
|
628
|
-
// NIST 800-53 SC-28
|
|
629
|
-
// GDPR Art. 32 (Security of Processing)
|
|
561
|
+
// - NIST 800-53 SC-28; GDPR Art. 32
|
|
630
562
|
//
|
|
631
|
-
// Category:
|
|
563
|
+
// Category: file-safety
|
|
632
564
|
// Namespace: Sentry
|
|
633
565
|
// =============================================================================
|
|
634
566
|
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
// ---------------------------------------------------------------------------
|
|
639
|
-
|
|
640
|
-
// Block text files with secrets
|
|
641
|
-
@id("sentry-file-block-secrets")
|
|
642
|
-
@name("Block text files with secrets")
|
|
643
|
-
@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.")
|
|
567
|
+
@id("file-safety.block-upload-secrets")
|
|
568
|
+
@name("Block file uploads with secrets")
|
|
569
|
+
@description("Blocks upload_file when secrets_detected is true.")
|
|
644
570
|
@severity("critical")
|
|
645
|
-
@tags("
|
|
646
|
-
@reject_message("
|
|
571
|
+
@tags("category:file-safety,threat:secrets,detection:rule,surface:upload-file,owasp:llm06")
|
|
572
|
+
@reject_message("File upload blocked: secrets or credentials detected in document content.")
|
|
647
573
|
forbid (
|
|
648
574
|
principal,
|
|
649
575
|
action == Sentry::Action::"upload_file",
|
|
650
576
|
resource
|
|
651
577
|
)
|
|
652
578
|
when {
|
|
653
|
-
context has
|
|
579
|
+
context has secrets_detected && context.secrets_detected == true
|
|
654
580
|
};
|
|
655
581
|
|
|
656
|
-
|
|
657
|
-
@
|
|
658
|
-
@
|
|
659
|
-
@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.")
|
|
582
|
+
@id("file-safety.block-upload-pii")
|
|
583
|
+
@name("Block file uploads with PII")
|
|
584
|
+
@description("Blocks upload_file when pii_detected is true.")
|
|
660
585
|
@severity("critical")
|
|
661
|
-
@tags("pii,
|
|
662
|
-
@reject_message("File upload blocked: personally identifiable information detected in
|
|
586
|
+
@tags("category:file-safety,threat:pii,detection:rule,surface:upload-file,compliance:gdpr")
|
|
587
|
+
@reject_message("File upload blocked: personally identifiable information detected in document content.")
|
|
663
588
|
forbid (
|
|
664
589
|
principal,
|
|
665
590
|
action == Sentry::Action::"upload_file",
|
|
666
591
|
resource
|
|
667
592
|
)
|
|
668
593
|
when {
|
|
669
|
-
context has pii_detected && context.pii_detected
|
|
594
|
+
context has pii_detected && context.pii_detected == true
|
|
670
595
|
};
|
|
671
596
|
`;
|
|
672
|
-
const
|
|
597
|
+
const SENTRY_CLIPBOARD_DEFAULTS_CEDAR = `// =============================================================================
|
|
673
598
|
// Clipboard Policy (Default)
|
|
674
599
|
// =============================================================================
|
|
675
|
-
// Controls
|
|
676
|
-
//
|
|
677
|
-
//
|
|
678
|
-
//
|
|
679
|
-
//
|
|
680
|
-
//
|
|
681
|
-
//
|
|
682
|
-
// - Paste-with-invisible-character blocking
|
|
600
|
+
// Controls paste operations into AI chat services. Covers blanket paste
|
|
601
|
+
// blocking, paste-with-secrets, paste-with-PII, encoded payload pastes, and
|
|
602
|
+
// pastes containing invisible Unicode characters.
|
|
603
|
+
//
|
|
604
|
+
// All rules scope to action == "paste_content". Other templates
|
|
605
|
+
// (semantic, content_safety, pii, secrets) cover process_prompt and
|
|
606
|
+
// upload_file for the same threat categories.
|
|
683
607
|
//
|
|
684
|
-
//
|
|
685
|
-
//
|
|
686
|
-
//
|
|
608
|
+
// Context keys consumed:
|
|
609
|
+
// - secrets_detected: Bool
|
|
610
|
+
// - pii_detected: Bool
|
|
611
|
+
// - encoded_content_detected: Bool
|
|
612
|
+
// - encoded_score: Long (0-100)
|
|
613
|
+
// - invisible_chars_detected: Bool
|
|
614
|
+
// - invisible_chars_score: Long (0-100)
|
|
615
|
+
//
|
|
616
|
+
// Compliance:
|
|
617
|
+
// - NIST 800-53 SC-28; GDPR Art. 32
|
|
687
618
|
//
|
|
688
|
-
// Category:
|
|
619
|
+
// Category: clipboard
|
|
689
620
|
// Namespace: Sentry
|
|
690
621
|
// =============================================================================
|
|
691
622
|
|
|
692
|
-
|
|
693
|
-
@id("sentry-org-block-all-paste")
|
|
623
|
+
@id("clipboard.block-all-paste")
|
|
694
624
|
@name("Block all paste operations")
|
|
695
|
-
@description("
|
|
625
|
+
@description("Blocks paste_content unconditionally.")
|
|
696
626
|
@severity("high")
|
|
697
|
-
@tags("
|
|
698
|
-
@reject_message("Paste blocked: your organization does not allow pasting content into AI services.
|
|
627
|
+
@tags("category:clipboard,detection:rule,posture:deny-default,scope:org-wide")
|
|
628
|
+
@reject_message("Paste blocked: your organization does not allow pasting content into AI services.")
|
|
699
629
|
forbid (
|
|
700
630
|
principal,
|
|
701
631
|
action == Sentry::Action::"paste_content",
|
|
702
632
|
resource
|
|
703
633
|
);
|
|
704
634
|
|
|
705
|
-
|
|
706
|
-
@id("sentry-org-block-secrets-paste")
|
|
635
|
+
@id("clipboard.block-paste-secrets")
|
|
707
636
|
@name("Block paste with secrets")
|
|
708
|
-
@description("
|
|
637
|
+
@description("Blocks paste_content when secrets_detected is true.")
|
|
709
638
|
@severity("critical")
|
|
710
|
-
@tags("secrets,
|
|
711
|
-
@reject_message("Paste blocked: secrets or credentials detected in pasted content
|
|
639
|
+
@tags("category:clipboard,threat:secrets,detection:rule,owasp:llm06")
|
|
640
|
+
@reject_message("Paste blocked: secrets or credentials detected in pasted content — remove before pasting.")
|
|
712
641
|
forbid (
|
|
713
642
|
principal,
|
|
714
643
|
action == Sentry::Action::"paste_content",
|
|
715
644
|
resource
|
|
716
645
|
)
|
|
717
646
|
when {
|
|
718
|
-
context has
|
|
647
|
+
context has secrets_detected && context.secrets_detected == true
|
|
719
648
|
};
|
|
720
649
|
|
|
721
|
-
|
|
722
|
-
@id("sentry-pii-block-paste")
|
|
650
|
+
@id("clipboard.block-paste-pii")
|
|
723
651
|
@name("Block paste with PII")
|
|
724
|
-
@description("
|
|
652
|
+
@description("Blocks paste_content when pii_detected is true.")
|
|
725
653
|
@severity("critical")
|
|
726
|
-
@tags("pii,
|
|
727
|
-
@reject_message("Paste blocked: personally identifiable information detected in pasted content.
|
|
654
|
+
@tags("category:clipboard,threat:pii,detection:rule,compliance:gdpr")
|
|
655
|
+
@reject_message("Paste blocked: personally identifiable information detected in pasted content.")
|
|
728
656
|
forbid (
|
|
729
657
|
principal,
|
|
730
658
|
action == Sentry::Action::"paste_content",
|
|
731
659
|
resource
|
|
732
660
|
)
|
|
733
661
|
when {
|
|
734
|
-
context has pii_detected && context.pii_detected
|
|
662
|
+
context has pii_detected && context.pii_detected == true
|
|
735
663
|
};
|
|
736
664
|
|
|
737
|
-
|
|
738
|
-
@
|
|
739
|
-
@
|
|
740
|
-
@description("Block paste operations when encoded injection payloads (base64, hex, unicode) are detected. Attackers use encoding to smuggle injection payloads via clipboard transfer.")
|
|
665
|
+
@id("clipboard.block-paste-encoded")
|
|
666
|
+
@name("Block paste with encoded payloads")
|
|
667
|
+
@description("Blocks paste_content when encoded_content_detected is true and encoded_score >= 60.")
|
|
741
668
|
@severity("high")
|
|
742
|
-
@tags("
|
|
743
|
-
@reject_message("Paste blocked: encoded
|
|
669
|
+
@tags("category:clipboard,threat:encoded-payload,threat:injection,detection:pattern,owasp:llm01")
|
|
670
|
+
@reject_message("Paste blocked: encoded payloads (base64, hex, unicode) detected — possible injection evasion.")
|
|
744
671
|
forbid (
|
|
745
672
|
principal,
|
|
746
673
|
action == Sentry::Action::"paste_content",
|
|
747
674
|
resource
|
|
748
675
|
)
|
|
749
676
|
when {
|
|
750
|
-
context has encoded_content_detected && context.encoded_content_detected &&
|
|
677
|
+
context has encoded_content_detected && context.encoded_content_detected == true &&
|
|
751
678
|
context has encoded_score && context.encoded_score >= 60
|
|
752
679
|
};
|
|
753
680
|
|
|
754
|
-
|
|
755
|
-
@id("sentry-clipboard-block-paste-invisible")
|
|
681
|
+
@id("clipboard.block-paste-invisible")
|
|
756
682
|
@name("Block paste with invisible characters")
|
|
757
|
-
@description("
|
|
683
|
+
@description("Blocks paste_content when invisible_chars_detected is true and invisible_chars_score >= 50.")
|
|
758
684
|
@severity("high")
|
|
759
|
-
@tags("
|
|
760
|
-
@reject_message("Paste blocked: invisible Unicode characters detected
|
|
685
|
+
@tags("category:clipboard,threat:invisible-chars,threat:injection,detection:pattern,owasp:llm01")
|
|
686
|
+
@reject_message("Paste blocked: invisible Unicode characters detected — hidden characters can disguise malicious instructions.")
|
|
761
687
|
forbid (
|
|
762
688
|
principal,
|
|
763
689
|
action == Sentry::Action::"paste_content",
|
|
764
690
|
resource
|
|
765
691
|
)
|
|
766
692
|
when {
|
|
767
|
-
context has
|
|
693
|
+
context has invisible_chars_detected && context.invisible_chars_detected == true &&
|
|
768
694
|
context has invisible_chars_score && context.invisible_chars_score >= 50
|
|
769
695
|
};
|
|
770
696
|
`;
|
|
771
|
-
const
|
|
772
|
-
// Organization Rules
|
|
697
|
+
const SENTRY_ORGANIZATION_BLOCK_SESSION_THREAT_ESCALATION_CEDAR = `// =============================================================================
|
|
698
|
+
// Organization Rules (Default)
|
|
773
699
|
// =============================================================================
|
|
774
700
|
// Cross-cutting organization-wide rules that don't fit other categories.
|
|
775
|
-
//
|
|
776
|
-
// in clipboard.cedar.
|
|
701
|
+
// Currently: session-aware threat escalation circuit breaker.
|
|
777
702
|
//
|
|
778
|
-
//
|
|
779
|
-
// -
|
|
703
|
+
// Context keys consumed:
|
|
704
|
+
// - session_threat_turns: Long
|
|
780
705
|
//
|
|
781
|
-
// Category:
|
|
706
|
+
// Category: organization
|
|
782
707
|
// Namespace: Sentry
|
|
783
708
|
// =============================================================================
|
|
784
709
|
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
// ---------------------------------------------------------------------------
|
|
789
|
-
|
|
790
|
-
// Block all actions after repeated threat detection
|
|
791
|
-
@id("sentry-org-session-threat-escalation")
|
|
792
|
-
@name("Escalate after repeated threats")
|
|
793
|
-
@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.")
|
|
710
|
+
@id("organization.block-session-threat-escalation")
|
|
711
|
+
@name("Block session after repeated threats")
|
|
712
|
+
@description("Blocks all actions when session_threat_turns >= 3.")
|
|
794
713
|
@severity("high")
|
|
795
|
-
@tags("
|
|
796
|
-
@reject_message("
|
|
714
|
+
@tags("category:organization,detection:aggregate,posture:catch-all,scope:org-wide")
|
|
715
|
+
@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.")
|
|
797
716
|
forbid (
|
|
798
717
|
principal,
|
|
799
718
|
action,
|
|
@@ -807,26 +726,26 @@ when {
|
|
|
807
726
|
// CATEGORIES
|
|
808
727
|
// =============================================================================
|
|
809
728
|
export const SENTRY_CATEGORIES = [
|
|
810
|
-
{ id: '
|
|
811
|
-
{ id: '
|
|
812
|
-
{ id: 'semantic', name: 'Semantic Threat Detection', description: '
|
|
813
|
-
{ id: '
|
|
814
|
-
{ id: '
|
|
815
|
-
{ id: 'clipboard', name: 'Clipboard Policy', description: 'Control paste operations into AI chat services
|
|
816
|
-
{ id: 'organization', name: 'Organization Rules', description: '
|
|
729
|
+
{ id: 'data-protection', name: 'Secrets & Data Protection', description: 'Block secrets, API keys, tokens, and credentials in messages and uploads.' },
|
|
730
|
+
{ id: 'privacy', name: 'PII Detection', description: 'Block personally identifiable information across messages and uploads.' },
|
|
731
|
+
{ id: 'semantic', name: 'Semantic Threat Detection', description: 'Block prompt injection, jailbreak attempts, and high-severity threats.' },
|
|
732
|
+
{ id: 'trust-safety', name: 'Content Safety', description: 'Block violent, harmful, hateful, sexual, or profane content.' },
|
|
733
|
+
{ id: 'file-safety', name: 'File & Attachment Safety', description: 'Block file uploads containing secrets or PII.' },
|
|
734
|
+
{ id: 'clipboard', name: 'Clipboard Policy', description: 'Control paste operations into AI chat services.' },
|
|
735
|
+
{ id: 'organization', name: 'Organization Rules', description: 'Organization-wide baselines and session-aware threat escalation.' },
|
|
817
736
|
];
|
|
818
737
|
// =============================================================================
|
|
819
738
|
// DEFAULT POLICIES
|
|
820
739
|
// =============================================================================
|
|
821
740
|
export const SENTRY_DEFAULTS = [
|
|
822
741
|
{
|
|
823
|
-
id: '
|
|
742
|
+
id: 'organization.permit-baseline',
|
|
824
743
|
name: 'Baseline Permit',
|
|
825
|
-
description: 'Permits all actions by default
|
|
744
|
+
description: 'Permits all actions by default; threat-specific forbid policies override this when detectors fire.',
|
|
826
745
|
category: 'organization',
|
|
827
|
-
cedarText:
|
|
746
|
+
cedarText: SENTRY_ORGANIZATION_PERMIT_BASELINE_CEDAR,
|
|
828
747
|
severity: 'low',
|
|
829
|
-
tags: ['
|
|
748
|
+
tags: ['category:organization', 'posture:permit-default'],
|
|
830
749
|
isActive: true,
|
|
831
750
|
},
|
|
832
751
|
];
|
|
@@ -835,77 +754,77 @@ export const SENTRY_DEFAULTS = [
|
|
|
835
754
|
// =============================================================================
|
|
836
755
|
export const SENTRY_TEMPLATES = [
|
|
837
756
|
{
|
|
838
|
-
id: '
|
|
757
|
+
id: 'organization.permit-baseline',
|
|
839
758
|
name: 'Baseline Permit',
|
|
840
|
-
description: 'Permits all actions by default
|
|
759
|
+
description: 'Permits all actions by default; threat-specific forbid policies override this when detectors fire.',
|
|
841
760
|
category: 'organization',
|
|
842
|
-
cedarText:
|
|
761
|
+
cedarText: SENTRY_ORGANIZATION_PERMIT_BASELINE_CEDAR,
|
|
843
762
|
severity: 'low',
|
|
844
|
-
tags: ['
|
|
763
|
+
tags: ['category:organization', 'posture:permit-default'],
|
|
845
764
|
autoDeploy: true,
|
|
846
765
|
},
|
|
847
766
|
{
|
|
848
|
-
id: '
|
|
767
|
+
id: 'semantic.defaults',
|
|
849
768
|
name: 'Semantic Threat Detection',
|
|
850
|
-
description: '
|
|
769
|
+
description: 'Block prompt injection, jailbreak attempts, and critical-severity threats in messages and uploads.',
|
|
851
770
|
category: 'semantic',
|
|
852
|
-
cedarText:
|
|
771
|
+
cedarText: SENTRY_SEMANTIC_DEFAULTS_CEDAR,
|
|
853
772
|
severity: 'critical',
|
|
854
|
-
tags: ['injection', 'jailbreak', 'owasp
|
|
773
|
+
tags: ['category:semantic', 'threat:injection', 'threat:jailbreak', 'owasp:llm01', 'owasp:llm02'],
|
|
855
774
|
},
|
|
856
775
|
{
|
|
857
|
-
id: '
|
|
776
|
+
id: 'trust-safety.defaults',
|
|
858
777
|
name: 'Content Safety',
|
|
859
|
-
description: '
|
|
860
|
-
category: '
|
|
861
|
-
cedarText:
|
|
778
|
+
description: 'Block violent, weapons, hateful, criminal, sexual, or excessively profane content.',
|
|
779
|
+
category: 'trust-safety',
|
|
780
|
+
cedarText: SENTRY_TRUST_SAFETY_DEFAULTS_CEDAR,
|
|
862
781
|
severity: 'critical',
|
|
863
|
-
tags: ['
|
|
782
|
+
tags: ['category:trust-safety', 'threat:harmful', 'threat:hate-speech', 'compliance:eu-ai-act', 'compliance:iso-42001'],
|
|
864
783
|
},
|
|
865
784
|
{
|
|
866
|
-
id: '
|
|
785
|
+
id: 'data-protection.defaults',
|
|
867
786
|
name: 'Secrets Detection',
|
|
868
|
-
description: 'Block secrets, API keys, tokens, and credential leakage in messages and AI responses
|
|
869
|
-
category: '
|
|
870
|
-
cedarText:
|
|
787
|
+
description: 'Block secrets, API keys, tokens, and credential leakage in messages and AI responses.',
|
|
788
|
+
category: 'data-protection',
|
|
789
|
+
cedarText: SENTRY_DATA_PROTECTION_DEFAULTS_CEDAR,
|
|
871
790
|
severity: 'critical',
|
|
872
|
-
tags: ['
|
|
791
|
+
tags: ['category:data-protection', 'threat:secrets', 'owasp:llm06'],
|
|
873
792
|
},
|
|
874
793
|
{
|
|
875
|
-
id: '
|
|
794
|
+
id: 'privacy.defaults',
|
|
876
795
|
name: 'PII Detection',
|
|
877
|
-
description: '
|
|
878
|
-
category: '
|
|
879
|
-
cedarText:
|
|
796
|
+
description: 'Block credit card numbers, SSNs, passport/IBAN, and other PII across messages and file uploads.',
|
|
797
|
+
category: 'privacy',
|
|
798
|
+
cedarText: SENTRY_PRIVACY_DEFAULTS_CEDAR,
|
|
880
799
|
severity: 'critical',
|
|
881
|
-
tags: ['
|
|
800
|
+
tags: ['category:privacy', 'threat:pii', 'compliance:pci-dss', 'compliance:gdpr', 'compliance:hipaa'],
|
|
882
801
|
},
|
|
883
802
|
{
|
|
884
|
-
id: '
|
|
803
|
+
id: 'file-safety.defaults',
|
|
885
804
|
name: 'File & Attachment Safety',
|
|
886
|
-
description: 'Block file uploads containing secrets or PII in document content',
|
|
887
|
-
category: '
|
|
888
|
-
cedarText:
|
|
805
|
+
description: 'Block file uploads containing secrets or PII in document content.',
|
|
806
|
+
category: 'file-safety',
|
|
807
|
+
cedarText: SENTRY_FILE_SAFETY_DEFAULTS_CEDAR,
|
|
889
808
|
severity: 'critical',
|
|
890
|
-
tags: ['file-
|
|
809
|
+
tags: ['category:file-safety', 'threat:secrets', 'threat:pii'],
|
|
891
810
|
},
|
|
892
811
|
{
|
|
893
|
-
id: '
|
|
812
|
+
id: 'clipboard.defaults',
|
|
894
813
|
name: 'Clipboard Policy',
|
|
895
|
-
description: '
|
|
814
|
+
description: 'Block all-paste, paste-with-secrets, paste-with-PII, encoded payload pastes, and pastes with invisible characters.',
|
|
896
815
|
category: 'clipboard',
|
|
897
|
-
cedarText:
|
|
898
|
-
severity: '
|
|
899
|
-
tags: ['
|
|
816
|
+
cedarText: SENTRY_CLIPBOARD_DEFAULTS_CEDAR,
|
|
817
|
+
severity: 'critical',
|
|
818
|
+
tags: ['category:clipboard', 'threat:secrets', 'threat:pii', 'threat:encoded-payload', 'threat:invisible-chars'],
|
|
900
819
|
},
|
|
901
820
|
{
|
|
902
|
-
id: '
|
|
903
|
-
name: '
|
|
904
|
-
description: '
|
|
821
|
+
id: 'organization.block-session-threat-escalation',
|
|
822
|
+
name: 'Session Threat Escalation',
|
|
823
|
+
description: 'Block all actions when threats have been detected in 3+ turns of the session.',
|
|
905
824
|
category: 'organization',
|
|
906
|
-
cedarText:
|
|
825
|
+
cedarText: SENTRY_ORGANIZATION_BLOCK_SESSION_THREAT_ESCALATION_CEDAR,
|
|
907
826
|
severity: 'high',
|
|
908
|
-
tags: ['
|
|
827
|
+
tags: ['category:organization', 'detection:aggregate', 'posture:catch-all'],
|
|
909
828
|
},
|
|
910
829
|
];
|
|
911
830
|
// =============================================================================
|
|
@@ -914,130 +833,130 @@ export const SENTRY_TEMPLATES = [
|
|
|
914
833
|
/** Raw templates.json metadata for the Sentry service. */
|
|
915
834
|
export const SENTRY_TEMPLATES_JSON = `{
|
|
916
835
|
"service": "sentry",
|
|
917
|
-
"version": "
|
|
836
|
+
"version": "2.0.0",
|
|
918
837
|
"description": "Sentry policy templates for browser AI security",
|
|
919
838
|
"categories": [
|
|
920
839
|
{
|
|
921
|
-
"id": "
|
|
922
|
-
"name": "Secrets
|
|
923
|
-
"description": "
|
|
840
|
+
"id": "data-protection",
|
|
841
|
+
"name": "Secrets & Data Protection",
|
|
842
|
+
"description": "Block secrets, API keys, tokens, and credentials in messages and uploads."
|
|
924
843
|
},
|
|
925
844
|
{
|
|
926
|
-
"id": "
|
|
845
|
+
"id": "privacy",
|
|
927
846
|
"name": "PII Detection",
|
|
928
|
-
"description": "
|
|
847
|
+
"description": "Block personally identifiable information across messages and uploads."
|
|
929
848
|
},
|
|
930
849
|
{
|
|
931
850
|
"id": "semantic",
|
|
932
851
|
"name": "Semantic Threat Detection",
|
|
933
|
-
"description": "
|
|
852
|
+
"description": "Block prompt injection, jailbreak attempts, and high-severity threats."
|
|
934
853
|
},
|
|
935
854
|
{
|
|
936
|
-
"id": "
|
|
855
|
+
"id": "trust-safety",
|
|
937
856
|
"name": "Content Safety",
|
|
938
|
-
"description": "
|
|
857
|
+
"description": "Block violent, harmful, hateful, sexual, or profane content."
|
|
939
858
|
},
|
|
940
859
|
{
|
|
941
|
-
"id": "
|
|
860
|
+
"id": "file-safety",
|
|
942
861
|
"name": "File & Attachment Safety",
|
|
943
|
-
"description": "Block file uploads containing secrets or PII
|
|
862
|
+
"description": "Block file uploads containing secrets or PII."
|
|
944
863
|
},
|
|
945
864
|
{
|
|
946
865
|
"id": "clipboard",
|
|
947
866
|
"name": "Clipboard Policy",
|
|
948
|
-
"description": "Control paste operations into AI chat services
|
|
867
|
+
"description": "Control paste operations into AI chat services."
|
|
949
868
|
},
|
|
950
869
|
{
|
|
951
870
|
"id": "organization",
|
|
952
871
|
"name": "Organization Rules",
|
|
953
|
-
"description": "
|
|
872
|
+
"description": "Organization-wide baselines and session-aware threat escalation."
|
|
954
873
|
}
|
|
955
874
|
],
|
|
956
875
|
"defaults": [
|
|
957
876
|
{
|
|
958
|
-
"id": "
|
|
877
|
+
"id": "organization.permit-baseline",
|
|
959
878
|
"name": "Baseline Permit",
|
|
960
|
-
"description": "Permits all actions by default
|
|
879
|
+
"description": "Permits all actions by default; threat-specific forbid policies override this when detectors fire.",
|
|
961
880
|
"category": "organization",
|
|
962
881
|
"file": "defaults/baseline.cedar",
|
|
963
882
|
"severity": "low",
|
|
964
|
-
"tags": ["
|
|
883
|
+
"tags": ["category:organization", "posture:permit-default"],
|
|
965
884
|
"is_active": true
|
|
966
885
|
}
|
|
967
886
|
],
|
|
968
887
|
"templates": [
|
|
969
888
|
{
|
|
970
|
-
"id": "
|
|
889
|
+
"id": "organization.permit-baseline",
|
|
971
890
|
"name": "Baseline Permit",
|
|
972
|
-
"description": "Permits all actions by default
|
|
891
|
+
"description": "Permits all actions by default; threat-specific forbid policies override this when detectors fire.",
|
|
973
892
|
"category": "organization",
|
|
974
893
|
"file": "defaults/baseline.cedar",
|
|
975
894
|
"severity": "low",
|
|
976
|
-
"tags": ["
|
|
895
|
+
"tags": ["category:organization", "posture:permit-default"],
|
|
977
896
|
"auto_deploy": true
|
|
978
897
|
},
|
|
979
898
|
{
|
|
980
|
-
"id": "
|
|
899
|
+
"id": "semantic.defaults",
|
|
981
900
|
"name": "Semantic Threat Detection",
|
|
982
|
-
"description": "
|
|
901
|
+
"description": "Block prompt injection, jailbreak attempts, and critical-severity threats in messages and uploads.",
|
|
983
902
|
"category": "semantic",
|
|
984
903
|
"file": "defaults/semantic.cedar",
|
|
985
904
|
"severity": "critical",
|
|
986
|
-
"tags": ["injection", "jailbreak", "owasp
|
|
905
|
+
"tags": ["category:semantic", "threat:injection", "threat:jailbreak", "owasp:llm01", "owasp:llm02"]
|
|
987
906
|
},
|
|
988
907
|
{
|
|
989
|
-
"id": "
|
|
908
|
+
"id": "trust-safety.defaults",
|
|
990
909
|
"name": "Content Safety",
|
|
991
|
-
"description": "
|
|
992
|
-
"category": "
|
|
910
|
+
"description": "Block violent, weapons, hateful, criminal, sexual, or excessively profane content.",
|
|
911
|
+
"category": "trust-safety",
|
|
993
912
|
"file": "defaults/content_safety.cedar",
|
|
994
913
|
"severity": "critical",
|
|
995
|
-
"tags": ["
|
|
914
|
+
"tags": ["category:trust-safety", "threat:harmful", "threat:hate-speech", "compliance:eu-ai-act", "compliance:iso-42001"]
|
|
996
915
|
},
|
|
997
916
|
{
|
|
998
|
-
"id": "
|
|
917
|
+
"id": "data-protection.defaults",
|
|
999
918
|
"name": "Secrets Detection",
|
|
1000
|
-
"description": "Block secrets, API keys, tokens, and credential leakage in messages and AI responses
|
|
1001
|
-
"category": "
|
|
919
|
+
"description": "Block secrets, API keys, tokens, and credential leakage in messages and AI responses.",
|
|
920
|
+
"category": "data-protection",
|
|
1002
921
|
"file": "defaults/secrets.cedar",
|
|
1003
922
|
"severity": "critical",
|
|
1004
|
-
"tags": ["
|
|
923
|
+
"tags": ["category:data-protection", "threat:secrets", "owasp:llm06"]
|
|
1005
924
|
},
|
|
1006
925
|
{
|
|
1007
|
-
"id": "
|
|
926
|
+
"id": "privacy.defaults",
|
|
1008
927
|
"name": "PII Detection",
|
|
1009
|
-
"description": "
|
|
1010
|
-
"category": "
|
|
928
|
+
"description": "Block credit card numbers, SSNs, passport/IBAN, and other PII across messages and file uploads.",
|
|
929
|
+
"category": "privacy",
|
|
1011
930
|
"file": "defaults/pii.cedar",
|
|
1012
931
|
"severity": "critical",
|
|
1013
|
-
"tags": ["
|
|
932
|
+
"tags": ["category:privacy", "threat:pii", "compliance:pci-dss", "compliance:gdpr", "compliance:hipaa"]
|
|
1014
933
|
},
|
|
1015
934
|
{
|
|
1016
|
-
"id": "
|
|
935
|
+
"id": "file-safety.defaults",
|
|
1017
936
|
"name": "File & Attachment Safety",
|
|
1018
|
-
"description": "Block file uploads containing secrets or PII in document content",
|
|
1019
|
-
"category": "
|
|
937
|
+
"description": "Block file uploads containing secrets or PII in document content.",
|
|
938
|
+
"category": "file-safety",
|
|
1020
939
|
"file": "defaults/file_safety.cedar",
|
|
1021
940
|
"severity": "critical",
|
|
1022
|
-
"tags": ["file-
|
|
941
|
+
"tags": ["category:file-safety", "threat:secrets", "threat:pii"]
|
|
1023
942
|
},
|
|
1024
943
|
{
|
|
1025
|
-
"id": "
|
|
944
|
+
"id": "clipboard.defaults",
|
|
1026
945
|
"name": "Clipboard Policy",
|
|
1027
|
-
"description": "
|
|
946
|
+
"description": "Block all-paste, paste-with-secrets, paste-with-PII, encoded payload pastes, and pastes with invisible characters.",
|
|
1028
947
|
"category": "clipboard",
|
|
1029
948
|
"file": "defaults/clipboard.cedar",
|
|
1030
|
-
"severity": "
|
|
1031
|
-
"tags": ["
|
|
949
|
+
"severity": "critical",
|
|
950
|
+
"tags": ["category:clipboard", "threat:secrets", "threat:pii", "threat:encoded-payload", "threat:invisible-chars"]
|
|
1032
951
|
},
|
|
1033
952
|
{
|
|
1034
|
-
"id": "
|
|
1035
|
-
"name": "
|
|
1036
|
-
"description": "
|
|
953
|
+
"id": "organization.block-session-threat-escalation",
|
|
954
|
+
"name": "Session Threat Escalation",
|
|
955
|
+
"description": "Block all actions when threats have been detected in 3+ turns of the session.",
|
|
1037
956
|
"category": "organization",
|
|
1038
957
|
"file": "defaults/organization.cedar",
|
|
1039
958
|
"severity": "high",
|
|
1040
|
-
"tags": ["
|
|
959
|
+
"tags": ["category:organization", "detection:aggregate", "posture:catch-all"]
|
|
1041
960
|
}
|
|
1042
961
|
]
|
|
1043
962
|
}
|