@highflame/policy 2.1.35 → 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.
Files changed (81) hide show
  1. package/_schemas/ai_gateway/context.json +431 -11
  2. package/_schemas/ai_gateway/schema.cedarschema +91 -11
  3. package/_schemas/ai_gateway/templates/defaults/agent_security.cedar +66 -43
  4. package/_schemas/ai_gateway/templates/defaults/baseline.cedar +9 -11
  5. package/_schemas/ai_gateway/templates/defaults/semantic.cedar +63 -40
  6. package/_schemas/ai_gateway/templates/defaults/tools.cedar +48 -36
  7. package/_schemas/ai_gateway/templates/llm_default_allow.cedar +9 -10
  8. package/_schemas/ai_gateway/templates/mcp_server_allowlist.cedar +22 -14
  9. package/_schemas/ai_gateway/templates/mcp_tool_permissions.cedar +29 -27
  10. package/_schemas/ai_gateway/templates/pii_redaction.cedar +38 -33
  11. package/_schemas/ai_gateway/templates/templates.json +52 -50
  12. package/_schemas/guardrails/context.json +12 -12
  13. package/_schemas/guardrails/schema.cedarschema +12 -12
  14. package/_schemas/guardrails/templates/defaults/agent_identity.cedar +60 -56
  15. package/_schemas/guardrails/templates/defaults/agentic_safety.cedar +83 -58
  16. package/_schemas/guardrails/templates/defaults/baseline.cedar +9 -12
  17. package/_schemas/guardrails/templates/defaults/injection.cedar +48 -36
  18. package/_schemas/guardrails/templates/defaults/pii.cedar +27 -20
  19. package/_schemas/guardrails/templates/defaults/secrets.cedar +39 -22
  20. package/_schemas/guardrails/templates/defaults/security_patterns.cedar +38 -25
  21. package/_schemas/guardrails/templates/defaults/semantic.cedar +47 -31
  22. package/_schemas/guardrails/templates/defaults/tool_risk.cedar +34 -26
  23. package/_schemas/guardrails/templates/defaults/toxicity.cedar +57 -47
  24. package/_schemas/guardrails/templates/mcp_tool_permissions.cedar +60 -43
  25. package/_schemas/guardrails/templates/profiles/a2a_security/cross_origin.cedar +29 -42
  26. package/_schemas/guardrails/templates/profiles/a2a_security/escalation_detection.cedar +43 -57
  27. package/_schemas/guardrails/templates/profiles/a2a_security/identity_enforcement.cedar +40 -57
  28. package/_schemas/guardrails/templates/profiles/a2a_security/inter_agent_injection.cedar +48 -62
  29. package/_schemas/guardrails/templates/profiles/a2a_security/supply_chain.cedar +40 -56
  30. package/_schemas/guardrails/templates/profiles/advanced_detection/pii.cedar +24 -34
  31. package/_schemas/guardrails/templates/profiles/advanced_detection/secrets.cedar +45 -37
  32. package/_schemas/guardrails/templates/profiles/advanced_detection/threat_severity.cedar +11 -16
  33. package/_schemas/guardrails/templates/profiles/chat_assistant/privacy.cedar +22 -9
  34. package/_schemas/guardrails/templates/profiles/chat_assistant/security.cedar +27 -15
  35. package/_schemas/guardrails/templates/profiles/chat_assistant/trust_safety.cedar +37 -22
  36. package/_schemas/guardrails/templates/profiles/code_agent/agentic_security.cedar +68 -47
  37. package/_schemas/guardrails/templates/profiles/code_agent/encoding.cedar +17 -21
  38. package/_schemas/guardrails/templates/profiles/code_agent/path_security.cedar +74 -73
  39. package/_schemas/guardrails/templates/profiles/code_agent/security.cedar +13 -9
  40. package/_schemas/guardrails/templates/profiles/code_agent/supply_chain.cedar +36 -58
  41. package/_schemas/guardrails/templates/profiles/data_pipeline/agentic_security.cedar +22 -15
  42. package/_schemas/guardrails/templates/profiles/data_pipeline/data_protection.cedar +52 -0
  43. package/_schemas/guardrails/templates/profiles/data_pipeline/privacy.cedar +41 -18
  44. package/_schemas/guardrails/templates/profiles/data_pipeline/security.cedar +18 -36
  45. package/_schemas/guardrails/templates/profiles/multi_agent/agent_safety.cedar +86 -79
  46. package/_schemas/guardrails/templates/profiles/multi_agent/agent_trust.cedar +73 -70
  47. package/_schemas/guardrails/templates/templates.json +198 -217
  48. package/_schemas/overwatch/context.json +14 -14
  49. package/_schemas/overwatch/schema.cedarschema +12 -12
  50. package/_schemas/sentry/context.json +11 -11
  51. package/_schemas/sentry/schema.cedarschema +11 -11
  52. package/_schemas/sentry/templates/defaults/baseline.cedar +8 -12
  53. package/_schemas/sentry/templates/defaults/clipboard.cedar +43 -42
  54. package/_schemas/sentry/templates/defaults/content_safety.cedar +38 -68
  55. package/_schemas/sentry/templates/defaults/file_safety.cedar +18 -26
  56. package/_schemas/sentry/templates/defaults/organization.cedar +10 -17
  57. package/_schemas/sentry/templates/defaults/pii.cedar +52 -73
  58. package/_schemas/sentry/templates/defaults/secrets.cedar +65 -58
  59. package/_schemas/sentry/templates/defaults/semantic.cedar +40 -59
  60. package/_schemas/sentry/templates/templates.json +53 -43
  61. package/dist/ai_gateway-context.gen.d.ts +18 -4
  62. package/dist/ai_gateway-context.gen.js +18 -4
  63. package/dist/ai_gateway-defaults.gen.d.ts +4 -1
  64. package/dist/ai_gateway-defaults.gen.js +398 -320
  65. package/dist/builder.d.ts +2 -1
  66. package/dist/builder.js +5 -2
  67. package/dist/guardrails-context.gen.d.ts +5 -5
  68. package/dist/guardrails-context.gen.js +5 -5
  69. package/dist/guardrails-defaults.gen.d.ts +4 -1
  70. package/dist/guardrails-defaults.gen.js +2130 -1903
  71. package/dist/overwatch-context.gen.d.ts +5 -5
  72. package/dist/overwatch-context.gen.js +5 -5
  73. package/dist/overwatch-defaults.gen.d.ts +4 -1
  74. package/dist/overwatch-defaults.gen.js +560 -566
  75. package/dist/sentry-context.gen.d.ts +3 -3
  76. package/dist/sentry-context.gen.js +3 -3
  77. package/dist/sentry-defaults.gen.d.ts +4 -1
  78. package/dist/sentry-defaults.gen.js +392 -453
  79. package/dist/service-schemas.gen.d.ts +4 -4
  80. package/dist/service-schemas.gen.js +249 -99
  81. package/package.json +1 -1
@@ -7,67 +7,59 @@
7
7
  // =============================================================================
8
8
  // EMBEDDED CEDAR POLICY TEXT
9
9
  // =============================================================================
10
- const SENTRY_SENTRY_BASELINE_DEFAULT_CEDAR = `// =============================================================================
11
- // Baseline Permit Policy (Default)
10
+ const SENTRY_ORGANIZATION_PERMIT_BASELINE_CEDAR = `// =============================================================================
11
+ // Baseline Permit (Default)
12
12
  // =============================================================================
13
- // Permits all actions by default. Threat-specific forbid policies override
14
- // this to block when detection engines identify issues.
13
+ // Permits all Sentry actions by default. Threat-specific forbid policies
14
+ // override this when detectors fire.
15
15
  //
16
- // Cedar is default-deny: without at least one permit rule, every request
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("sentry-baseline-permit-all")
25
- @name("Permit all actions by default")
26
- @description("Baseline permit for all actions — threat-specific forbid policies override this when threats are detected")
20
+ @id("organization.permit-baseline")
21
+ @name("Permit baseline")
22
+ @description("Permits all Sentry actions.")
27
23
  @severity("low")
28
- @tags("baseline,permit-default,organization")
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 SENTRY_SENTRY_SEMANTIC_DEFAULT_CEDAR = `// =============================================================================
36
- // Semantic Threat Detection Policy (Default)
31
+ const SENTRY_SEMANTIC_DEFAULTS_CEDAR = `// =============================================================================
32
+ // Semantic Threat Detection (Default)
37
33
  // =============================================================================
38
- // Detects and blocks prompt injection, jailbreak attempts, and high-severity
39
- // threats across browser AI interactions: messages and file uploads.
40
- // Paste-targeted semantic rules live in clipboard.cedar.
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
- // Uses multi-layered detection from Shield:
43
- // 1. ML classifier scores (injection_score, jailbreak_score)
44
- // 2. Detection engine rule triggers (detected_threats)
45
- // 3. Threat severity aggregation (max_threat_severity, highest_severity)
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 (Prompt Injection) direct + indirect
49
- // OWASP LLM02 (Insecure Output Handling)
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: semantic
53
+ // Category: semantic
55
54
  // Namespace: Sentry
56
55
  // =============================================================================
57
56
 
58
- // ---------------------------------------------------------------------------
59
- // Section 1: Prompt Injection Detection
60
- // Blocks injection attempts in messages and uploaded files.
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,security,owasp-llm01,mitre-aml-t0051,baseline")
70
- @reject_message("Content blocked: prompt injection patterns were detected. This prevents manipulation of AI agent behavior. Remove adversarial instructions and try again.")
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
- // Block content with high ML injection confidence
81
- @id("sentry-semantic-block-injection-score")
82
- @name("Block high-confidence injection")
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-classifier,security,owasp-llm01")
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
- // Section 2: Jailbreak Detection
98
- // Blocks jailbreak attempts in messages sent to AI services.
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,bypass,security,owasp-llm02,mitre-aml-t0054,baseline")
107
- @reject_message("Content blocked: jailbreak patterns were detected. This prevents circumvention of AI safety controls.")
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
- // Block content with high ML jailbreak confidence
118
- @id("sentry-semantic-block-jailbreak-score")
119
- @name("Block high-confidence jailbreak")
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-classifier,security,owasp-llm02")
123
- @reject_message("Content blocked: the ML classifier detected a jailbreak attempt with high confidence.")
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("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.")
119
+ @description("Blocks process_prompt and upload_file when highest_severity equals \\"critical\\".")
142
120
  @severity("critical")
143
- @tags("critical,baseline,security,catch-all")
144
- @reject_message("Content blocked: security scanners detected a critical-severity threat. This content cannot be processed by AI services.")
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 SENTRY_SENTRY_CONTENT_SAFETY_DEFAULT_CEDAR = `// =============================================================================
156
- // Content Safety Policy (Default)
132
+ const SENTRY_TRUST_SAFETY_DEFAULTS_CEDAR = `// =============================================================================
133
+ // Content Safety (Default)
157
134
  // =============================================================================
158
- // Detects and blocks violent, harmful, hateful, sexual, and profane content
159
- // in AI chat interactions across messages and file uploads.
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
- // Paste-specific content safety rules live in clipboard.cedar — see
162
- // "Clipboard Policy".
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
- // The detection engine runs ML classifiers (toxicity, content safety) and
165
- // produces normalized scores (0-100) for each category.
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 (Information System Monitoring)
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: content_safety
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("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.")
157
+ @description("Blocks process_prompt and upload_file when violence_score >= 80.")
187
158
  @severity("critical")
188
- @tags("violence,content-safety,trust-safety,nist-si-4,iso-42001")
189
- @reject_message("Content blocked: violent content detected. AI services must not process violent content in enterprise environments. Please rephrase without violence-related language.")
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
- // Block weapons content
200
- @id("sentry-cs-block-weapons")
170
+ @id("trust-safety.block-weapons")
201
171
  @name("Block weapons content")
202
- @description("Block content when the ML weapons detection score exceeds threshold (80/100). Catches weapon manufacturing instructions, procurement guidance, and detailed specifications.")
172
+ @description("Blocks process_prompt and upload_file when weapons_score >= 80.")
203
173
  @severity("critical")
204
- @tags("weapons,content-safety,trust-safety,nist-si-4")
205
- @reject_message("Content blocked: weapons-related content detected. AI services must not process weapons manufacturing, procurement, or specification content.")
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("Block content when the ML hate speech score exceeds threshold (75/100). Lower threshold than other categories because enterprises have zero tolerance for discriminatory content. Catches slurs, dehumanizing language, and targeted harassment.")
187
+ @description("Blocks process_prompt and upload_file when hate_speech_score >= 75.")
224
188
  @severity("critical")
225
- @tags("hate-speech,content-safety,trust-safety,nist-si-4,eu-ai-act")
226
- @reject_message("Content blocked: hate speech or discriminatory content detected. AI services must not process hateful, discriminatory, or dehumanizing content.")
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("Block content when the ML criminal activity detection score exceeds threshold (80/100). Catches illegal activity instructions, fraud techniques, and criminal behavior content.")
202
+ @description("Blocks process_prompt and upload_file when crime_score >= 80.")
244
203
  @severity("high")
245
- @tags("crime,content-safety,trust-safety,nist-si-4")
246
- @reject_message("Content blocked: criminal activity content detected. AI services must not process content related to illegal activities or fraud.")
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("Block content when the ML sexual content score exceeds threshold (80/100). Ensures AI services do not process sexually explicit material in enterprise environments.")
217
+ @description("Blocks process_prompt and upload_file when sexual_score >= 80.")
264
218
  @severity("high")
265
- @tags("sexual,content-safety,trust-safety,eu-ai-act,iso-42001")
266
- @reject_message("Content blocked: sexual content detected. AI services must not process sexually explicit material in enterprise environments.")
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
- // Section 5: Profanity
278
- // Higher threshold (90) allows normal expression while blocking abuse.
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("profanity,content-safety,trust-safety")
287
- @reject_message("Content blocked: excessive profanity detected. Please rephrase in a professional manner.")
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 SENTRY_SENTRY_SECRETS_DEFAULT_CEDAR = `// =============================================================================
299
- // Secrets Detection Policy (Default)
245
+ const SENTRY_DATA_PROTECTION_DEFAULTS_CEDAR = `// =============================================================================
246
+ // Secrets Detection (Default)
300
247
  // =============================================================================
301
- // Block credential and secret leakage across messages and file uploads.
302
- // Shield SecretsDetector identifies 18+ secret types via regex.
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
- // Paste-targeted secret rules live in clipboard.cedar.
252
+ // Context keys consumed:
253
+ // - secrets_detected: Bool
254
+ // - secret_types: Set<String>
255
+ // - secret_count: Long
256
+ // - detected_threats: Set<String>
305
257
  //
306
- // Category: secrets
258
+ // Compliance:
259
+ // - NIST 800-53 SC-28, IA-5; MITRE ATT&CK T1552
260
+ //
261
+ // Category: data-protection
307
262
  // Namespace: Sentry
308
263
  // =============================================================================
309
264
 
310
- // Block messages and uploads containing secrets
311
- @id("sentry-org-block-secrets-messages")
312
- @name("Block messages and uploads with secrets")
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,credentials,messages,nist-sc-28,nist-ia-5")
316
- @reject_message("Content blocked: detected secrets such as API keys, tokens, or credentials. Remove all secrets before sending to AI services.")
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 contains_secrets && context.contains_secrets
277
+ context has secrets_detected && context.secrets_detected == true
324
278
  };
325
279
 
326
- // Block high-risk secret types across messages and file uploads
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("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.")
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,aws,github,ssh,cloud,nist-ia-5,mitre-t1552")
332
- @reject_message("Content blocked: high-risk credentials detected (cloud keys, GitHub tokens, SSH keys). Use a secrets manager — never share credentials with AI services.")
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
- (context.secret_types.contains("aws_access_key") ||
341
- context.secret_types.contains("aws_secret_key") ||
342
- context.secret_types.contains("gcp_service_account") ||
343
- context.secret_types.contains("azure_connection_string") ||
344
- context.secret_types.contains("github_token") ||
345
- context.secret_types.contains("github_fine_grained") ||
346
- context.secret_types.contains("private_key"))
347
- };
348
-
349
- // Block API keys and tokens across messages and file uploads
350
- @id("sentry-org-block-api-keys")
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("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.")
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("secrets,api-key,jwt,oauth,nist-ia-5")
355
- @reject_message("Content blocked: API keys, JWT tokens, or OAuth credentials detected. These must never be shared with AI services.")
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
- (context.secret_types.contains("generic_api_key") ||
364
- context.secret_types.contains("jwt_token") ||
365
- context.secret_types.contains("openai_key") ||
366
- context.secret_types.contains("anthropic_key") ||
367
- context.secret_types.contains("stripe_key"))
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
- // Block SSH key exposure across messages and file uploads
371
- @id("sentry-secrets-block-ssh-keys")
326
+ @id("data-protection.block-ssh-keys")
372
327
  @name("Block SSH key exposure")
373
- @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.")
328
+ @description("Blocks process_prompt and upload_file when secret_types contains \\"ssh_key\\".")
374
329
  @severity("critical")
375
- @tags("secrets,ssh,credentials,nist-ia-5,mitre-t1552")
376
- @reject_message("Blocked: SSH private key content or key file path detected. AI chat services must not receive SSH credentials.")
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
- // Block PEM/certificate key exposure across messages and file uploads
387
- @id("sentry-secrets-block-pem-keys")
388
- @name("Block PEM/certificate key exposure")
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,certificates,pem,nist-ia-5,mitre-t1552")
392
- @reject_message("Blocked: PEM private key or certificate key file detected. AI chat services must not receive certificate credentials.")
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
- // Block bulk secret exposure
403
- @id("sentry-org-block-bulk-secrets")
356
+ @id("data-protection.block-secrets-bulk")
404
357
  @name("Block bulk secret exposure")
405
- @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.")
358
+ @description("Blocks process_prompt and upload_file when secret_count >= 3.")
406
359
  @severity("critical")
407
- @tags("secrets,bulk,data-exfiltration,nist-sc-28")
408
- @reject_message("Content blocked: multiple credentials detected (3+). Configuration dumps and credential lists must never be shared with AI services.")
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
- // Block detected credential patterns
419
- @id("sentry-org-block-detected-credentials")
371
+ @id("data-protection.block-credential-patterns")
420
372
  @name("Block detected credential patterns")
421
- @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.")
373
+ @description("Blocks process_prompt and upload_file when detected_threats contains a credential-pattern rule trigger.")
422
374
  @severity("critical")
423
- @tags("secrets,credentials,detection-rules,nist-ia-5")
424
- @reject_message("Content blocked: detection engines identified credential patterns including secret exposure, API keys, or token leaks.")
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
- (context.detected_threats.contains("secret_exposure") ||
433
- context.detected_threats.contains("credential_leak") ||
434
- context.detected_threats.contains("api_key_exposure"))
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 SENTRY_SENTRY_PII_DEFAULT_CEDAR = `// =============================================================================
438
- // PII Detection Policy (Default)
391
+ const SENTRY_PRIVACY_DEFAULTS_CEDAR = `// =============================================================================
392
+ // PII Detection (Default)
439
393
  // =============================================================================
440
- // Detects and blocks personally identifiable information across messages
441
- // and file uploads. Uses multi-layered detection:
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
- // 1. PII boolean flag (pii_detected) — broadest catch from detection engine
446
- // 2. Granular PII type matching (pii_types) — type-specific blocking
447
- // 3. PII confidence score (pii_confidence) — ML classifier confidence
448
- // 4. Detection rule triggers (detected_threats) — named rule matches
449
- // 5. Bulk PII exposure (pii_count) — data dump prevention
450
- //
451
- // PII Types Detected by Shield PIIRegexDetector:
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, 4.1 (Payment Card Data)
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: pii
412
+ // Category: privacy
463
413
  // Namespace: Sentry
464
414
  // =============================================================================
465
415
 
466
416
  // ---------------------------------------------------------------------------
467
- // Section 1: Primary PII Detection
468
- // Fires when the detection pipeline identifies PII in any content.
417
+ // Section 1: Primary PII detection
469
418
  // ---------------------------------------------------------------------------
470
419
 
471
- // Block messages and uploads containing detected PII
472
- @id("sentry-pii-block-messages")
420
+ @id("privacy.block-pii")
473
421
  @name("Block messages and uploads with PII")
474
- @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.")
422
+ @description("Blocks process_prompt and upload_file when pii_detected is true.")
475
423
  @severity("critical")
476
- @tags("pii,privacy,data-protection,gdpr-art-32,owasp-llm06")
477
- @reject_message("Content blocked: personally identifiable information was detected. Remove all PII (names, addresses, SSNs, credit cards, etc.) before sending to AI services.")
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 Type Blocking
489
- // Blocks specific PII types based on regulatory requirements.
436
+ // Section 2: Granular PII type blocking
490
437
  // ---------------------------------------------------------------------------
491
438
 
492
- // Block credit card numbers (PCI DSS compliance)
493
- @id("sentry-pii-block-credit-cards")
439
+ @id("privacy.block-credit-card")
494
440
  @name("Block credit card numbers")
495
- @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.")
441
+ @description("Blocks process_prompt and upload_file when pii_types or detected_threats contains \\"credit_card\\".")
496
442
  @severity("critical")
497
- @tags("pci,credit-card,payment,compliance,pci-dss-3.4")
498
- @reject_message("Content blocked: credit card number patterns detected. Sharing payment card data with AI services violates PCI DSS. Use tokenized references instead.")
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
- // Block Social Security Numbers
510
- @id("sentry-pii-block-ssn")
455
+ @id("privacy.block-ssn")
511
456
  @name("Block Social Security Numbers")
512
- @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.")
457
+ @description("Blocks process_prompt and upload_file when pii_types or detected_threats contains \\"ssn\\".")
513
458
  @severity("critical")
514
- @tags("ssn,identity,privacy,compliance,nist-si-4")
515
- @reject_message("Content blocked: Social Security Number patterns detected. SSNs must never be shared with AI services.")
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
- // Block passport numbers
527
- @id("sentry-pii-block-passport")
471
+ @id("privacy.block-passport")
528
472
  @name("Block passport numbers")
529
- @description("Block messages and file uploads containing passport number patterns. Passport numbers are government-issued identifiers with high identity theft risk.")
473
+ @description("Blocks process_prompt and upload_file when pii_types contains \\"passport\\".")
530
474
  @severity("critical")
531
- @tags("passport,identity,privacy,gdpr")
532
- @reject_message("Content blocked: passport number patterns detected. Government-issued identifiers must not be shared with AI services.")
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
- // Block IBAN (International Bank Account Numbers)
543
- @id("sentry-pii-block-iban")
486
+ @id("privacy.block-iban")
544
487
  @name("Block bank account numbers")
545
- @description("Block messages and file uploads containing IBAN patterns. Bank account numbers are sensitive financial identifiers that must not be exposed to AI services.")
488
+ @description("Blocks process_prompt and upload_file when pii_types contains \\"iban\\".")
546
489
  @severity("critical")
547
- @tags("iban,financial,privacy,gdpr,pci-dss")
548
- @reject_message("Content blocked: bank account number (IBAN) patterns detected. Financial account numbers must not be shared with AI services.")
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
- // Block bulk PII exposure
559
- @id("sentry-pii-block-bulk-exposure")
501
+ @id("privacy.block-pii-bulk")
560
502
  @name("Block bulk PII exposure")
561
- @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.")
503
+ @description("Blocks process_prompt and upload_file when pii_count >= 3.")
562
504
  @severity("critical")
563
- @tags("pii,bulk,data-exfiltration,gdpr-art-32,ccpa")
564
- @reject_message("Content blocked: multiple PII items detected (3+). Bulk personal data must never be shared with AI services. Use data masking or tokenization.")
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: PII Confidence Detection
576
- // Catches PII patterns via ML classifier that escape regex detection.
517
+ // Section 3: ML classifier and aggregation
577
518
  // ---------------------------------------------------------------------------
578
519
 
579
- // Block high-confidence PII
580
- @id("sentry-pii-block-high-confidence")
581
- @name("Block high-confidence PII")
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,confidence,privacy,compliance,ml-classifier")
585
- @reject_message("Content blocked: the ML classifier detected personally identifiable information with high confidence. The content appears to contain personal data.")
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 pii_confidence && context.pii_confidence >= 80
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("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.")
537
+ @description("Blocks process_prompt and upload_file when threat_categories contains \\"pii\\".")
604
538
  @severity("high")
605
- @tags("pii,privacy,data-protection,gdpr")
606
- @reject_message("Content blocked: threat scanners detected personally identifiable information. Remove all PII before submitting.")
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 SENTRY_SENTRY_FILE_SAFETY_DEFAULT_CEDAR = `// =============================================================================
618
- // File & Attachment Safety Policy (Default)
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
- // Detection layers:
624
- // 1. Secrets in file content — from Shield SecretsDetector
625
- // 2. PII in file content — from Shield PIIRegexDetector
556
+ // Context keys consumed:
557
+ // - secrets_detected: Bool
558
+ // - pii_detected: Bool
626
559
  //
627
560
  // Compliance:
628
- // NIST 800-53 SC-28 (Protection of Information at Rest)
629
- // GDPR Art. 32 (Security of Processing)
561
+ // - NIST 800-53 SC-28; GDPR Art. 32
630
562
  //
631
- // Category: file_safety
563
+ // Category: file-safety
632
564
  // Namespace: Sentry
633
565
  // =============================================================================
634
566
 
635
- // ---------------------------------------------------------------------------
636
- // Section 1: File Content Security
637
- // Block text files containing secrets or PII.
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("secrets,file-upload,credentials,nist-sc-28")
646
- @reject_message("Upload blocked: secrets or credentials detected in the file. Files containing API keys, tokens, or passwords must not be shared with AI services.")
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 contains_secrets && context.contains_secrets
579
+ context has secrets_detected && context.secrets_detected == true
654
580
  };
655
581
 
656
- // Block text files with PII
657
- @id("sentry-pii-block-uploads")
658
- @name("Block text files with PII")
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,file-upload,data-protection,gdpr-art-32")
662
- @reject_message("File upload blocked: personally identifiable information detected in the document. Files containing PII must not be shared with AI services.")
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 SENTRY_SENTRY_CLIPBOARD_DEFAULT_CEDAR = `// =============================================================================
597
+ const SENTRY_CLIPBOARD_DEFAULTS_CEDAR = `// =============================================================================
673
598
  // Clipboard Policy (Default)
674
599
  // =============================================================================
675
- // Controls over paste operations into AI chat services. Covers:
676
- // - Blanket paste blocking (admin-configurable)
677
- // - Paste-with-secrets blocking
678
- // - Paste-with-PII blocking
679
- // - Paste-with-source-code blocking
680
- // - Large-paste threat blocking
681
- // - Paste-with-encoded-payload blocking
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
- // All policies in this file are scoped to action == "paste_content". Other
685
- // templates (semantic.cedar, content_safety.cedar, pii.cedar, secrets.cedar)
686
- // cover process_prompt and upload_file for the same threat categories.
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: clipboard
619
+ // Category: clipboard
689
620
  // Namespace: Sentry
690
621
  // =============================================================================
691
622
 
692
- // Block all paste operations
693
- @id("sentry-org-block-all-paste")
623
+ @id("clipboard.block-all-paste")
694
624
  @name("Block all paste operations")
695
- @description("Unconditionally block all paste operations into AI chat services. Enable this rule to prevent any content from being pasted into AI chats regardless of content. Disable to allow paste (subject to other policy rules).")
625
+ @description("Blocks paste_content unconditionally.")
696
626
  @severity("high")
697
- @tags("paste,clipboard,data-protection,organization")
698
- @reject_message("Paste blocked: your organization does not allow pasting content into AI services. Type your message directly or contact your administrator.")
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
- // Block pasted content containing secrets
706
- @id("sentry-org-block-secrets-paste")
635
+ @id("clipboard.block-paste-secrets")
707
636
  @name("Block paste with secrets")
708
- @description("Block paste operations when secrets are detected. Prevents credential leakage when users paste from terminals, config files, or code editors into AI chats.")
637
+ @description("Blocks paste_content when secrets_detected is true.")
709
638
  @severity("critical")
710
- @tags("secrets,paste-safety,credentials,nist-sc-28")
711
- @reject_message("Paste blocked: secrets or credentials detected in pasted content. Remove API keys, tokens, and passwords before pasting into AI services.")
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 contains_secrets && context.contains_secrets
647
+ context has secrets_detected && context.secrets_detected == true
719
648
  };
720
649
 
721
- // Block pasted content containing PII
722
- @id("sentry-pii-block-paste")
650
+ @id("clipboard.block-paste-pii")
723
651
  @name("Block paste with PII")
724
- @description("Block paste operations when PII is detected in pasted content. Prevents data leakage when employees paste content from emails, spreadsheets, or documents containing personal data into AI chats.")
652
+ @description("Blocks paste_content when pii_detected is true.")
725
653
  @severity("critical")
726
- @tags("pii,paste-safety,data-leakage,gdpr-art-32")
727
- @reject_message("Paste blocked: personally identifiable information detected in pasted content. Remove PII before pasting into AI services.")
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
- // Block pastes containing encoded injection payloads
738
- @id("sentry-clipboard-block-paste-encoded")
739
- @name("Block encoded paste content")
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("paste-safety,encoding,injection,clipboard")
743
- @reject_message("Paste blocked: encoded injection payloads detected in pasted content. Content with hidden encoded instructions cannot be shared with AI services.")
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
- // Block pastes with invisible characters
755
- @id("sentry-clipboard-block-paste-invisible")
681
+ @id("clipboard.block-paste-invisible")
756
682
  @name("Block paste with invisible characters")
757
- @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.")
683
+ @description("Blocks paste_content when invisible_chars_detected is true and invisible_chars_score >= 50.")
758
684
  @severity("high")
759
- @tags("paste-safety,unicode,invisible-chars,clipboard")
760
- @reject_message("Paste blocked: invisible Unicode characters detected. Hidden characters can disguise malicious instructions that AI models process but users cannot see.")
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 contains_invisible_chars && context.contains_invisible_chars &&
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 SENTRY_SENTRY_ORGANIZATION_DEFAULT_CEDAR = `// =============================================================================
772
- // Organization Rules Policy (Default)
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
- // Secret/credential rules live in secrets.cedar; paste/clipboard rules live
776
- // in clipboard.cedar.
701
+ // Currently: session-aware threat escalation circuit breaker.
777
702
  //
778
- // This template covers:
779
- // - Session-aware threat escalation
703
+ // Context keys consumed:
704
+ // - session_threat_turns: Long
780
705
  //
781
- // Category: organization
706
+ // Category: organization
782
707
  // Namespace: Sentry
783
708
  // =============================================================================
784
709
 
785
- // ---------------------------------------------------------------------------
786
- // Section 1: Session-Aware Escalation
787
- // Escalate protections when threats are detected across the session.
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("session,escalation,behavioral,defense-in-depth")
796
- @reject_message("Session blocked: security threats have been detected in multiple turns of this conversation. This session has been flagged for review. Please start a new session or contact your security team.")
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: 'secrets', name: 'Secrets Detection', description: 'Detect and block secrets, API keys, tokens, and other credentials in messages and AI responses' },
811
- { 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' },
812
- { 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' },
813
- { 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' },
814
- { id: 'file_safety', name: 'File & Attachment Safety', description: 'Block file uploads containing secrets or PII in document content' },
815
- { 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' },
816
- { id: 'organization', name: 'Organization Rules', description: 'Cross-cutting organization-wide rules: session-aware threat escalation' },
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: 'sentry-baseline-default',
742
+ id: 'organization.permit-baseline',
824
743
  name: 'Baseline Permit',
825
- description: 'Permits all actions by default threat-specific forbid policies override this when threats are detected',
744
+ description: 'Permits all actions by default; threat-specific forbid policies override this when detectors fire.',
826
745
  category: 'organization',
827
- cedarText: SENTRY_SENTRY_BASELINE_DEFAULT_CEDAR,
746
+ cedarText: SENTRY_ORGANIZATION_PERMIT_BASELINE_CEDAR,
828
747
  severity: 'low',
829
- tags: ['baseline', 'permit-default', 'organization'],
748
+ tags: ['category:organization', 'posture:permit-default'],
830
749
  isActive: true,
831
750
  },
832
751
  ];
@@ -835,67 +754,77 @@ export const SENTRY_DEFAULTS = [
835
754
  // =============================================================================
836
755
  export const SENTRY_TEMPLATES = [
837
756
  {
838
- id: 'sentry-semantic-default',
757
+ id: 'organization.permit-baseline',
758
+ name: 'Baseline Permit',
759
+ description: 'Permits all actions by default; threat-specific forbid policies override this when detectors fire.',
760
+ category: 'organization',
761
+ cedarText: SENTRY_ORGANIZATION_PERMIT_BASELINE_CEDAR,
762
+ severity: 'low',
763
+ tags: ['category:organization', 'posture:permit-default'],
764
+ autoDeploy: true,
765
+ },
766
+ {
767
+ id: 'semantic.defaults',
839
768
  name: 'Semantic Threat Detection',
840
- description: 'Detect and block prompt injection, jailbreak attempts, and high-severity threats across messages, paste, and file uploads',
769
+ description: 'Block prompt injection, jailbreak attempts, and critical-severity threats in messages and uploads.',
841
770
  category: 'semantic',
842
- cedarText: SENTRY_SENTRY_SEMANTIC_DEFAULT_CEDAR,
771
+ cedarText: SENTRY_SEMANTIC_DEFAULTS_CEDAR,
843
772
  severity: 'critical',
844
- tags: ['injection', 'jailbreak', 'owasp-llm01', 'owasp-llm02', 'baseline'],
773
+ tags: ['category:semantic', 'threat:injection', 'threat:jailbreak', 'owasp:llm01', 'owasp:llm02'],
845
774
  },
846
775
  {
847
- id: 'sentry-content-safety-default',
776
+ id: 'trust-safety.defaults',
848
777
  name: 'Content Safety',
849
- description: 'Detect and block violent, harmful, hateful, sexual, and profane content across messages, paste, and file uploads',
850
- category: 'content_safety',
851
- cedarText: SENTRY_SENTRY_CONTENT_SAFETY_DEFAULT_CEDAR,
778
+ description: 'Block violent, weapons, hateful, criminal, sexual, or excessively profane content.',
779
+ category: 'trust-safety',
780
+ cedarText: SENTRY_TRUST_SAFETY_DEFAULTS_CEDAR,
852
781
  severity: 'critical',
853
- tags: ['violence', 'hate-speech', 'sexual', 'profanity', 'content-safety', 'baseline'],
782
+ tags: ['category:trust-safety', 'threat:harmful', 'threat:hate-speech', 'compliance:eu-ai-act', 'compliance:iso-42001'],
854
783
  },
855
784
  {
856
- id: 'sentry-secrets-default',
785
+ id: 'data-protection.defaults',
857
786
  name: 'Secrets Detection',
858
- description: 'Block secrets, API keys, tokens, and credential leakage in messages and AI responses across all interactions',
859
- category: 'secrets',
860
- cedarText: SENTRY_SENTRY_SECRETS_DEFAULT_CEDAR,
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,
861
790
  severity: 'critical',
862
- tags: ['secrets', 'credentials', 'api-keys', 'data-protection'],
791
+ tags: ['category:data-protection', 'threat:secrets', 'owasp:llm06'],
863
792
  },
864
793
  {
865
- id: 'sentry-pii-default',
794
+ id: 'privacy.defaults',
866
795
  name: 'PII Detection',
867
- description: 'Detect and block credit card numbers, SSNs, health data, and other PII in messages, pasted content, file uploads, and AI responses',
868
- category: 'pii',
869
- cedarText: SENTRY_SENTRY_PII_DEFAULT_CEDAR,
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,
870
799
  severity: 'critical',
871
- tags: ['pii', 'privacy', 'compliance', 'pci-dss', 'gdpr', 'hipaa', 'baseline'],
800
+ tags: ['category:privacy', 'threat:pii', 'compliance:pci-dss', 'compliance:gdpr', 'compliance:hipaa'],
872
801
  },
873
802
  {
874
- id: 'sentry-file-safety-default',
803
+ id: 'file-safety.defaults',
875
804
  name: 'File & Attachment Safety',
876
- description: 'Block file uploads containing secrets or PII in document content',
877
- category: 'file_safety',
878
- cedarText: SENTRY_SENTRY_FILE_SAFETY_DEFAULT_CEDAR,
805
+ description: 'Block file uploads containing secrets or PII in document content.',
806
+ category: 'file-safety',
807
+ cedarText: SENTRY_FILE_SAFETY_DEFAULTS_CEDAR,
879
808
  severity: 'critical',
880
- tags: ['file-upload', 'secrets', 'pii', 'dlp'],
809
+ tags: ['category:file-safety', 'threat:secrets', 'threat:pii'],
881
810
  },
882
811
  {
883
- id: 'sentry-clipboard-default',
812
+ id: 'clipboard.defaults',
884
813
  name: 'Clipboard Policy',
885
- 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',
814
+ description: 'Block all-paste, paste-with-secrets, paste-with-PII, encoded payload pastes, and pastes with invisible characters.',
886
815
  category: 'clipboard',
887
- cedarText: SENTRY_SENTRY_CLIPBOARD_DEFAULT_CEDAR,
888
- severity: 'high',
889
- tags: ['paste', 'clipboard', 'data-protection', 'source-code', 'secrets', 'pii', 'encoding', 'invisible-chars'],
816
+ cedarText: SENTRY_CLIPBOARD_DEFAULTS_CEDAR,
817
+ severity: 'critical',
818
+ tags: ['category:clipboard', 'threat:secrets', 'threat:pii', 'threat:encoded-payload', 'threat:invisible-chars'],
890
819
  },
891
820
  {
892
- id: 'sentry-organization-default',
893
- name: 'Organization Rules',
894
- description: 'Cross-cutting organization-wide policies: session-aware threat escalation',
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.',
895
824
  category: 'organization',
896
- cedarText: SENTRY_SENTRY_ORGANIZATION_DEFAULT_CEDAR,
825
+ cedarText: SENTRY_ORGANIZATION_BLOCK_SESSION_THREAT_ESCALATION_CEDAR,
897
826
  severity: 'high',
898
- tags: ['session', 'escalation', 'organization'],
827
+ tags: ['category:organization', 'detection:aggregate', 'posture:catch-all'],
899
828
  },
900
829
  ];
901
830
  // =============================================================================
@@ -904,120 +833,130 @@ export const SENTRY_TEMPLATES = [
904
833
  /** Raw templates.json metadata for the Sentry service. */
905
834
  export const SENTRY_TEMPLATES_JSON = `{
906
835
  "service": "sentry",
907
- "version": "1.1.0",
836
+ "version": "2.0.0",
908
837
  "description": "Sentry policy templates for browser AI security",
909
838
  "categories": [
910
839
  {
911
- "id": "secrets",
912
- "name": "Secrets Detection",
913
- "description": "Detect and block secrets, API keys, tokens, and other credentials in messages and AI responses"
840
+ "id": "data-protection",
841
+ "name": "Secrets & Data Protection",
842
+ "description": "Block secrets, API keys, tokens, and credentials in messages and uploads."
914
843
  },
915
844
  {
916
- "id": "pii",
845
+ "id": "privacy",
917
846
  "name": "PII Detection",
918
- "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"
847
+ "description": "Block personally identifiable information across messages and uploads."
919
848
  },
920
849
  {
921
850
  "id": "semantic",
922
851
  "name": "Semantic Threat Detection",
923
- "description": "Detect and block prompt injection, jailbreak attempts, and high-severity threats in messages, pasted content, and uploaded files"
852
+ "description": "Block prompt injection, jailbreak attempts, and high-severity threats."
924
853
  },
925
854
  {
926
- "id": "content_safety",
855
+ "id": "trust-safety",
927
856
  "name": "Content Safety",
928
- "description": "Detect and block violent, harmful, hateful, sexual, and profane content in AI interactions across messages, paste, and file uploads"
857
+ "description": "Block violent, harmful, hateful, sexual, or profane content."
929
858
  },
930
859
  {
931
- "id": "file_safety",
860
+ "id": "file-safety",
932
861
  "name": "File & Attachment Safety",
933
- "description": "Block file uploads containing secrets or PII in document content"
862
+ "description": "Block file uploads containing secrets or PII."
934
863
  },
935
864
  {
936
865
  "id": "clipboard",
937
866
  "name": "Clipboard Policy",
938
- "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"
867
+ "description": "Control paste operations into AI chat services."
939
868
  },
940
869
  {
941
870
  "id": "organization",
942
871
  "name": "Organization Rules",
943
- "description": "Cross-cutting organization-wide rules: session-aware threat escalation"
872
+ "description": "Organization-wide baselines and session-aware threat escalation."
944
873
  }
945
874
  ],
946
875
  "defaults": [
947
876
  {
948
- "id": "sentry-baseline-default",
877
+ "id": "organization.permit-baseline",
949
878
  "name": "Baseline Permit",
950
- "description": "Permits all actions by default threat-specific forbid policies override this when threats are detected",
879
+ "description": "Permits all actions by default; threat-specific forbid policies override this when detectors fire.",
951
880
  "category": "organization",
952
881
  "file": "defaults/baseline.cedar",
953
882
  "severity": "low",
954
- "tags": ["baseline", "permit-default", "organization"],
883
+ "tags": ["category:organization", "posture:permit-default"],
955
884
  "is_active": true
956
885
  }
957
886
  ],
958
887
  "templates": [
959
888
  {
960
- "id": "sentry-semantic-default",
889
+ "id": "organization.permit-baseline",
890
+ "name": "Baseline Permit",
891
+ "description": "Permits all actions by default; threat-specific forbid policies override this when detectors fire.",
892
+ "category": "organization",
893
+ "file": "defaults/baseline.cedar",
894
+ "severity": "low",
895
+ "tags": ["category:organization", "posture:permit-default"],
896
+ "auto_deploy": true
897
+ },
898
+ {
899
+ "id": "semantic.defaults",
961
900
  "name": "Semantic Threat Detection",
962
- "description": "Detect and block prompt injection, jailbreak attempts, and high-severity threats across messages, paste, and file uploads",
901
+ "description": "Block prompt injection, jailbreak attempts, and critical-severity threats in messages and uploads.",
963
902
  "category": "semantic",
964
903
  "file": "defaults/semantic.cedar",
965
904
  "severity": "critical",
966
- "tags": ["injection", "jailbreak", "owasp-llm01", "owasp-llm02", "baseline"]
905
+ "tags": ["category:semantic", "threat:injection", "threat:jailbreak", "owasp:llm01", "owasp:llm02"]
967
906
  },
968
907
  {
969
- "id": "sentry-content-safety-default",
908
+ "id": "trust-safety.defaults",
970
909
  "name": "Content Safety",
971
- "description": "Detect and block violent, harmful, hateful, sexual, and profane content across messages, paste, and file uploads",
972
- "category": "content_safety",
910
+ "description": "Block violent, weapons, hateful, criminal, sexual, or excessively profane content.",
911
+ "category": "trust-safety",
973
912
  "file": "defaults/content_safety.cedar",
974
913
  "severity": "critical",
975
- "tags": ["violence", "hate-speech", "sexual", "profanity", "content-safety", "baseline"]
914
+ "tags": ["category:trust-safety", "threat:harmful", "threat:hate-speech", "compliance:eu-ai-act", "compliance:iso-42001"]
976
915
  },
977
916
  {
978
- "id": "sentry-secrets-default",
917
+ "id": "data-protection.defaults",
979
918
  "name": "Secrets Detection",
980
- "description": "Block secrets, API keys, tokens, and credential leakage in messages and AI responses across all interactions",
981
- "category": "secrets",
919
+ "description": "Block secrets, API keys, tokens, and credential leakage in messages and AI responses.",
920
+ "category": "data-protection",
982
921
  "file": "defaults/secrets.cedar",
983
922
  "severity": "critical",
984
- "tags": ["secrets", "credentials", "api-keys", "data-protection"]
923
+ "tags": ["category:data-protection", "threat:secrets", "owasp:llm06"]
985
924
  },
986
925
  {
987
- "id": "sentry-pii-default",
926
+ "id": "privacy.defaults",
988
927
  "name": "PII Detection",
989
- "description": "Detect and block credit card numbers, SSNs, health data, and other PII in messages, pasted content, file uploads, and AI responses",
990
- "category": "pii",
928
+ "description": "Block credit card numbers, SSNs, passport/IBAN, and other PII across messages and file uploads.",
929
+ "category": "privacy",
991
930
  "file": "defaults/pii.cedar",
992
931
  "severity": "critical",
993
- "tags": ["pii", "privacy", "compliance", "pci-dss", "gdpr", "hipaa", "baseline"]
932
+ "tags": ["category:privacy", "threat:pii", "compliance:pci-dss", "compliance:gdpr", "compliance:hipaa"]
994
933
  },
995
934
  {
996
- "id": "sentry-file-safety-default",
935
+ "id": "file-safety.defaults",
997
936
  "name": "File & Attachment Safety",
998
- "description": "Block file uploads containing secrets or PII in document content",
999
- "category": "file_safety",
937
+ "description": "Block file uploads containing secrets or PII in document content.",
938
+ "category": "file-safety",
1000
939
  "file": "defaults/file_safety.cedar",
1001
940
  "severity": "critical",
1002
- "tags": ["file-upload", "secrets", "pii", "dlp"]
941
+ "tags": ["category:file-safety", "threat:secrets", "threat:pii"]
1003
942
  },
1004
943
  {
1005
- "id": "sentry-clipboard-default",
944
+ "id": "clipboard.defaults",
1006
945
  "name": "Clipboard Policy",
1007
- "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",
946
+ "description": "Block all-paste, paste-with-secrets, paste-with-PII, encoded payload pastes, and pastes with invisible characters.",
1008
947
  "category": "clipboard",
1009
948
  "file": "defaults/clipboard.cedar",
1010
- "severity": "high",
1011
- "tags": ["paste", "clipboard", "data-protection", "source-code", "secrets", "pii", "encoding", "invisible-chars"]
949
+ "severity": "critical",
950
+ "tags": ["category:clipboard", "threat:secrets", "threat:pii", "threat:encoded-payload", "threat:invisible-chars"]
1012
951
  },
1013
952
  {
1014
- "id": "sentry-organization-default",
1015
- "name": "Organization Rules",
1016
- "description": "Cross-cutting organization-wide policies: session-aware threat escalation",
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.",
1017
956
  "category": "organization",
1018
957
  "file": "defaults/organization.cedar",
1019
958
  "severity": "high",
1020
- "tags": ["session", "escalation", "organization"]
959
+ "tags": ["category:organization", "detection:aggregate", "posture:catch-all"]
1021
960
  }
1022
961
  ]
1023
962
  }