@highflame/policy 2.1.32 → 2.1.34

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.
@@ -1,8 +1,10 @@
1
1
  // =============================================================================
2
2
  // PII Detection Policy (Default)
3
3
  // =============================================================================
4
- // Detects and blocks personally identifiable information across messages,
5
- // pasted content, file uploads, and AI responses. Uses multi-layered detection:
4
+ // Detects and blocks personally identifiable information across messages
5
+ // and file uploads. Uses multi-layered detection:
6
+ //
7
+ // Paste-targeted PII rules live in clipboard.cedar.
6
8
  //
7
9
  // 1. PII boolean flag (pii_detected) — broadest catch from detection engine
8
10
  // 2. Granular PII type matching (pii_types) — type-specific blocking
@@ -30,16 +32,16 @@
30
32
  // Fires when the detection pipeline identifies PII in any content.
31
33
  // ---------------------------------------------------------------------------
32
34
 
33
- // Block messages containing detected PII
35
+ // Block messages and uploads containing detected PII
34
36
  @id("sentry-pii-block-messages")
35
- @name("Block messages with PII")
36
- @description("Block messages when the detection engine identifies any PII patterns. Prevents employees from accidentally sharing personal data with AI chat services.")
37
+ @name("Block messages and uploads with PII")
38
+ @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.")
37
39
  @severity("critical")
38
40
  @tags("pii,privacy,data-protection,gdpr-art-32,owasp-llm06")
39
- @reject_message("Your message was blocked because personally identifiable information was detected. Remove all PII (names, addresses, SSNs, credit cards, etc.) before sending to AI services.")
41
+ @reject_message("Content blocked: personally identifiable information was detected. Remove all PII (names, addresses, SSNs, credit cards, etc.) before sending to AI services.")
40
42
  forbid (
41
43
  principal,
42
- action == Sentry::Action::"send_message",
44
+ action in [Sentry::Action::"process_prompt", Sentry::Action::"upload_file"],
43
45
  resource
44
46
  )
45
47
  when {
@@ -54,13 +56,13 @@ when {
54
56
  // Block credit card numbers (PCI DSS compliance)
55
57
  @id("sentry-pii-block-credit-cards")
56
58
  @name("Block credit card numbers")
57
- @description("Block content containing credit card number patterns across all actions. PCI DSS 3.4 requires PANs are rendered unreadable — AI services must never receive raw card numbers.")
59
+ @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.")
58
60
  @severity("critical")
59
61
  @tags("pci,credit-card,payment,compliance,pci-dss-3.4")
60
62
  @reject_message("Content blocked: credit card number patterns detected. Sharing payment card data with AI services violates PCI DSS. Use tokenized references instead.")
61
63
  forbid (
62
64
  principal,
63
- action,
65
+ action in [Sentry::Action::"process_prompt", Sentry::Action::"upload_file"],
64
66
  resource
65
67
  )
66
68
  when {
@@ -71,13 +73,13 @@ when {
71
73
  // Block Social Security Numbers
72
74
  @id("sentry-pii-block-ssn")
73
75
  @name("Block Social Security Numbers")
74
- @description("Block content containing SSN patterns (XXX-XX-XXXX and variants). SSNs are high-value identity theft targets — exposure through AI services is a critical privacy violation.")
76
+ @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.")
75
77
  @severity("critical")
76
78
  @tags("ssn,identity,privacy,compliance,nist-si-4")
77
79
  @reject_message("Content blocked: Social Security Number patterns detected. SSNs must never be shared with AI services.")
78
80
  forbid (
79
81
  principal,
80
- action,
82
+ action in [Sentry::Action::"process_prompt", Sentry::Action::"upload_file"],
81
83
  resource
82
84
  )
83
85
  when {
@@ -88,13 +90,13 @@ when {
88
90
  // Block passport numbers
89
91
  @id("sentry-pii-block-passport")
90
92
  @name("Block passport numbers")
91
- @description("Block content containing passport number patterns. Passport numbers are government-issued identifiers with high identity theft risk.")
93
+ @description("Block messages and file uploads containing passport number patterns. Passport numbers are government-issued identifiers with high identity theft risk.")
92
94
  @severity("critical")
93
95
  @tags("passport,identity,privacy,gdpr")
94
96
  @reject_message("Content blocked: passport number patterns detected. Government-issued identifiers must not be shared with AI services.")
95
97
  forbid (
96
98
  principal,
97
- action,
99
+ action in [Sentry::Action::"process_prompt", Sentry::Action::"upload_file"],
98
100
  resource
99
101
  )
100
102
  when {
@@ -104,13 +106,13 @@ when {
104
106
  // Block IBAN (International Bank Account Numbers)
105
107
  @id("sentry-pii-block-iban")
106
108
  @name("Block bank account numbers")
107
- @description("Block content containing IBAN patterns. Bank account numbers are sensitive financial identifiers that must not be exposed to AI services.")
109
+ @description("Block messages and file uploads containing IBAN patterns. Bank account numbers are sensitive financial identifiers that must not be exposed to AI services.")
108
110
  @severity("critical")
109
111
  @tags("iban,financial,privacy,gdpr,pci-dss")
110
112
  @reject_message("Content blocked: bank account number (IBAN) patterns detected. Financial account numbers must not be shared with AI services.")
111
113
  forbid (
112
114
  principal,
113
- action,
115
+ action in [Sentry::Action::"process_prompt", Sentry::Action::"upload_file"],
114
116
  resource
115
117
  )
116
118
  when {
@@ -120,13 +122,13 @@ when {
120
122
  // Block bulk PII exposure
121
123
  @id("sentry-pii-block-bulk-exposure")
122
124
  @name("Block bulk PII exposure")
123
- @description("Block content 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.")
125
+ @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.")
124
126
  @severity("critical")
125
127
  @tags("pii,bulk,data-exfiltration,gdpr-art-32,ccpa")
126
128
  @reject_message("Content blocked: multiple PII items detected (3+). Bulk personal data must never be shared with AI services. Use data masking or tokenization.")
127
129
  forbid (
128
130
  principal,
129
- action,
131
+ action in [Sentry::Action::"process_prompt", Sentry::Action::"upload_file"],
130
132
  resource
131
133
  )
132
134
  when {
@@ -141,13 +143,13 @@ when {
141
143
  // Block high-confidence PII
142
144
  @id("sentry-pii-block-high-confidence")
143
145
  @name("Block high-confidence PII")
144
- @description("Block content when the PII confidence score exceeds threshold (80/100). Catches novel PII patterns including names, addresses, and identifiers that regex rules may miss.")
146
+ @description("Block messages and file uploads when the PII confidence score exceeds threshold (80/100). Catches novel PII patterns including names, addresses, and identifiers that regex rules may miss.")
145
147
  @severity("critical")
146
148
  @tags("pii,confidence,privacy,compliance,ml-classifier")
147
149
  @reject_message("Content blocked: the ML classifier detected personally identifiable information with high confidence. The content appears to contain personal data.")
148
150
  forbid (
149
151
  principal,
150
- action in [Sentry::Action::"send_message", Sentry::Action::"paste_content", Sentry::Action::"upload_file"],
152
+ action in [Sentry::Action::"process_prompt", Sentry::Action::"upload_file"],
151
153
  resource
152
154
  )
153
155
  when {
@@ -162,36 +164,16 @@ when {
162
164
  // Block PII threat category
163
165
  @id("sentry-pii-block-threat-category")
164
166
  @name("Block PII threat category")
165
- @description("Block content when threat categorization identifies PII. Defense-in-depth behind the pii_detected boolean — catches cases where PII is flagged at the aggregation layer.")
167
+ @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.")
166
168
  @severity("high")
167
169
  @tags("pii,privacy,data-protection,gdpr")
168
170
  @reject_message("Content blocked: threat scanners detected personally identifiable information. Remove all PII before submitting.")
169
171
  forbid (
170
172
  principal,
171
- action in [Sentry::Action::"send_message", Sentry::Action::"paste_content", Sentry::Action::"upload_file"],
173
+ action in [Sentry::Action::"process_prompt", Sentry::Action::"upload_file"],
172
174
  resource
173
175
  )
174
176
  when {
175
177
  context has threat_categories && context.threat_categories.contains("pii")
176
178
  };
177
179
 
178
- // ---------------------------------------------------------------------------
179
- // Section 5: AI Response PII Blocking
180
- // Prevent AI responses containing PII from reaching the user.
181
- // ---------------------------------------------------------------------------
182
-
183
- // Block AI responses containing PII
184
- @id("sentry-pii-block-responses")
185
- @name("Block AI responses with PII")
186
- @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).")
187
- @severity("high")
188
- @tags("pii,response-safety,data-protection,owasp-llm06")
189
- @reject_message("AI response blocked: personally identifiable information detected in the AI response. The AI service generated content containing personal data.")
190
- forbid (
191
- principal,
192
- action == Sentry::Action::"receive_response",
193
- resource
194
- )
195
- when {
196
- context has pii_detected && context.pii_detected
197
- };
@@ -1,42 +1,41 @@
1
1
  // =============================================================================
2
2
  // Secrets Detection Policy (Default)
3
3
  // =============================================================================
4
- // Block credential and secret leakage across messages and AI responses.
4
+ // Block credential and secret leakage across messages and file uploads.
5
5
  // Shield SecretsDetector identifies 18+ secret types via regex.
6
6
  //
7
- // Paste-targeted secret rules live in clipboard.cedar; this file covers
8
- // non-paste channels (messages, responses, and cross-cutting rules).
7
+ // Paste-targeted secret rules live in clipboard.cedar.
9
8
  //
10
9
  // Category: secrets
11
10
  // Namespace: Sentry
12
11
  // =============================================================================
13
12
 
14
- // Block messages containing secrets
13
+ // Block messages and uploads containing secrets
15
14
  @id("sentry-org-block-secrets-messages")
16
- @name("Block messages with secrets")
17
- @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.")
15
+ @name("Block messages and uploads with secrets")
16
+ @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.")
18
17
  @severity("critical")
19
18
  @tags("secrets,credentials,messages,nist-sc-28,nist-ia-5")
20
- @reject_message("Your message was blocked because it contains detected secrets such as API keys, tokens, or credentials. Remove all secrets before sending to AI services.")
19
+ @reject_message("Content blocked: detected secrets such as API keys, tokens, or credentials. Remove all secrets before sending to AI services.")
21
20
  forbid (
22
21
  principal,
23
- action == Sentry::Action::"send_message",
22
+ action in [Sentry::Action::"process_prompt", Sentry::Action::"upload_file"],
24
23
  resource
25
24
  )
26
25
  when {
27
26
  context has contains_secrets && context.contains_secrets
28
27
  };
29
28
 
30
- // Block high-risk secret types across all actions
29
+ // Block high-risk secret types across messages and file uploads
31
30
  @id("sentry-org-block-high-risk-secrets")
32
31
  @name("Block high-risk credential types")
33
- @description("Block content containing cloud provider keys (AWS, GCP, Azure), GitHub tokens, SSH private keys, or database connection strings across all actions. These credential types pose the highest exfiltration risk.")
32
+ @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.")
34
33
  @severity("critical")
35
34
  @tags("secrets,aws,github,ssh,cloud,nist-ia-5,mitre-t1552")
36
35
  @reject_message("Content blocked: high-risk credentials detected (cloud keys, GitHub tokens, SSH keys). Use a secrets manager — never share credentials with AI services.")
37
36
  forbid (
38
37
  principal,
39
- action,
38
+ action in [Sentry::Action::"process_prompt", Sentry::Action::"upload_file"],
40
39
  resource
41
40
  )
42
41
  when {
@@ -50,16 +49,16 @@ when {
50
49
  context.secret_types.contains("private_key"))
51
50
  };
52
51
 
53
- // Block API keys and tokens across all actions
52
+ // Block API keys and tokens across messages and file uploads
54
53
  @id("sentry-org-block-api-keys")
55
54
  @name("Block API keys and tokens")
56
- @description("Block content containing generic API keys, JWT tokens, and OAuth credentials. These are the most commonly leaked credential types when users interact with AI services.")
55
+ @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.")
57
56
  @severity("high")
58
57
  @tags("secrets,api-key,jwt,oauth,nist-ia-5")
59
58
  @reject_message("Content blocked: API keys, JWT tokens, or OAuth credentials detected. These must never be shared with AI services.")
60
59
  forbid (
61
60
  principal,
62
- action,
61
+ action in [Sentry::Action::"process_prompt", Sentry::Action::"upload_file"],
63
62
  resource
64
63
  )
65
64
  when {
@@ -71,23 +70,23 @@ when {
71
70
  context.secret_types.contains("stripe_key"))
72
71
  };
73
72
 
74
- // Block SSH key exposure across messages, paste, and file uploads
73
+ // Block SSH key exposure across messages and file uploads
75
74
  @id("sentry-secrets-block-ssh-keys")
76
75
  @name("Block SSH key exposure")
77
- @description("Block when SSH private key content or SSH key file paths are detected. Covers messages, paste, and file uploads. AI chat services must not receive SSH credentials.")
76
+ @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.")
78
77
  @severity("critical")
79
78
  @tags("secrets,ssh,credentials,nist-ia-5,mitre-t1552")
80
79
  @reject_message("Blocked: SSH private key content or key file path detected. AI chat services must not receive SSH credentials.")
81
80
  forbid (
82
81
  principal,
83
- action in [Sentry::Action::"send_message", Sentry::Action::"paste_content", Sentry::Action::"upload_file"],
82
+ action in [Sentry::Action::"process_prompt", Sentry::Action::"upload_file"],
84
83
  resource
85
84
  )
86
85
  when {
87
86
  context has secret_types && context.secret_types.contains("ssh_key")
88
87
  };
89
88
 
90
- // Block PEM/certificate key exposure across messages, paste, and file uploads
89
+ // Block PEM/certificate key exposure across messages and file uploads
91
90
  @id("sentry-secrets-block-pem-keys")
92
91
  @name("Block PEM/certificate key exposure")
93
92
  @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.")
@@ -96,7 +95,7 @@ when {
96
95
  @reject_message("Blocked: PEM private key or certificate key file detected. AI chat services must not receive certificate credentials.")
97
96
  forbid (
98
97
  principal,
99
- action in [Sentry::Action::"send_message", Sentry::Action::"paste_content", Sentry::Action::"upload_file"],
98
+ action in [Sentry::Action::"process_prompt", Sentry::Action::"upload_file"],
100
99
  resource
101
100
  )
102
101
  when {
@@ -106,13 +105,13 @@ when {
106
105
  // Block bulk secret exposure
107
106
  @id("sentry-org-block-bulk-secrets")
108
107
  @name("Block bulk secret exposure")
109
- @description("Block content when 3+ distinct secrets are found. Multiple secrets indicate a configuration dump, .env file paste, or credential harvesting being sent to AI services.")
108
+ @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.")
110
109
  @severity("critical")
111
110
  @tags("secrets,bulk,data-exfiltration,nist-sc-28")
112
111
  @reject_message("Content blocked: multiple credentials detected (3+). Configuration dumps and credential lists must never be shared with AI services.")
113
112
  forbid (
114
113
  principal,
115
- action,
114
+ action in [Sentry::Action::"process_prompt", Sentry::Action::"upload_file"],
116
115
  resource
117
116
  )
118
117
  when {
@@ -122,13 +121,13 @@ when {
122
121
  // Block detected credential patterns
123
122
  @id("sentry-org-block-detected-credentials")
124
123
  @name("Block detected credential patterns")
125
- @description("Block content flagged by detection engine rules for credential exposure, API key leaks, and token exposure. Defense-in-depth behind contains_secrets.")
124
+ @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.")
126
125
  @severity("critical")
127
126
  @tags("secrets,credentials,detection-rules,nist-ia-5")
128
127
  @reject_message("Content blocked: detection engines identified credential patterns including secret exposure, API keys, or token leaks.")
129
128
  forbid (
130
129
  principal,
131
- action,
130
+ action in [Sentry::Action::"process_prompt", Sentry::Action::"upload_file"],
132
131
  resource
133
132
  )
134
133
  when {
@@ -137,19 +136,3 @@ when {
137
136
  context.detected_threats.contains("credential_leak") ||
138
137
  context.detected_threats.contains("api_key_exposure"))
139
138
  };
140
-
141
- // Block AI responses when session has leaked secrets
142
- @id("sentry-org-session-secrets-response")
143
- @name("Block responses after secret detection")
144
- @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.")
145
- @severity("high")
146
- @tags("session,secrets,response-safety,defense-in-depth")
147
- @reject_message("AI response blocked: secrets were detected in an earlier message in this session. Responses may contain or reference the exposed credentials.")
148
- forbid (
149
- principal,
150
- action == Sentry::Action::"receive_response",
151
- resource
152
- )
153
- when {
154
- context has session_secrets_detected && context.session_secrets_detected
155
- };
@@ -2,7 +2,8 @@
2
2
  // Semantic Threat Detection Policy (Default)
3
3
  // =============================================================================
4
4
  // Detects and blocks prompt injection, jailbreak attempts, and high-severity
5
- // threats across all browser AI interactions: messages, paste, file uploads.
5
+ // threats across browser AI interactions: messages and file uploads.
6
+ // Paste-targeted semantic rules live in clipboard.cedar.
6
7
  //
7
8
  // Uses multi-layered detection from Shield:
8
9
  // 1. ML classifier scores (injection_score, jailbreak_score)
@@ -22,20 +23,20 @@
22
23
 
23
24
  // ---------------------------------------------------------------------------
24
25
  // Section 1: Prompt Injection Detection
25
- // Blocks injection attempts in messages, pasted content, and uploaded files.
26
- // Users may inadvertently paste injection payloads from compromised sources.
26
+ // Blocks injection attempts in messages and uploaded files.
27
+ // Paste-targeted injection rules live in clipboard.cedar.
27
28
  // ---------------------------------------------------------------------------
28
29
 
29
- // Block messages and pastes with prompt injection patterns
30
+ // Block messages with prompt injection patterns
30
31
  @id("sentry-semantic-block-injection")
31
32
  @name("Block prompt injection")
32
- @description("Block messages and pasted content when detection engine rules identify prompt injection patterns. Catches instruction override, role assumption, and manipulation techniques in user input and pasted content (OWASP LLM01).")
33
+ @description("Block messages when detection engine rules identify prompt injection patterns. Catches instruction override, role assumption, and manipulation techniques in user input (OWASP LLM01).")
33
34
  @severity("critical")
34
35
  @tags("injection,security,owasp-llm01,mitre-aml-t0051,baseline")
35
- @reject_message("Content was blocked because prompt injection patterns were detected. This prevents manipulation of AI agent behavior. Remove adversarial instructions and try again.")
36
+ @reject_message("Content blocked: prompt injection patterns were detected. This prevents manipulation of AI agent behavior. Remove adversarial instructions and try again.")
36
37
  forbid (
37
38
  principal,
38
- action in [Sentry::Action::"send_message", Sentry::Action::"paste_content"],
39
+ action == Sentry::Action::"process_prompt",
39
40
  resource
40
41
  )
41
42
  when {
@@ -48,32 +49,16 @@ when {
48
49
  @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.")
49
50
  @severity("critical")
50
51
  @tags("injection,ml-classifier,security,owasp-llm01")
51
- @reject_message("Your content was blocked because the ML classifier detected prompt injection with high confidence.")
52
+ @reject_message("Content blocked: the ML classifier detected prompt injection with high confidence.")
52
53
  forbid (
53
54
  principal,
54
- action in [Sentry::Action::"send_message", Sentry::Action::"paste_content", Sentry::Action::"upload_file"],
55
+ action in [Sentry::Action::"process_prompt", Sentry::Action::"upload_file"],
55
56
  resource
56
57
  )
57
58
  when {
58
59
  context has injection_score && context.injection_score >= 75
59
60
  };
60
61
 
61
- // Block injection payloads hidden in uploaded documents
62
- @id("sentry-semantic-block-file-injection")
63
- @name("Block injection in uploaded files")
64
- @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.")
65
- @severity("critical")
66
- @tags("injection,file-upload,security,owasp-llm01")
67
- @reject_message("File upload was blocked because prompt injection patterns were detected in the document. Files containing adversarial instructions cannot be shared with AI services.")
68
- forbid (
69
- principal,
70
- action == Sentry::Action::"upload_file",
71
- resource
72
- )
73
- when {
74
- context has detected_threats && context.detected_threats.contains("prompt_injection")
75
- };
76
-
77
62
  // ---------------------------------------------------------------------------
78
63
  // Section 2: Jailbreak Detection
79
64
  // Blocks jailbreak attempts in messages sent to AI services.
@@ -85,10 +70,10 @@ when {
85
70
  @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).")
86
71
  @severity("critical")
87
72
  @tags("jailbreak,bypass,security,owasp-llm02,mitre-aml-t0054,baseline")
88
- @reject_message("Your message was blocked because jailbreak patterns were detected. This prevents circumvention of AI safety controls.")
73
+ @reject_message("Content blocked: jailbreak patterns were detected. This prevents circumvention of AI safety controls.")
89
74
  forbid (
90
75
  principal,
91
- action == Sentry::Action::"send_message",
76
+ action == Sentry::Action::"process_prompt",
92
77
  resource
93
78
  )
94
79
  when {
@@ -101,10 +86,10 @@ when {
101
86
  @description("Block content when the ML jailbreak classifier exceeds threshold (75/100). Catches sophisticated jailbreak techniques including multi-turn manipulation and encoded payloads.")
102
87
  @severity("critical")
103
88
  @tags("jailbreak,ml-classifier,security,owasp-llm02")
104
- @reject_message("Your content was blocked because the ML classifier detected a jailbreak attempt with high confidence.")
89
+ @reject_message("Content blocked: the ML classifier detected a jailbreak attempt with high confidence.")
105
90
  forbid (
106
91
  principal,
107
- action in [Sentry::Action::"send_message", Sentry::Action::"paste_content"],
92
+ action == Sentry::Action::"process_prompt",
108
93
  resource
109
94
  )
110
95
  when {
@@ -119,49 +104,16 @@ when {
119
104
  // Block any content with critical severity threats
120
105
  @id("sentry-semantic-block-critical")
121
106
  @name("Block critical threats")
122
- @description("Block all content when any detection engine reports critical severity. This is the ultimate catch-all for critical-severity threats regardless of type or source.")
107
+ @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.")
123
108
  @severity("critical")
124
109
  @tags("critical,baseline,security,catch-all")
125
- @reject_message("Your content was blocked because security scanners detected a critical-severity threat. This content cannot be processed by AI services.")
110
+ @reject_message("Content blocked: security scanners detected a critical-severity threat. This content cannot be processed by AI services.")
126
111
  forbid (
127
112
  principal,
128
- action,
113
+ action in [Sentry::Action::"process_prompt", Sentry::Action::"upload_file"],
129
114
  resource
130
115
  )
131
116
  when {
132
117
  context has highest_severity && context.highest_severity == "critical"
133
118
  };
134
119
 
135
- // Block messages with high severity semantic threats
136
- @id("sentry-semantic-block-high-severity")
137
- @name("Block high severity threats")
138
- @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.")
139
- @severity("high")
140
- @tags("semantic,severity,security,defense-in-depth")
141
- @reject_message("Your message was blocked because security scanners detected high severity issues. Review your content for manipulative or adversarial patterns.")
142
- forbid (
143
- principal,
144
- action == Sentry::Action::"send_message",
145
- resource
146
- )
147
- when {
148
- context has threat_categories && context has max_threat_severity &&
149
- context.threat_categories.contains("injection") &&
150
- context.max_threat_severity >= 3
151
- };
152
-
153
- // Block content with multiple concurrent threats
154
- @id("sentry-semantic-block-multi-threat")
155
- @name("Block multi-threat content")
156
- @description("Block content when multiple distinct threats are detected simultaneously (3+). Multiple concurrent threats strongly indicate an adversarial attack chain or compromised content.")
157
- @severity("high")
158
- @tags("multi-threat,security,defense-in-depth")
159
- @reject_message("Content was blocked because multiple security threats were detected simultaneously. This pattern indicates potentially adversarial content.")
160
- forbid (
161
- principal,
162
- action in [Sentry::Action::"send_message", Sentry::Action::"paste_content", Sentry::Action::"upload_file"],
163
- resource
164
- )
165
- when {
166
- context has threat_count && context.threat_count >= 3
167
- };
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "service": "sentry",
3
- "version": "1.0.0",
3
+ "version": "1.1.0",
4
4
  "description": "Sentry policy templates for browser AI security",
5
5
  "categories": [
6
6
  {
@@ -21,22 +21,22 @@
21
21
  {
22
22
  "id": "content_safety",
23
23
  "name": "Content Safety",
24
- "description": "Detect and block violent, harmful, hateful, sexual, and profane content in AI interactions, including cut-and-paste safety rules"
24
+ "description": "Detect and block violent, harmful, hateful, sexual, and profane content in AI interactions across messages, paste, and file uploads"
25
25
  },
26
26
  {
27
27
  "id": "file_safety",
28
28
  "name": "File & Attachment Safety",
29
- "description": "Enforce document sensitivity controls (MIP labels), block sensitive file uploads, detect secrets and PII in uploaded documents"
29
+ "description": "Block file uploads containing secrets or PII in document content"
30
30
  },
31
31
  {
32
32
  "id": "clipboard",
33
33
  "name": "Clipboard Policy",
34
- "description": "Control paste operations into AI chat services — block paste outright, block when secrets or source code are detected"
34
+ "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"
35
35
  },
36
36
  {
37
37
  "id": "organization",
38
38
  "name": "Organization Rules",
39
- "description": "Cross-cutting organization-wide rules: source code protection in messages and session-aware threat escalation"
39
+ "description": "Cross-cutting organization-wide rules: session-aware threat escalation"
40
40
  }
41
41
  ],
42
42
  "defaults": [
@@ -64,11 +64,11 @@
64
64
  {
65
65
  "id": "sentry-content-safety-default",
66
66
  "name": "Content Safety",
67
- "description": "Detect and block violent, harmful, hateful, sexual, and profane content including cut-and-paste safety enforcement",
67
+ "description": "Detect and block violent, harmful, hateful, sexual, and profane content across messages, paste, and file uploads",
68
68
  "category": "content_safety",
69
69
  "file": "defaults/content_safety.cedar",
70
70
  "severity": "critical",
71
- "tags": ["violence", "hate-speech", "sexual", "profanity", "content-safety", "paste-safety", "baseline"]
71
+ "tags": ["violence", "hate-speech", "sexual", "profanity", "content-safety", "baseline"]
72
72
  },
73
73
  {
74
74
  "id": "sentry-secrets-default",
@@ -91,29 +91,29 @@
91
91
  {
92
92
  "id": "sentry-file-safety-default",
93
93
  "name": "File & Attachment Safety",
94
- "description": "Enforce MIP sensitivity labels, block confidential document uploads, detect secrets and PII in files, and restrict file types",
94
+ "description": "Block file uploads containing secrets or PII in document content",
95
95
  "category": "file_safety",
96
96
  "file": "defaults/file_safety.cedar",
97
97
  "severity": "critical",
98
- "tags": ["mip", "document-sensitivity", "file-upload", "dlp", "compliance"]
98
+ "tags": ["file-upload", "secrets", "pii", "dlp"]
99
99
  },
100
100
  {
101
101
  "id": "sentry-clipboard-default",
102
102
  "name": "Clipboard Policy",
103
- "description": "Control paste into AI chat services: blanket paste blocking, secrets-in-paste blocking, and source-code-in-paste blocking",
103
+ "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",
104
104
  "category": "clipboard",
105
105
  "file": "defaults/clipboard.cedar",
106
106
  "severity": "high",
107
- "tags": ["paste", "clipboard", "data-protection", "source-code", "secrets"]
107
+ "tags": ["paste", "clipboard", "data-protection", "source-code", "secrets", "pii", "encoding", "invisible-chars"]
108
108
  },
109
109
  {
110
110
  "id": "sentry-organization-default",
111
111
  "name": "Organization Rules",
112
- "description": "Cross-cutting organization-wide policies: source code protection in messages and session-aware threat escalation",
112
+ "description": "Cross-cutting organization-wide policies: session-aware threat escalation",
113
113
  "category": "organization",
114
114
  "file": "defaults/organization.cedar",
115
115
  "severity": "high",
116
- "tags": ["source-code", "session", "escalation", "organization"]
116
+ "tags": ["session", "escalation", "organization"]
117
117
  }
118
118
  ]
119
119
  }