@highflame/policy 2.1.31 → 2.1.33
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/sentry/context.json +2 -2
- package/_schemas/sentry/schema.cedarschema +3 -3
- package/_schemas/sentry/templates/defaults/clipboard.cedar +32 -10
- package/_schemas/sentry/templates/defaults/content_safety.cedar +12 -102
- package/_schemas/sentry/templates/defaults/file_safety.cedar +0 -62
- package/_schemas/sentry/templates/defaults/organization.cedar +1 -1
- package/_schemas/sentry/templates/defaults/pii.cedar +23 -41
- package/_schemas/sentry/templates/defaults/secrets.cedar +22 -39
- package/_schemas/sentry/templates/defaults/semantic.cedar +22 -21
- package/_schemas/sentry/templates/templates.json +8 -8
- package/dist/sentry-defaults.gen.js +127 -291
- package/dist/sentry-entities.gen.js +3 -3
- package/dist/service-schemas.gen.d.ts +1 -1
- package/dist/service-schemas.gen.js +5 -5
- package/package.json +1 -1
|
@@ -36,7 +36,8 @@ const SENTRY_SENTRY_SEMANTIC_DEFAULT_CEDAR = `// ===============================
|
|
|
36
36
|
// Semantic Threat Detection Policy (Default)
|
|
37
37
|
// =============================================================================
|
|
38
38
|
// Detects and blocks prompt injection, jailbreak attempts, and high-severity
|
|
39
|
-
// threats across
|
|
39
|
+
// threats across browser AI interactions: messages and file uploads.
|
|
40
|
+
// Paste-targeted semantic rules live in clipboard.cedar.
|
|
40
41
|
//
|
|
41
42
|
// Uses multi-layered detection from Shield:
|
|
42
43
|
// 1. ML classifier scores (injection_score, jailbreak_score)
|
|
@@ -56,20 +57,20 @@ const SENTRY_SENTRY_SEMANTIC_DEFAULT_CEDAR = `// ===============================
|
|
|
56
57
|
|
|
57
58
|
// ---------------------------------------------------------------------------
|
|
58
59
|
// Section 1: Prompt Injection Detection
|
|
59
|
-
// Blocks injection attempts in messages
|
|
60
|
-
//
|
|
60
|
+
// Blocks injection attempts in messages and uploaded files.
|
|
61
|
+
// Paste-targeted injection rules live in clipboard.cedar.
|
|
61
62
|
// ---------------------------------------------------------------------------
|
|
62
63
|
|
|
63
|
-
// Block messages
|
|
64
|
+
// Block messages with prompt injection patterns
|
|
64
65
|
@id("sentry-semantic-block-injection")
|
|
65
66
|
@name("Block prompt injection")
|
|
66
|
-
@description("Block messages
|
|
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).")
|
|
67
68
|
@severity("critical")
|
|
68
69
|
@tags("injection,security,owasp-llm01,mitre-aml-t0051,baseline")
|
|
69
|
-
@reject_message("Content
|
|
70
|
+
@reject_message("Content blocked: prompt injection patterns were detected. This prevents manipulation of AI agent behavior. Remove adversarial instructions and try again.")
|
|
70
71
|
forbid (
|
|
71
72
|
principal,
|
|
72
|
-
action
|
|
73
|
+
action == Sentry::Action::"process_prompt",
|
|
73
74
|
resource
|
|
74
75
|
)
|
|
75
76
|
when {
|
|
@@ -82,10 +83,10 @@ when {
|
|
|
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.")
|
|
83
84
|
@severity("critical")
|
|
84
85
|
@tags("injection,ml-classifier,security,owasp-llm01")
|
|
85
|
-
@reject_message("
|
|
86
|
+
@reject_message("Content blocked: the ML classifier detected prompt injection with high confidence.")
|
|
86
87
|
forbid (
|
|
87
88
|
principal,
|
|
88
|
-
action in [Sentry::Action::"
|
|
89
|
+
action in [Sentry::Action::"process_prompt", Sentry::Action::"upload_file"],
|
|
89
90
|
resource
|
|
90
91
|
)
|
|
91
92
|
when {
|
|
@@ -98,7 +99,7 @@ when {
|
|
|
98
99
|
@description("Block file uploads when prompt injection patterns are detected in the document content. Attackers embed injection payloads in PDFs, documents, and spreadsheets to hijack AI behavior via RAG or file analysis.")
|
|
99
100
|
@severity("critical")
|
|
100
101
|
@tags("injection,file-upload,security,owasp-llm01")
|
|
101
|
-
@reject_message("
|
|
102
|
+
@reject_message("Upload blocked: prompt injection patterns were detected in the uploaded document. Files containing adversarial instructions cannot be shared with AI services.")
|
|
102
103
|
forbid (
|
|
103
104
|
principal,
|
|
104
105
|
action == Sentry::Action::"upload_file",
|
|
@@ -119,10 +120,10 @@ when {
|
|
|
119
120
|
@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).")
|
|
120
121
|
@severity("critical")
|
|
121
122
|
@tags("jailbreak,bypass,security,owasp-llm02,mitre-aml-t0054,baseline")
|
|
122
|
-
@reject_message("
|
|
123
|
+
@reject_message("Content blocked: jailbreak patterns were detected. This prevents circumvention of AI safety controls.")
|
|
123
124
|
forbid (
|
|
124
125
|
principal,
|
|
125
|
-
action == Sentry::Action::"
|
|
126
|
+
action == Sentry::Action::"process_prompt",
|
|
126
127
|
resource
|
|
127
128
|
)
|
|
128
129
|
when {
|
|
@@ -135,10 +136,10 @@ when {
|
|
|
135
136
|
@description("Block content when the ML jailbreak classifier exceeds threshold (75/100). Catches sophisticated jailbreak techniques including multi-turn manipulation and encoded payloads.")
|
|
136
137
|
@severity("critical")
|
|
137
138
|
@tags("jailbreak,ml-classifier,security,owasp-llm02")
|
|
138
|
-
@reject_message("
|
|
139
|
+
@reject_message("Content blocked: the ML classifier detected a jailbreak attempt with high confidence.")
|
|
139
140
|
forbid (
|
|
140
141
|
principal,
|
|
141
|
-
action
|
|
142
|
+
action == Sentry::Action::"process_prompt",
|
|
142
143
|
resource
|
|
143
144
|
)
|
|
144
145
|
when {
|
|
@@ -153,13 +154,13 @@ when {
|
|
|
153
154
|
// Block any content with critical severity threats
|
|
154
155
|
@id("sentry-semantic-block-critical")
|
|
155
156
|
@name("Block critical threats")
|
|
156
|
-
@description("Block
|
|
157
|
+
@description("Block messages and file uploads when any detection engine reports critical severity. This is the ultimate catch-all for critical-severity threats regardless of type or source.")
|
|
157
158
|
@severity("critical")
|
|
158
159
|
@tags("critical,baseline,security,catch-all")
|
|
159
|
-
@reject_message("
|
|
160
|
+
@reject_message("Content blocked: security scanners detected a critical-severity threat. This content cannot be processed by AI services.")
|
|
160
161
|
forbid (
|
|
161
162
|
principal,
|
|
162
|
-
action,
|
|
163
|
+
action in [Sentry::Action::"process_prompt", Sentry::Action::"upload_file"],
|
|
163
164
|
resource
|
|
164
165
|
)
|
|
165
166
|
when {
|
|
@@ -172,10 +173,10 @@ when {
|
|
|
172
173
|
@description("Block messages when threat detection reports high severity (>= 3) in semantic categories. Catches threats that individually are below critical but collectively indicate adversarial intent.")
|
|
173
174
|
@severity("high")
|
|
174
175
|
@tags("semantic,severity,security,defense-in-depth")
|
|
175
|
-
@reject_message("
|
|
176
|
+
@reject_message("Content blocked: security scanners detected high severity issues. Review your content for manipulative or adversarial patterns.")
|
|
176
177
|
forbid (
|
|
177
178
|
principal,
|
|
178
|
-
action == Sentry::Action::"
|
|
179
|
+
action == Sentry::Action::"process_prompt",
|
|
179
180
|
resource
|
|
180
181
|
)
|
|
181
182
|
when {
|
|
@@ -190,10 +191,10 @@ when {
|
|
|
190
191
|
@description("Block content when multiple distinct threats are detected simultaneously (3+). Multiple concurrent threats strongly indicate an adversarial attack chain or compromised content.")
|
|
191
192
|
@severity("high")
|
|
192
193
|
@tags("multi-threat,security,defense-in-depth")
|
|
193
|
-
@reject_message("Content
|
|
194
|
+
@reject_message("Content blocked: multiple security threats were detected simultaneously. This pattern indicates potentially adversarial content.")
|
|
194
195
|
forbid (
|
|
195
196
|
principal,
|
|
196
|
-
action in [Sentry::Action::"
|
|
197
|
+
action in [Sentry::Action::"process_prompt", Sentry::Action::"upload_file"],
|
|
197
198
|
resource
|
|
198
199
|
)
|
|
199
200
|
when {
|
|
@@ -204,8 +205,10 @@ const SENTRY_SENTRY_CONTENT_SAFETY_DEFAULT_CEDAR = `// =========================
|
|
|
204
205
|
// Content Safety Policy (Default)
|
|
205
206
|
// =============================================================================
|
|
206
207
|
// Detects and blocks violent, harmful, hateful, sexual, and profane content
|
|
207
|
-
// in AI chat interactions
|
|
208
|
-
//
|
|
208
|
+
// in AI chat interactions across messages and file uploads.
|
|
209
|
+
//
|
|
210
|
+
// Paste-specific content safety rules live in clipboard.cedar — see
|
|
211
|
+
// "Clipboard Policy".
|
|
209
212
|
//
|
|
210
213
|
// The detection engine runs ML classifiers (toxicity, content safety) and
|
|
211
214
|
// produces normalized scores (0-100) for each category.
|
|
@@ -223,19 +226,19 @@ const SENTRY_SENTRY_CONTENT_SAFETY_DEFAULT_CEDAR = `// =========================
|
|
|
223
226
|
// ---------------------------------------------------------------------------
|
|
224
227
|
// Section 1: Violence & Weapons
|
|
225
228
|
// Blocks content promoting, describing, or instructing violence and weapons.
|
|
226
|
-
// Applies to messages
|
|
229
|
+
// Applies to messages and file uploads.
|
|
227
230
|
// ---------------------------------------------------------------------------
|
|
228
231
|
|
|
229
232
|
// Block violent content across all input channels
|
|
230
233
|
@id("sentry-cs-block-violence")
|
|
231
234
|
@name("Block violent content")
|
|
232
|
-
@description("Block content when the ML violence detection score exceeds threshold (80/100). Catches graphic violence descriptions, instructions for causing harm, and violent threat language in messages
|
|
235
|
+
@description("Block content when the ML violence detection score exceeds threshold (80/100). Catches graphic violence descriptions, instructions for causing harm, and violent threat language in messages and uploads.")
|
|
233
236
|
@severity("critical")
|
|
234
237
|
@tags("violence,content-safety,trust-safety,nist-si-4,iso-42001")
|
|
235
238
|
@reject_message("Content blocked: violent content detected. AI services must not process violent content in enterprise environments. Please rephrase without violence-related language.")
|
|
236
239
|
forbid (
|
|
237
240
|
principal,
|
|
238
|
-
action in [Sentry::Action::"
|
|
241
|
+
action in [Sentry::Action::"process_prompt", Sentry::Action::"upload_file"],
|
|
239
242
|
resource
|
|
240
243
|
)
|
|
241
244
|
when {
|
|
@@ -251,7 +254,7 @@ when {
|
|
|
251
254
|
@reject_message("Content blocked: weapons-related content detected. AI services must not process weapons manufacturing, procurement, or specification content.")
|
|
252
255
|
forbid (
|
|
253
256
|
principal,
|
|
254
|
-
action in [Sentry::Action::"
|
|
257
|
+
action in [Sentry::Action::"process_prompt", Sentry::Action::"upload_file"],
|
|
255
258
|
resource
|
|
256
259
|
)
|
|
257
260
|
when {
|
|
@@ -272,7 +275,7 @@ when {
|
|
|
272
275
|
@reject_message("Content blocked: hate speech or discriminatory content detected. AI services must not process hateful, discriminatory, or dehumanizing content.")
|
|
273
276
|
forbid (
|
|
274
277
|
principal,
|
|
275
|
-
action in [Sentry::Action::"
|
|
278
|
+
action in [Sentry::Action::"process_prompt", Sentry::Action::"upload_file"],
|
|
276
279
|
resource
|
|
277
280
|
)
|
|
278
281
|
when {
|
|
@@ -292,7 +295,7 @@ when {
|
|
|
292
295
|
@reject_message("Content blocked: criminal activity content detected. AI services must not process content related to illegal activities or fraud.")
|
|
293
296
|
forbid (
|
|
294
297
|
principal,
|
|
295
|
-
action in [Sentry::Action::"
|
|
298
|
+
action in [Sentry::Action::"process_prompt", Sentry::Action::"upload_file"],
|
|
296
299
|
resource
|
|
297
300
|
)
|
|
298
301
|
when {
|
|
@@ -312,7 +315,7 @@ when {
|
|
|
312
315
|
@reject_message("Content blocked: sexual content detected. AI services must not process sexually explicit material in enterprise environments.")
|
|
313
316
|
forbid (
|
|
314
317
|
principal,
|
|
315
|
-
action in [Sentry::Action::"
|
|
318
|
+
action in [Sentry::Action::"process_prompt", Sentry::Action::"upload_file"],
|
|
316
319
|
resource
|
|
317
320
|
)
|
|
318
321
|
when {
|
|
@@ -333,145 +336,52 @@ when {
|
|
|
333
336
|
@reject_message("Content blocked: excessive profanity detected. Please rephrase in a professional manner.")
|
|
334
337
|
forbid (
|
|
335
338
|
principal,
|
|
336
|
-
action
|
|
339
|
+
action == Sentry::Action::"process_prompt",
|
|
337
340
|
resource
|
|
338
341
|
)
|
|
339
342
|
when {
|
|
340
343
|
context has profanity_score && context.profanity_score >= 90
|
|
341
344
|
};
|
|
342
345
|
|
|
343
|
-
// ---------------------------------------------------------------------------
|
|
344
|
-
// Section 6: Cut & Paste Safety
|
|
345
|
-
// Specific rules for content pasted from external sources into AI chats.
|
|
346
|
-
// Paste operations are a primary vector for data leakage.
|
|
347
|
-
// ---------------------------------------------------------------------------
|
|
348
|
-
|
|
349
|
-
// Block large pastes with any detected threats
|
|
350
|
-
@id("sentry-cs-block-large-paste-threats")
|
|
351
|
-
@name("Block large pastes with threats")
|
|
352
|
-
@description("Block large paste operations (>5000 chars) when any threats are detected. Large pastes with threats likely indicate bulk data dumps from emails, documents, or databases being leaked to AI services.")
|
|
353
|
-
@severity("high")
|
|
354
|
-
@tags("paste-safety,data-leakage,content-safety")
|
|
355
|
-
@reject_message("Large paste operation blocked: security threats were detected in the pasted content. Large data transfers to AI services require threat-free content.")
|
|
356
|
-
forbid (
|
|
357
|
-
principal,
|
|
358
|
-
action == Sentry::Action::"paste_content",
|
|
359
|
-
resource
|
|
360
|
-
)
|
|
361
|
-
when {
|
|
362
|
-
context has paste_length && context has threat_count &&
|
|
363
|
-
context.paste_length > 5000 && context.threat_count >= 1
|
|
364
|
-
};
|
|
365
|
-
|
|
366
|
-
// Block pastes containing encoded injection payloads
|
|
367
|
-
@id("sentry-cs-block-paste-encoded")
|
|
368
|
-
@name("Block encoded paste content")
|
|
369
|
-
@description("Block paste operations when encoded injection payloads (base64, hex, unicode) are detected. Attackers use encoding to smuggle injection payloads via clipboard transfer.")
|
|
370
|
-
@severity("high")
|
|
371
|
-
@tags("paste-safety,encoding,injection,content-safety")
|
|
372
|
-
@reject_message("Paste blocked: encoded injection payloads detected in pasted content. Content with hidden encoded instructions cannot be shared with AI services.")
|
|
373
|
-
forbid (
|
|
374
|
-
principal,
|
|
375
|
-
action == Sentry::Action::"paste_content",
|
|
376
|
-
resource
|
|
377
|
-
)
|
|
378
|
-
when {
|
|
379
|
-
context has encoded_content_detected && context.encoded_content_detected &&
|
|
380
|
-
context has encoded_score && context.encoded_score >= 60
|
|
381
|
-
};
|
|
382
|
-
|
|
383
|
-
// Block pastes with invisible characters
|
|
384
|
-
@id("sentry-cs-block-paste-invisible")
|
|
385
|
-
@name("Block paste with invisible characters")
|
|
386
|
-
@description("Block paste operations containing invisible Unicode characters (zero-width, bidi overrides). These can hide malicious instructions that appear invisible to users but are processed by AI models.")
|
|
387
|
-
@severity("high")
|
|
388
|
-
@tags("paste-safety,unicode,invisible-chars,content-safety")
|
|
389
|
-
@reject_message("Paste blocked: invisible Unicode characters detected. Hidden characters can disguise malicious instructions that AI models process but users cannot see.")
|
|
390
|
-
forbid (
|
|
391
|
-
principal,
|
|
392
|
-
action == Sentry::Action::"paste_content",
|
|
393
|
-
resource
|
|
394
|
-
)
|
|
395
|
-
when {
|
|
396
|
-
context has contains_invisible_chars && context.contains_invisible_chars &&
|
|
397
|
-
context has invisible_chars_score && context.invisible_chars_score >= 50
|
|
398
|
-
};
|
|
399
|
-
|
|
400
|
-
// ---------------------------------------------------------------------------
|
|
401
|
-
// Section 7: AI Response Safety
|
|
402
|
-
// Block harmful content in AI responses before user sees it.
|
|
403
|
-
// ---------------------------------------------------------------------------
|
|
404
|
-
|
|
405
|
-
// Block violent/harmful AI responses
|
|
406
|
-
@id("sentry-cs-block-response-safety")
|
|
407
|
-
@name("Block harmful AI responses")
|
|
408
|
-
@description("Block AI responses containing high-severity violent, hateful, or criminal content. Prevents harmful AI-generated content from reaching users in enterprise environments.")
|
|
409
|
-
@severity("critical")
|
|
410
|
-
@tags("response-safety,content-safety,owasp-llm02")
|
|
411
|
-
@reject_message("AI response blocked: harmful content detected in the response. The AI service generated content that violates enterprise content safety policies.")
|
|
412
|
-
forbid (
|
|
413
|
-
principal,
|
|
414
|
-
action == Sentry::Action::"receive_response",
|
|
415
|
-
resource
|
|
416
|
-
)
|
|
417
|
-
when {
|
|
418
|
-
context has violence_score && context.violence_score >= 80
|
|
419
|
-
};
|
|
420
|
-
|
|
421
|
-
@id("sentry-cs-block-response-hate")
|
|
422
|
-
@name("Block hateful AI responses")
|
|
423
|
-
@description("Block AI responses with hate speech or discriminatory content.")
|
|
424
|
-
@severity("critical")
|
|
425
|
-
@tags("response-safety,hate-speech,content-safety,owasp-llm02")
|
|
426
|
-
@reject_message("AI response blocked: hate speech or discriminatory content detected in the response.")
|
|
427
|
-
forbid (
|
|
428
|
-
principal,
|
|
429
|
-
action == Sentry::Action::"receive_response",
|
|
430
|
-
resource
|
|
431
|
-
)
|
|
432
|
-
when {
|
|
433
|
-
context has hate_speech_score && context.hate_speech_score >= 75
|
|
434
|
-
};
|
|
435
346
|
`;
|
|
436
347
|
const SENTRY_SENTRY_SECRETS_DEFAULT_CEDAR = `// =============================================================================
|
|
437
348
|
// Secrets Detection Policy (Default)
|
|
438
349
|
// =============================================================================
|
|
439
|
-
// Block credential and secret leakage across messages and
|
|
350
|
+
// Block credential and secret leakage across messages and file uploads.
|
|
440
351
|
// Shield SecretsDetector identifies 18+ secret types via regex.
|
|
441
352
|
//
|
|
442
|
-
// Paste-targeted secret rules live in clipboard.cedar
|
|
443
|
-
// non-paste channels (messages, responses, and cross-cutting rules).
|
|
353
|
+
// Paste-targeted secret rules live in clipboard.cedar.
|
|
444
354
|
//
|
|
445
355
|
// Category: secrets
|
|
446
356
|
// Namespace: Sentry
|
|
447
357
|
// =============================================================================
|
|
448
358
|
|
|
449
|
-
// Block messages containing secrets
|
|
359
|
+
// Block messages and uploads containing secrets
|
|
450
360
|
@id("sentry-org-block-secrets-messages")
|
|
451
|
-
@name("Block messages with secrets")
|
|
452
|
-
@description("Block messages when detection engines identify API keys, tokens, or credential patterns. First line of defense against accidental credential exposure in AI chat interactions.")
|
|
361
|
+
@name("Block messages and uploads with secrets")
|
|
362
|
+
@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.")
|
|
453
363
|
@severity("critical")
|
|
454
364
|
@tags("secrets,credentials,messages,nist-sc-28,nist-ia-5")
|
|
455
|
-
@reject_message("
|
|
365
|
+
@reject_message("Content blocked: detected secrets such as API keys, tokens, or credentials. Remove all secrets before sending to AI services.")
|
|
456
366
|
forbid (
|
|
457
367
|
principal,
|
|
458
|
-
action
|
|
368
|
+
action in [Sentry::Action::"process_prompt", Sentry::Action::"upload_file"],
|
|
459
369
|
resource
|
|
460
370
|
)
|
|
461
371
|
when {
|
|
462
372
|
context has contains_secrets && context.contains_secrets
|
|
463
373
|
};
|
|
464
374
|
|
|
465
|
-
// Block high-risk secret types across
|
|
375
|
+
// Block high-risk secret types across messages and file uploads
|
|
466
376
|
@id("sentry-org-block-high-risk-secrets")
|
|
467
377
|
@name("Block high-risk credential types")
|
|
468
|
-
@description("Block
|
|
378
|
+
@description("Block messages and file uploads containing cloud provider keys (AWS, GCP, Azure), GitHub tokens, SSH private keys, or database connection strings. These credential types pose the highest exfiltration risk.")
|
|
469
379
|
@severity("critical")
|
|
470
380
|
@tags("secrets,aws,github,ssh,cloud,nist-ia-5,mitre-t1552")
|
|
471
381
|
@reject_message("Content blocked: high-risk credentials detected (cloud keys, GitHub tokens, SSH keys). Use a secrets manager — never share credentials with AI services.")
|
|
472
382
|
forbid (
|
|
473
383
|
principal,
|
|
474
|
-
action,
|
|
384
|
+
action in [Sentry::Action::"process_prompt", Sentry::Action::"upload_file"],
|
|
475
385
|
resource
|
|
476
386
|
)
|
|
477
387
|
when {
|
|
@@ -485,16 +395,16 @@ when {
|
|
|
485
395
|
context.secret_types.contains("private_key"))
|
|
486
396
|
};
|
|
487
397
|
|
|
488
|
-
// Block API keys and tokens across
|
|
398
|
+
// Block API keys and tokens across messages and file uploads
|
|
489
399
|
@id("sentry-org-block-api-keys")
|
|
490
400
|
@name("Block API keys and tokens")
|
|
491
|
-
@description("Block
|
|
401
|
+
@description("Block messages and file uploads containing generic API keys, JWT tokens, and OAuth credentials. These are the most commonly leaked credential types when users interact with AI services.")
|
|
492
402
|
@severity("high")
|
|
493
403
|
@tags("secrets,api-key,jwt,oauth,nist-ia-5")
|
|
494
404
|
@reject_message("Content blocked: API keys, JWT tokens, or OAuth credentials detected. These must never be shared with AI services.")
|
|
495
405
|
forbid (
|
|
496
406
|
principal,
|
|
497
|
-
action,
|
|
407
|
+
action in [Sentry::Action::"process_prompt", Sentry::Action::"upload_file"],
|
|
498
408
|
resource
|
|
499
409
|
)
|
|
500
410
|
when {
|
|
@@ -506,23 +416,23 @@ when {
|
|
|
506
416
|
context.secret_types.contains("stripe_key"))
|
|
507
417
|
};
|
|
508
418
|
|
|
509
|
-
// Block SSH key exposure across messages
|
|
419
|
+
// Block SSH key exposure across messages and file uploads
|
|
510
420
|
@id("sentry-secrets-block-ssh-keys")
|
|
511
421
|
@name("Block SSH key exposure")
|
|
512
|
-
@description("Block when SSH private key content or SSH key file paths are detected. Covers messages
|
|
422
|
+
@description("Block when SSH private key content or SSH key file paths are detected. Covers messages and file uploads. AI chat services must not receive SSH credentials.")
|
|
513
423
|
@severity("critical")
|
|
514
424
|
@tags("secrets,ssh,credentials,nist-ia-5,mitre-t1552")
|
|
515
425
|
@reject_message("Blocked: SSH private key content or key file path detected. AI chat services must not receive SSH credentials.")
|
|
516
426
|
forbid (
|
|
517
427
|
principal,
|
|
518
|
-
action in [Sentry::Action::"
|
|
428
|
+
action in [Sentry::Action::"process_prompt", Sentry::Action::"upload_file"],
|
|
519
429
|
resource
|
|
520
430
|
)
|
|
521
431
|
when {
|
|
522
432
|
context has secret_types && context.secret_types.contains("ssh_key")
|
|
523
433
|
};
|
|
524
434
|
|
|
525
|
-
// Block PEM/certificate key exposure across messages
|
|
435
|
+
// Block PEM/certificate key exposure across messages and file uploads
|
|
526
436
|
@id("sentry-secrets-block-pem-keys")
|
|
527
437
|
@name("Block PEM/certificate key exposure")
|
|
528
438
|
@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.")
|
|
@@ -531,7 +441,7 @@ when {
|
|
|
531
441
|
@reject_message("Blocked: PEM private key or certificate key file detected. AI chat services must not receive certificate credentials.")
|
|
532
442
|
forbid (
|
|
533
443
|
principal,
|
|
534
|
-
action in [Sentry::Action::"
|
|
444
|
+
action in [Sentry::Action::"process_prompt", Sentry::Action::"upload_file"],
|
|
535
445
|
resource
|
|
536
446
|
)
|
|
537
447
|
when {
|
|
@@ -541,13 +451,13 @@ when {
|
|
|
541
451
|
// Block bulk secret exposure
|
|
542
452
|
@id("sentry-org-block-bulk-secrets")
|
|
543
453
|
@name("Block bulk secret exposure")
|
|
544
|
-
@description("Block
|
|
454
|
+
@description("Block messages and file uploads when 3+ distinct secrets are found. Multiple secrets indicate a configuration dump, .env file paste, or credential harvesting being sent to AI services.")
|
|
545
455
|
@severity("critical")
|
|
546
456
|
@tags("secrets,bulk,data-exfiltration,nist-sc-28")
|
|
547
457
|
@reject_message("Content blocked: multiple credentials detected (3+). Configuration dumps and credential lists must never be shared with AI services.")
|
|
548
458
|
forbid (
|
|
549
459
|
principal,
|
|
550
|
-
action,
|
|
460
|
+
action in [Sentry::Action::"process_prompt", Sentry::Action::"upload_file"],
|
|
551
461
|
resource
|
|
552
462
|
)
|
|
553
463
|
when {
|
|
@@ -557,13 +467,13 @@ when {
|
|
|
557
467
|
// Block detected credential patterns
|
|
558
468
|
@id("sentry-org-block-detected-credentials")
|
|
559
469
|
@name("Block detected credential patterns")
|
|
560
|
-
@description("Block
|
|
470
|
+
@description("Block messages and file uploads flagged by detection engine rules for credential exposure, API key leaks, and token exposure. Defense-in-depth behind contains_secrets.")
|
|
561
471
|
@severity("critical")
|
|
562
472
|
@tags("secrets,credentials,detection-rules,nist-ia-5")
|
|
563
473
|
@reject_message("Content blocked: detection engines identified credential patterns including secret exposure, API keys, or token leaks.")
|
|
564
474
|
forbid (
|
|
565
475
|
principal,
|
|
566
|
-
action,
|
|
476
|
+
action in [Sentry::Action::"process_prompt", Sentry::Action::"upload_file"],
|
|
567
477
|
resource
|
|
568
478
|
)
|
|
569
479
|
when {
|
|
@@ -572,28 +482,14 @@ when {
|
|
|
572
482
|
context.detected_threats.contains("credential_leak") ||
|
|
573
483
|
context.detected_threats.contains("api_key_exposure"))
|
|
574
484
|
};
|
|
575
|
-
|
|
576
|
-
// Block AI responses when session has leaked secrets
|
|
577
|
-
@id("sentry-org-session-secrets-response")
|
|
578
|
-
@name("Block responses after secret detection")
|
|
579
|
-
@description("Block AI responses when secrets were detected earlier in the session. If credentials were leaked in a previous turn, the AI service may have processed them and could echo or reference them in responses.")
|
|
580
|
-
@severity("high")
|
|
581
|
-
@tags("session,secrets,response-safety,defense-in-depth")
|
|
582
|
-
@reject_message("AI response blocked: secrets were detected in an earlier message in this session. Responses may contain or reference the exposed credentials.")
|
|
583
|
-
forbid (
|
|
584
|
-
principal,
|
|
585
|
-
action == Sentry::Action::"receive_response",
|
|
586
|
-
resource
|
|
587
|
-
)
|
|
588
|
-
when {
|
|
589
|
-
context has session_secrets_detected && context.session_secrets_detected
|
|
590
|
-
};
|
|
591
485
|
`;
|
|
592
486
|
const SENTRY_SENTRY_PII_DEFAULT_CEDAR = `// =============================================================================
|
|
593
487
|
// PII Detection Policy (Default)
|
|
594
488
|
// =============================================================================
|
|
595
|
-
// Detects and blocks personally identifiable information across messages
|
|
596
|
-
//
|
|
489
|
+
// Detects and blocks personally identifiable information across messages
|
|
490
|
+
// and file uploads. Uses multi-layered detection:
|
|
491
|
+
//
|
|
492
|
+
// Paste-targeted PII rules live in clipboard.cedar.
|
|
597
493
|
//
|
|
598
494
|
// 1. PII boolean flag (pii_detected) — broadest catch from detection engine
|
|
599
495
|
// 2. Granular PII type matching (pii_types) — type-specific blocking
|
|
@@ -621,16 +517,16 @@ const SENTRY_SENTRY_PII_DEFAULT_CEDAR = `// ====================================
|
|
|
621
517
|
// Fires when the detection pipeline identifies PII in any content.
|
|
622
518
|
// ---------------------------------------------------------------------------
|
|
623
519
|
|
|
624
|
-
// Block messages containing detected PII
|
|
520
|
+
// Block messages and uploads containing detected PII
|
|
625
521
|
@id("sentry-pii-block-messages")
|
|
626
|
-
@name("Block messages with PII")
|
|
627
|
-
@description("Block messages when the detection engine identifies any PII patterns. Prevents employees from accidentally sharing personal data with AI chat services.")
|
|
522
|
+
@name("Block messages and uploads with PII")
|
|
523
|
+
@description("Block messages and file uploads when the detection engine identifies any PII patterns. Prevents employees from accidentally sharing personal data with AI chat services.")
|
|
628
524
|
@severity("critical")
|
|
629
525
|
@tags("pii,privacy,data-protection,gdpr-art-32,owasp-llm06")
|
|
630
|
-
@reject_message("
|
|
526
|
+
@reject_message("Content blocked: personally identifiable information was detected. Remove all PII (names, addresses, SSNs, credit cards, etc.) before sending to AI services.")
|
|
631
527
|
forbid (
|
|
632
528
|
principal,
|
|
633
|
-
action
|
|
529
|
+
action in [Sentry::Action::"process_prompt", Sentry::Action::"upload_file"],
|
|
634
530
|
resource
|
|
635
531
|
)
|
|
636
532
|
when {
|
|
@@ -645,13 +541,13 @@ when {
|
|
|
645
541
|
// Block credit card numbers (PCI DSS compliance)
|
|
646
542
|
@id("sentry-pii-block-credit-cards")
|
|
647
543
|
@name("Block credit card numbers")
|
|
648
|
-
@description("Block
|
|
544
|
+
@description("Block messages and file uploads containing credit card number patterns. PCI DSS 3.4 requires PANs are rendered unreadable — AI services must never receive raw card numbers.")
|
|
649
545
|
@severity("critical")
|
|
650
546
|
@tags("pci,credit-card,payment,compliance,pci-dss-3.4")
|
|
651
547
|
@reject_message("Content blocked: credit card number patterns detected. Sharing payment card data with AI services violates PCI DSS. Use tokenized references instead.")
|
|
652
548
|
forbid (
|
|
653
549
|
principal,
|
|
654
|
-
action,
|
|
550
|
+
action in [Sentry::Action::"process_prompt", Sentry::Action::"upload_file"],
|
|
655
551
|
resource
|
|
656
552
|
)
|
|
657
553
|
when {
|
|
@@ -662,13 +558,13 @@ when {
|
|
|
662
558
|
// Block Social Security Numbers
|
|
663
559
|
@id("sentry-pii-block-ssn")
|
|
664
560
|
@name("Block Social Security Numbers")
|
|
665
|
-
@description("Block
|
|
561
|
+
@description("Block messages and file uploads containing SSN patterns (XXX-XX-XXXX and variants). SSNs are high-value identity theft targets — exposure through AI services is a critical privacy violation.")
|
|
666
562
|
@severity("critical")
|
|
667
563
|
@tags("ssn,identity,privacy,compliance,nist-si-4")
|
|
668
564
|
@reject_message("Content blocked: Social Security Number patterns detected. SSNs must never be shared with AI services.")
|
|
669
565
|
forbid (
|
|
670
566
|
principal,
|
|
671
|
-
action,
|
|
567
|
+
action in [Sentry::Action::"process_prompt", Sentry::Action::"upload_file"],
|
|
672
568
|
resource
|
|
673
569
|
)
|
|
674
570
|
when {
|
|
@@ -679,13 +575,13 @@ when {
|
|
|
679
575
|
// Block passport numbers
|
|
680
576
|
@id("sentry-pii-block-passport")
|
|
681
577
|
@name("Block passport numbers")
|
|
682
|
-
@description("Block
|
|
578
|
+
@description("Block messages and file uploads containing passport number patterns. Passport numbers are government-issued identifiers with high identity theft risk.")
|
|
683
579
|
@severity("critical")
|
|
684
580
|
@tags("passport,identity,privacy,gdpr")
|
|
685
581
|
@reject_message("Content blocked: passport number patterns detected. Government-issued identifiers must not be shared with AI services.")
|
|
686
582
|
forbid (
|
|
687
583
|
principal,
|
|
688
|
-
action,
|
|
584
|
+
action in [Sentry::Action::"process_prompt", Sentry::Action::"upload_file"],
|
|
689
585
|
resource
|
|
690
586
|
)
|
|
691
587
|
when {
|
|
@@ -695,13 +591,13 @@ when {
|
|
|
695
591
|
// Block IBAN (International Bank Account Numbers)
|
|
696
592
|
@id("sentry-pii-block-iban")
|
|
697
593
|
@name("Block bank account numbers")
|
|
698
|
-
@description("Block
|
|
594
|
+
@description("Block messages and file uploads containing IBAN patterns. Bank account numbers are sensitive financial identifiers that must not be exposed to AI services.")
|
|
699
595
|
@severity("critical")
|
|
700
596
|
@tags("iban,financial,privacy,gdpr,pci-dss")
|
|
701
597
|
@reject_message("Content blocked: bank account number (IBAN) patterns detected. Financial account numbers must not be shared with AI services.")
|
|
702
598
|
forbid (
|
|
703
599
|
principal,
|
|
704
|
-
action,
|
|
600
|
+
action in [Sentry::Action::"process_prompt", Sentry::Action::"upload_file"],
|
|
705
601
|
resource
|
|
706
602
|
)
|
|
707
603
|
when {
|
|
@@ -711,13 +607,13 @@ when {
|
|
|
711
607
|
// Block bulk PII exposure
|
|
712
608
|
@id("sentry-pii-block-bulk-exposure")
|
|
713
609
|
@name("Block bulk PII exposure")
|
|
714
|
-
@description("Block
|
|
610
|
+
@description("Block messages and file uploads containing 3 or more PII matches. Multiple PII items indicate a data dump — customer lists, CSV exports, or database content being leaked to AI services.")
|
|
715
611
|
@severity("critical")
|
|
716
612
|
@tags("pii,bulk,data-exfiltration,gdpr-art-32,ccpa")
|
|
717
613
|
@reject_message("Content blocked: multiple PII items detected (3+). Bulk personal data must never be shared with AI services. Use data masking or tokenization.")
|
|
718
614
|
forbid (
|
|
719
615
|
principal,
|
|
720
|
-
action,
|
|
616
|
+
action in [Sentry::Action::"process_prompt", Sentry::Action::"upload_file"],
|
|
721
617
|
resource
|
|
722
618
|
)
|
|
723
619
|
when {
|
|
@@ -732,13 +628,13 @@ when {
|
|
|
732
628
|
// Block high-confidence PII
|
|
733
629
|
@id("sentry-pii-block-high-confidence")
|
|
734
630
|
@name("Block high-confidence PII")
|
|
735
|
-
@description("Block
|
|
631
|
+
@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.")
|
|
736
632
|
@severity("critical")
|
|
737
633
|
@tags("pii,confidence,privacy,compliance,ml-classifier")
|
|
738
634
|
@reject_message("Content blocked: the ML classifier detected personally identifiable information with high confidence. The content appears to contain personal data.")
|
|
739
635
|
forbid (
|
|
740
636
|
principal,
|
|
741
|
-
action in [Sentry::Action::"
|
|
637
|
+
action in [Sentry::Action::"process_prompt", Sentry::Action::"upload_file"],
|
|
742
638
|
resource
|
|
743
639
|
)
|
|
744
640
|
when {
|
|
@@ -753,39 +649,19 @@ when {
|
|
|
753
649
|
// Block PII threat category
|
|
754
650
|
@id("sentry-pii-block-threat-category")
|
|
755
651
|
@name("Block PII threat category")
|
|
756
|
-
@description("Block
|
|
652
|
+
@description("Block messages and file uploads when threat categorization identifies PII. Defense-in-depth behind the pii_detected boolean — catches cases where PII is flagged at the aggregation layer.")
|
|
757
653
|
@severity("high")
|
|
758
654
|
@tags("pii,privacy,data-protection,gdpr")
|
|
759
655
|
@reject_message("Content blocked: threat scanners detected personally identifiable information. Remove all PII before submitting.")
|
|
760
656
|
forbid (
|
|
761
657
|
principal,
|
|
762
|
-
action in [Sentry::Action::"
|
|
658
|
+
action in [Sentry::Action::"process_prompt", Sentry::Action::"upload_file"],
|
|
763
659
|
resource
|
|
764
660
|
)
|
|
765
661
|
when {
|
|
766
662
|
context has threat_categories && context.threat_categories.contains("pii")
|
|
767
663
|
};
|
|
768
664
|
|
|
769
|
-
// ---------------------------------------------------------------------------
|
|
770
|
-
// Section 5: AI Response PII Blocking
|
|
771
|
-
// Prevent AI responses containing PII from reaching the user.
|
|
772
|
-
// ---------------------------------------------------------------------------
|
|
773
|
-
|
|
774
|
-
// Block AI responses containing PII
|
|
775
|
-
@id("sentry-pii-block-responses")
|
|
776
|
-
@name("Block AI responses with PII")
|
|
777
|
-
@description("Block AI responses when PII is detected in the output. Prevents AI services from exposing personal data in generated responses (e.g., when the model echoes back or generates PII from training data).")
|
|
778
|
-
@severity("high")
|
|
779
|
-
@tags("pii,response-safety,data-protection,owasp-llm06")
|
|
780
|
-
@reject_message("AI response blocked: personally identifiable information detected in the AI response. The AI service generated content containing personal data.")
|
|
781
|
-
forbid (
|
|
782
|
-
principal,
|
|
783
|
-
action == Sentry::Action::"receive_response",
|
|
784
|
-
resource
|
|
785
|
-
)
|
|
786
|
-
when {
|
|
787
|
-
context has pii_detected && context.pii_detected
|
|
788
|
-
};
|
|
789
665
|
`;
|
|
790
666
|
const SENTRY_SENTRY_FILE_SAFETY_DEFAULT_CEDAR = `// =============================================================================
|
|
791
667
|
// File & Attachment Safety Policy (Default)
|
|
@@ -798,8 +674,6 @@ const SENTRY_SENTRY_FILE_SAFETY_DEFAULT_CEDAR = `// ============================
|
|
|
798
674
|
// 1. MIP label enforcement — sensitivity_level from document metadata
|
|
799
675
|
// 2. PII/secrets in file content — from Shield PIIRegexDetector/SecretsDetector
|
|
800
676
|
// 3. Injection payloads in files — from Shield InjectionDetector
|
|
801
|
-
// 4. File type restrictions — block dangerous extensions
|
|
802
|
-
// 5. Phishing link detection — from CheckPhishDetector
|
|
803
677
|
//
|
|
804
678
|
// Compliance:
|
|
805
679
|
// Microsoft Information Protection (MIP) — label-based access control
|
|
@@ -901,66 +775,6 @@ forbid (
|
|
|
901
775
|
when {
|
|
902
776
|
context has pii_detected && context.pii_detected
|
|
903
777
|
};
|
|
904
|
-
|
|
905
|
-
// Block files with phishing links
|
|
906
|
-
@id("sentry-file-block-phishing")
|
|
907
|
-
@name("Block files with phishing links")
|
|
908
|
-
@description("Block file uploads when phishing URLs are detected in document content. Prevents sharing of compromised documents that could expose phishing links to AI processing.")
|
|
909
|
-
@severity("high")
|
|
910
|
-
@tags("phishing,file-upload,security")
|
|
911
|
-
@reject_message("Upload blocked: phishing URLs detected in the file. Documents containing phishing links cannot be shared with AI services.")
|
|
912
|
-
forbid (
|
|
913
|
-
principal,
|
|
914
|
-
action == Sentry::Action::"upload_file",
|
|
915
|
-
resource
|
|
916
|
-
)
|
|
917
|
-
when {
|
|
918
|
-
context has phishing_detected && context.phishing_detected
|
|
919
|
-
};
|
|
920
|
-
|
|
921
|
-
// ---------------------------------------------------------------------------
|
|
922
|
-
// Section 3: File Type & Size Restrictions
|
|
923
|
-
// Block potentially dangerous file types and oversized files.
|
|
924
|
-
// ---------------------------------------------------------------------------
|
|
925
|
-
|
|
926
|
-
// Block large file uploads with any threats
|
|
927
|
-
@id("sentry-file-block-large-threats")
|
|
928
|
-
@name("Block large files with threats")
|
|
929
|
-
@description("Block file uploads over 10MB when any threats are detected. Large files with threats likely contain data dumps or bulk exports being exfiltrated to AI services.")
|
|
930
|
-
@severity("high")
|
|
931
|
-
@tags("file-upload,size-limit,data-protection")
|
|
932
|
-
@reject_message("Upload blocked: security threats detected in a large file. Large data transfers to AI services require threat-free content.")
|
|
933
|
-
forbid (
|
|
934
|
-
principal,
|
|
935
|
-
action == Sentry::Action::"upload_file",
|
|
936
|
-
resource
|
|
937
|
-
)
|
|
938
|
-
when {
|
|
939
|
-
context has file_size_bytes && context has threat_count &&
|
|
940
|
-
context.file_size_bytes > 10485760 && context.threat_count >= 1
|
|
941
|
-
};
|
|
942
|
-
|
|
943
|
-
// ---------------------------------------------------------------------------
|
|
944
|
-
// Section 4: Source Code Protection
|
|
945
|
-
// Block source code uploads to AI services.
|
|
946
|
-
// ---------------------------------------------------------------------------
|
|
947
|
-
|
|
948
|
-
// Block files with high code content
|
|
949
|
-
@id("sentry-file-block-source-code")
|
|
950
|
-
@name("Block source code uploads")
|
|
951
|
-
@description("Block file uploads when source code constitutes more than 80% of the content. Prevents bulk source code exfiltration to external AI services where it may be used for training or exposed.")
|
|
952
|
-
@severity("high")
|
|
953
|
-
@tags("source-code,ip-protection,file-upload,data-leakage")
|
|
954
|
-
@reject_message("Upload blocked: the file appears to be primarily source code (>80%). Bulk source code should not be shared with external AI services to protect intellectual property.")
|
|
955
|
-
forbid (
|
|
956
|
-
principal,
|
|
957
|
-
action == Sentry::Action::"upload_file",
|
|
958
|
-
resource
|
|
959
|
-
)
|
|
960
|
-
when {
|
|
961
|
-
context has contains_code && context.contains_code &&
|
|
962
|
-
context has code_ratio && context.code_ratio > 80
|
|
963
|
-
};
|
|
964
778
|
`;
|
|
965
779
|
const SENTRY_SENTRY_CLIPBOARD_DEFAULT_CEDAR = `// =============================================================================
|
|
966
780
|
// Clipboard Policy (Default)
|
|
@@ -968,10 +782,15 @@ const SENTRY_SENTRY_CLIPBOARD_DEFAULT_CEDAR = `// ==============================
|
|
|
968
782
|
// Controls over paste operations into AI chat services. Covers:
|
|
969
783
|
// - Blanket paste blocking (admin-configurable)
|
|
970
784
|
// - Paste-with-secrets blocking
|
|
785
|
+
// - Paste-with-PII blocking
|
|
971
786
|
// - Paste-with-source-code blocking
|
|
787
|
+
// - Large-paste threat blocking
|
|
788
|
+
// - Paste-with-encoded-payload blocking
|
|
789
|
+
// - Paste-with-invisible-character blocking
|
|
972
790
|
//
|
|
973
|
-
//
|
|
974
|
-
//
|
|
791
|
+
// All policies in this file are scoped to action == "paste_content". Other
|
|
792
|
+
// templates (semantic.cedar, content_safety.cedar, pii.cedar, secrets.cedar)
|
|
793
|
+
// cover process_prompt and upload_file for the same threat categories.
|
|
975
794
|
//
|
|
976
795
|
// Category: clipboard
|
|
977
796
|
// Namespace: Sentry
|
|
@@ -1022,21 +841,38 @@ when {
|
|
|
1022
841
|
context has pii_detected && context.pii_detected
|
|
1023
842
|
};
|
|
1024
843
|
|
|
1025
|
-
// Block
|
|
1026
|
-
@id("sentry-
|
|
1027
|
-
@name("Block
|
|
1028
|
-
@description("Block paste operations when
|
|
844
|
+
// Block pastes containing encoded injection payloads
|
|
845
|
+
@id("sentry-clipboard-block-paste-encoded")
|
|
846
|
+
@name("Block encoded paste content")
|
|
847
|
+
@description("Block paste operations when encoded injection payloads (base64, hex, unicode) are detected. Attackers use encoding to smuggle injection payloads via clipboard transfer.")
|
|
1029
848
|
@severity("high")
|
|
1030
|
-
@tags("
|
|
1031
|
-
@reject_message("Paste blocked:
|
|
849
|
+
@tags("paste-safety,encoding,injection,clipboard")
|
|
850
|
+
@reject_message("Paste blocked: encoded injection payloads detected in pasted content. Content with hidden encoded instructions cannot be shared with AI services.")
|
|
1032
851
|
forbid (
|
|
1033
852
|
principal,
|
|
1034
853
|
action == Sentry::Action::"paste_content",
|
|
1035
854
|
resource
|
|
1036
855
|
)
|
|
1037
856
|
when {
|
|
1038
|
-
context has
|
|
1039
|
-
context has
|
|
857
|
+
context has encoded_content_detected && context.encoded_content_detected &&
|
|
858
|
+
context has encoded_score && context.encoded_score >= 60
|
|
859
|
+
};
|
|
860
|
+
|
|
861
|
+
// Block pastes with invisible characters
|
|
862
|
+
@id("sentry-clipboard-block-paste-invisible")
|
|
863
|
+
@name("Block paste with invisible characters")
|
|
864
|
+
@description("Block paste operations containing invisible Unicode characters (zero-width, bidi overrides). These can hide malicious instructions that appear invisible to users but are processed by AI models.")
|
|
865
|
+
@severity("high")
|
|
866
|
+
@tags("paste-safety,unicode,invisible-chars,clipboard")
|
|
867
|
+
@reject_message("Paste blocked: invisible Unicode characters detected. Hidden characters can disguise malicious instructions that AI models process but users cannot see.")
|
|
868
|
+
forbid (
|
|
869
|
+
principal,
|
|
870
|
+
action == Sentry::Action::"paste_content",
|
|
871
|
+
resource
|
|
872
|
+
)
|
|
873
|
+
when {
|
|
874
|
+
context has contains_invisible_chars && context.contains_invisible_chars &&
|
|
875
|
+
context has invisible_chars_score && context.invisible_chars_score >= 50
|
|
1040
876
|
};
|
|
1041
877
|
`;
|
|
1042
878
|
const SENTRY_SENTRY_ORGANIZATION_DEFAULT_CEDAR = `// =============================================================================
|
|
@@ -1069,7 +905,7 @@ const SENTRY_SENTRY_ORGANIZATION_DEFAULT_CEDAR = `// ===========================
|
|
|
1069
905
|
@reject_message("Message blocked: the content appears to be primarily source code (>80%). Bulk source code should not be shared with external AI services to protect intellectual property.")
|
|
1070
906
|
forbid (
|
|
1071
907
|
principal,
|
|
1072
|
-
action == Sentry::Action::"
|
|
908
|
+
action == Sentry::Action::"process_prompt",
|
|
1073
909
|
resource
|
|
1074
910
|
)
|
|
1075
911
|
when {
|
|
@@ -1105,9 +941,9 @@ export const SENTRY_CATEGORIES = [
|
|
|
1105
941
|
{ id: 'secrets', name: 'Secrets Detection', description: 'Detect and block secrets, API keys, tokens, and other credentials in messages and AI responses' },
|
|
1106
942
|
{ id: 'pii', name: 'PII Detection', description: 'Detect and block personally identifiable information (PII) such as credit card numbers, SSNs, health data, and other sensitive personal data from being shared with AI chat services' },
|
|
1107
943
|
{ id: 'semantic', name: 'Semantic Threat Detection', description: 'Detect and block prompt injection, jailbreak attempts, and high-severity threats in messages, pasted content, and uploaded files' },
|
|
1108
|
-
{ id: 'content_safety', name: 'Content Safety', description: 'Detect and block violent, harmful, hateful, sexual, and profane content in AI interactions,
|
|
944
|
+
{ id: 'content_safety', name: 'Content Safety', description: 'Detect and block violent, harmful, hateful, sexual, and profane content in AI interactions across messages, paste, and file uploads' },
|
|
1109
945
|
{ id: 'file_safety', name: 'File & Attachment Safety', description: 'Enforce document sensitivity controls (MIP labels), block sensitive file uploads, detect secrets and PII in uploaded documents' },
|
|
1110
|
-
{ id: 'clipboard', name: 'Clipboard Policy', description: 'Control paste operations into AI chat services — block paste outright, block when secrets
|
|
946
|
+
{ id: 'clipboard', name: 'Clipboard Policy', description: 'Control paste operations into AI chat services — block paste outright, block when secrets, PII, source code, large threat-laden pastes, encoded payloads, or invisible characters are detected' },
|
|
1111
947
|
{ id: 'organization', name: 'Organization Rules', description: 'Cross-cutting organization-wide rules: source code protection in messages and session-aware threat escalation' },
|
|
1112
948
|
];
|
|
1113
949
|
// =============================================================================
|
|
@@ -1141,11 +977,11 @@ export const SENTRY_TEMPLATES = [
|
|
|
1141
977
|
{
|
|
1142
978
|
id: 'sentry-content-safety-default',
|
|
1143
979
|
name: 'Content Safety',
|
|
1144
|
-
description: 'Detect and block violent, harmful, hateful, sexual, and profane content
|
|
980
|
+
description: 'Detect and block violent, harmful, hateful, sexual, and profane content across messages, paste, and file uploads',
|
|
1145
981
|
category: 'content_safety',
|
|
1146
982
|
cedarText: SENTRY_SENTRY_CONTENT_SAFETY_DEFAULT_CEDAR,
|
|
1147
983
|
severity: 'critical',
|
|
1148
|
-
tags: ['violence', 'hate-speech', 'sexual', 'profanity', 'content-safety', '
|
|
984
|
+
tags: ['violence', 'hate-speech', 'sexual', 'profanity', 'content-safety', 'baseline'],
|
|
1149
985
|
},
|
|
1150
986
|
{
|
|
1151
987
|
id: 'sentry-secrets-default',
|
|
@@ -1168,7 +1004,7 @@ export const SENTRY_TEMPLATES = [
|
|
|
1168
1004
|
{
|
|
1169
1005
|
id: 'sentry-file-safety-default',
|
|
1170
1006
|
name: 'File & Attachment Safety',
|
|
1171
|
-
description: 'Enforce MIP sensitivity labels,
|
|
1007
|
+
description: 'Enforce MIP sensitivity labels (restricted, confidential, rights-managed) and block file uploads containing secrets or PII',
|
|
1172
1008
|
category: 'file_safety',
|
|
1173
1009
|
cedarText: SENTRY_SENTRY_FILE_SAFETY_DEFAULT_CEDAR,
|
|
1174
1010
|
severity: 'critical',
|
|
@@ -1177,11 +1013,11 @@ export const SENTRY_TEMPLATES = [
|
|
|
1177
1013
|
{
|
|
1178
1014
|
id: 'sentry-clipboard-default',
|
|
1179
1015
|
name: 'Clipboard Policy',
|
|
1180
|
-
description: 'Control paste into AI chat services: blanket paste blocking, secrets-
|
|
1016
|
+
description: 'Control paste into AI chat services: blanket paste blocking, paste-with-secrets, paste-with-PII, paste-with-source-code, large pastes carrying threats, encoded injection payloads, and invisible-character payloads',
|
|
1181
1017
|
category: 'clipboard',
|
|
1182
1018
|
cedarText: SENTRY_SENTRY_CLIPBOARD_DEFAULT_CEDAR,
|
|
1183
1019
|
severity: 'high',
|
|
1184
|
-
tags: ['paste', 'clipboard', 'data-protection', 'source-code', 'secrets'],
|
|
1020
|
+
tags: ['paste', 'clipboard', 'data-protection', 'source-code', 'secrets', 'pii', 'encoding', 'invisible-chars'],
|
|
1185
1021
|
},
|
|
1186
1022
|
{
|
|
1187
1023
|
id: 'sentry-organization-default',
|
|
@@ -1199,7 +1035,7 @@ export const SENTRY_TEMPLATES = [
|
|
|
1199
1035
|
/** Raw templates.json metadata for the Sentry service. */
|
|
1200
1036
|
export const SENTRY_TEMPLATES_JSON = `{
|
|
1201
1037
|
"service": "sentry",
|
|
1202
|
-
"version": "1.
|
|
1038
|
+
"version": "1.1.0",
|
|
1203
1039
|
"description": "Sentry policy templates for browser AI security",
|
|
1204
1040
|
"categories": [
|
|
1205
1041
|
{
|
|
@@ -1220,7 +1056,7 @@ export const SENTRY_TEMPLATES_JSON = `{
|
|
|
1220
1056
|
{
|
|
1221
1057
|
"id": "content_safety",
|
|
1222
1058
|
"name": "Content Safety",
|
|
1223
|
-
"description": "Detect and block violent, harmful, hateful, sexual, and profane content in AI interactions,
|
|
1059
|
+
"description": "Detect and block violent, harmful, hateful, sexual, and profane content in AI interactions across messages, paste, and file uploads"
|
|
1224
1060
|
},
|
|
1225
1061
|
{
|
|
1226
1062
|
"id": "file_safety",
|
|
@@ -1230,7 +1066,7 @@ export const SENTRY_TEMPLATES_JSON = `{
|
|
|
1230
1066
|
{
|
|
1231
1067
|
"id": "clipboard",
|
|
1232
1068
|
"name": "Clipboard Policy",
|
|
1233
|
-
"description": "Control paste operations into AI chat services — block paste outright, block when secrets
|
|
1069
|
+
"description": "Control paste operations into AI chat services — block paste outright, block when secrets, PII, source code, large threat-laden pastes, encoded payloads, or invisible characters are detected"
|
|
1234
1070
|
},
|
|
1235
1071
|
{
|
|
1236
1072
|
"id": "organization",
|
|
@@ -1263,11 +1099,11 @@ export const SENTRY_TEMPLATES_JSON = `{
|
|
|
1263
1099
|
{
|
|
1264
1100
|
"id": "sentry-content-safety-default",
|
|
1265
1101
|
"name": "Content Safety",
|
|
1266
|
-
"description": "Detect and block violent, harmful, hateful, sexual, and profane content
|
|
1102
|
+
"description": "Detect and block violent, harmful, hateful, sexual, and profane content across messages, paste, and file uploads",
|
|
1267
1103
|
"category": "content_safety",
|
|
1268
1104
|
"file": "defaults/content_safety.cedar",
|
|
1269
1105
|
"severity": "critical",
|
|
1270
|
-
"tags": ["violence", "hate-speech", "sexual", "profanity", "content-safety", "
|
|
1106
|
+
"tags": ["violence", "hate-speech", "sexual", "profanity", "content-safety", "baseline"]
|
|
1271
1107
|
},
|
|
1272
1108
|
{
|
|
1273
1109
|
"id": "sentry-secrets-default",
|
|
@@ -1290,7 +1126,7 @@ export const SENTRY_TEMPLATES_JSON = `{
|
|
|
1290
1126
|
{
|
|
1291
1127
|
"id": "sentry-file-safety-default",
|
|
1292
1128
|
"name": "File & Attachment Safety",
|
|
1293
|
-
"description": "Enforce MIP sensitivity labels,
|
|
1129
|
+
"description": "Enforce MIP sensitivity labels (restricted, confidential, rights-managed) and block file uploads containing secrets or PII",
|
|
1294
1130
|
"category": "file_safety",
|
|
1295
1131
|
"file": "defaults/file_safety.cedar",
|
|
1296
1132
|
"severity": "critical",
|
|
@@ -1299,11 +1135,11 @@ export const SENTRY_TEMPLATES_JSON = `{
|
|
|
1299
1135
|
{
|
|
1300
1136
|
"id": "sentry-clipboard-default",
|
|
1301
1137
|
"name": "Clipboard Policy",
|
|
1302
|
-
"description": "Control paste into AI chat services: blanket paste blocking, secrets-
|
|
1138
|
+
"description": "Control paste into AI chat services: blanket paste blocking, paste-with-secrets, paste-with-PII, paste-with-source-code, large pastes carrying threats, encoded injection payloads, and invisible-character payloads",
|
|
1303
1139
|
"category": "clipboard",
|
|
1304
1140
|
"file": "defaults/clipboard.cedar",
|
|
1305
1141
|
"severity": "high",
|
|
1306
|
-
"tags": ["paste", "clipboard", "data-protection", "source-code", "secrets"]
|
|
1142
|
+
"tags": ["paste", "clipboard", "data-protection", "source-code", "secrets", "pii", "encoding", "invisible-chars"]
|
|
1307
1143
|
},
|
|
1308
1144
|
{
|
|
1309
1145
|
"id": "sentry-organization-default",
|