@highflame/policy 2.2.31 → 2.2.32

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 (58) hide show
  1. package/_schemas/agent_ops/context.json +1272 -439
  2. package/_schemas/agent_ops/schema.cedarschema +24 -0
  3. package/_schemas/agent_ops/templates/ported/agent-security/agent_identity_a2a_cross_origin.cedar +92 -0
  4. package/_schemas/agent_ops/templates/ported/agent-security/agent_identity_a2a_escalation.cedar +99 -0
  5. package/_schemas/agent_ops/templates/ported/agent-security/agent_identity_a2a_identity_enforcement.cedar +101 -0
  6. package/_schemas/agent_ops/templates/ported/agent-security/agent_identity_a2a_inter_agent_injection.cedar +120 -0
  7. package/_schemas/agent_ops/templates/ported/agent-security/agent_identity_claude_block_injection.cedar +30 -0
  8. package/_schemas/agent_ops/templates/ported/agent-security/agent_identity_defaults.cedar +122 -0
  9. package/_schemas/agent_ops/templates/ported/agent-security/agent_identity_multi_agent_safety.cedar +164 -0
  10. package/_schemas/agent_ops/templates/ported/agent-security/agent_identity_multi_agent_trust.cedar +143 -0
  11. package/_schemas/agent_ops/templates/ported/agent-security/agent_security_data_pipeline.cedar +45 -0
  12. package/_schemas/agent_ops/templates/ported/agent-security/agent_security_defaults.cedar +164 -0
  13. package/_schemas/agent_ops/templates/ported/agent-security/agent_security_malicious_package.cedar +59 -0
  14. package/_schemas/agent_ops/templates/ported/agent-security/agent_security_param_validation.cedar +119 -0
  15. package/_schemas/agent_ops/templates/ported/agent-security/agent_security_tool_risk.cedar +66 -0
  16. package/_schemas/agent_ops/templates/ported/code-security/agent_identity_a2a_supply_chain.cedar +101 -0
  17. package/_schemas/agent_ops/templates/ported/code-security/agent_security_code_agent.cedar +130 -0
  18. package/_schemas/agent_ops/templates/ported/code-security/agent_security_code_agent_supply_chain.cedar +116 -0
  19. package/_schemas/agent_ops/templates/ported/code-security/security_code_agent_encoding.cedar +51 -0
  20. package/_schemas/agent_ops/templates/ported/code-security/security_code_agent_path_security.cedar +149 -0
  21. package/_schemas/agent_ops/templates/ported/content-safety/trust_safety_chat_assistant.cedar +58 -0
  22. package/_schemas/agent_ops/templates/ported/content-safety/trust_safety_defaults.cedar +111 -0
  23. package/_schemas/agent_ops/templates/ported/content-safety/trust_safety_semantic.cedar +78 -0
  24. package/_schemas/agent_ops/templates/ported/content-safety/trust_safety_toxicity.cedar +71 -0
  25. package/_schemas/agent_ops/templates/ported/data-protection/data_protection_advanced_secrets.cedar +74 -0
  26. package/_schemas/agent_ops/templates/ported/data-protection/data_protection_code_block_write_secrets.cedar +26 -0
  27. package/_schemas/agent_ops/templates/ported/data-protection/data_protection_data_pipeline.cedar +52 -0
  28. package/_schemas/agent_ops/templates/ported/data-protection/data_protection_defaults.cedar +57 -0
  29. package/_schemas/agent_ops/templates/ported/data-protection/privacy_advanced_pii.cedar +465 -0
  30. package/_schemas/agent_ops/templates/ported/data-protection/privacy_defaults.cedar +164 -0
  31. package/_schemas/agent_ops/templates/ported/data-protection/privacy_pii_model.cedar +90 -0
  32. package/_schemas/agent_ops/templates/ported/organization/organization_deny_baseline.cedar +22 -0
  33. package/_schemas/agent_ops/templates/ported/organization/organization_team_permissions.cedar +38 -0
  34. package/_schemas/agent_ops/templates/ported/threat-detection/security_advanced_block_critical_severity.cedar +30 -0
  35. package/_schemas/agent_ops/templates/ported/threat-detection/security_chat_assistant.cedar +47 -0
  36. package/_schemas/agent_ops/templates/ported/threat-detection/security_data_pipeline_block_injection.cedar +31 -0
  37. package/_schemas/agent_ops/templates/ported/threat-detection/security_injection.cedar +82 -0
  38. package/_schemas/agent_ops/templates/ported/threat-detection/security_patterns.cedar +72 -0
  39. package/_schemas/agent_ops/templates/ported/threat-detection/semantic_defaults.cedar +155 -0
  40. package/_schemas/agent_ops/templates/ported/tool-permissioning/tools_bash_operation_classes.cedar +142 -0
  41. package/_schemas/agent_ops/templates/ported/tool-permissioning/tools_block_shell.cedar +40 -0
  42. package/_schemas/agent_ops/templates/ported/tool-permissioning/tools_defaults.cedar +76 -0
  43. package/_schemas/agent_ops/templates/ported/tool-permissioning/tools_mcp_server_allowlist.cedar +41 -0
  44. package/_schemas/agent_ops/templates/ported/tool-permissioning/tools_mcp_tool_permissions.cedar +103 -0
  45. package/_schemas/agent_ops/templates/templates.json +752 -8
  46. package/_schemas/ai_gateway/context.json +2 -2
  47. package/_schemas/guardrails/context.json +2 -2
  48. package/_schemas/guardrails/templates/templates.json +6 -1
  49. package/_schemas/overwatch/context.json +3 -3
  50. package/dist/aarm-annotations.gen.js +1 -1
  51. package/dist/agent_ops-context.gen.d.ts +5 -1
  52. package/dist/agent_ops-context.gen.js +8 -0
  53. package/dist/agent_ops-defaults.gen.js +5168 -8
  54. package/dist/guardrails-defaults.gen.js +6 -1
  55. package/dist/overwatch-defaults.gen.js +109 -0
  56. package/dist/service-schemas.gen.d.ts +1 -1
  57. package/dist/service-schemas.gen.js +48 -12
  58. package/package.json +1 -1
@@ -0,0 +1,57 @@
1
+ // =============================================================================
2
+ // Secrets Detection (Default)
3
+ // =============================================================================
4
+ // Blocks content containing API keys, tokens, credentials, or other secrets
5
+ // across LLM prompts, tool calls, and file operations.
6
+ //
7
+ // Context keys consumed:
8
+ // - secrets_detected: Bool
9
+ // - secret_count: Long
10
+ // - secret_types: Set<String>
11
+ //
12
+ // Compliance:
13
+ // - OWASP LLM06
14
+ //
15
+ // Category: data-protection
16
+ // Namespace: AgentOps
17
+ // =============================================================================
18
+
19
+ @id("data-protection.block-secrets")
20
+ @name("Block secrets")
21
+ @description("Blocks process_prompt, call_tool, read_file, and write_file when secrets_detected is true.")
22
+ @severity("critical")
23
+ @tags("category:data-protection,threat:secrets,detection:rule,owasp:llm06")
24
+ @reject_message("Request blocked: secrets or credentials were detected in the content.")
25
+ forbid (
26
+ principal,
27
+ action in [
28
+ AgentOps::Action::"process_prompt",
29
+ AgentOps::Action::"call_tool",
30
+ AgentOps::Action::"read_file",
31
+ AgentOps::Action::"write_file"
32
+ ],
33
+ resource
34
+ )
35
+ when {
36
+ context has secrets_detected && context.secrets_detected == true
37
+ };
38
+
39
+ @id("data-protection.block-secrets-bulk")
40
+ @name("Block secrets (bulk)")
41
+ @description("Blocks process_prompt, call_tool, read_file, and write_file when secret_count >= 3.")
42
+ @severity("critical")
43
+ @tags("category:data-protection,threat:secrets,threat:exfiltration,detection:aggregate,owasp:llm06")
44
+ @reject_message("Request blocked: multiple distinct secrets were detected — possible credential dump.")
45
+ forbid (
46
+ principal,
47
+ action in [
48
+ AgentOps::Action::"process_prompt",
49
+ AgentOps::Action::"call_tool",
50
+ AgentOps::Action::"read_file",
51
+ AgentOps::Action::"write_file"
52
+ ],
53
+ resource
54
+ )
55
+ when {
56
+ context has secret_count && context.secret_count >= 3
57
+ };
@@ -0,0 +1,465 @@
1
+ // =============================================================================
2
+ // Comprehensive PII (Tier 3)
3
+ // =============================================================================
4
+ // Blocks every PII entity type — structural and contextual, sensitive and situational — one forbid rule per group so any individual type can be toggled off. High false-positive surface; opt-in.
5
+ //
6
+ // Sensitivity tiers and the structural (regex) / contextual (model) type
7
+ // vocabulary are defined canonically in schemas/_shared/pii_taxonomy.json and
8
+ // enforced by tools/lint-templates.
9
+ //
10
+ // Context keys consumed:
11
+ // - pii_types: Set<String> (union of structural lowercase + contextual uppercase types)
12
+ //
13
+ // Category: privacy
14
+ // Namespace: AgentOps
15
+ // =============================================================================
16
+
17
+ @id("privacy.block-pii-national-id-all")
18
+ @name("Block national ID numbers (comprehensive)")
19
+ @description("Blocks prompts, tool calls, and file reads/writes that contain a national ID (SSN, passport, or driver's license).")
20
+ @severity("high")
21
+ @tags("category:privacy,threat:pii,detection:pattern,owasp:llm06")
22
+ @reject_message("Content blocked: national identifier (SSN, passport, or driver's license) patterns detected.")
23
+ forbid (
24
+ principal,
25
+ action in [AgentOps::Action::"process_prompt", AgentOps::Action::"call_tool", AgentOps::Action::"read_file", AgentOps::Action::"write_file"],
26
+ resource
27
+ )
28
+ when {
29
+ context has pii_types &&
30
+ (
31
+ context.pii_types.contains("ssn") ||
32
+ context.pii_types.contains("passport") ||
33
+ context.pii_types.contains("national_id") ||
34
+ context.pii_types.contains("drivers_license") ||
35
+ context.pii_types.contains("NATIONAL_ID")
36
+ )
37
+ };
38
+
39
+ @id("privacy.block-pii-credit-card-all")
40
+ @name("Block credit card numbers (comprehensive)")
41
+ @description("Blocks prompts, tool calls, and file reads/writes that contain a credit card number.")
42
+ @severity("critical")
43
+ @tags("category:privacy,threat:pii,detection:pattern,compliance:pci-dss,owasp:llm06")
44
+ @reject_message("Content blocked: credit card number patterns detected.")
45
+ forbid (
46
+ principal,
47
+ action in [AgentOps::Action::"process_prompt", AgentOps::Action::"call_tool", AgentOps::Action::"read_file", AgentOps::Action::"write_file"],
48
+ resource
49
+ )
50
+ when {
51
+ context has pii_types &&
52
+ (
53
+ context.pii_types.contains("credit_card") ||
54
+ context.pii_types.contains("CREDIT_CARD")
55
+ )
56
+ };
57
+
58
+ @id("privacy.block-pii-bank-account-all")
59
+ @name("Block bank account numbers (comprehensive)")
60
+ @description("Blocks prompts, tool calls, and file reads/writes that contain a bank account number (IBAN, SWIFT/BIC, or routing number).")
61
+ @severity("critical")
62
+ @tags("category:privacy,threat:pii,detection:pattern,owasp:llm06")
63
+ @reject_message("Content blocked: bank account (IBAN) number patterns detected.")
64
+ forbid (
65
+ principal,
66
+ action in [AgentOps::Action::"process_prompt", AgentOps::Action::"call_tool", AgentOps::Action::"read_file", AgentOps::Action::"write_file"],
67
+ resource
68
+ )
69
+ when {
70
+ context has pii_types &&
71
+ (
72
+ context.pii_types.contains("iban") ||
73
+ context.pii_types.contains("bank_account") ||
74
+ context.pii_types.contains("swift_bic") ||
75
+ context.pii_types.contains("aba_routing") ||
76
+ context.pii_types.contains("ACCOUNT_NUMBER")
77
+ )
78
+ };
79
+
80
+ @id("privacy.block-pii-medical-all")
81
+ @name("Block medical identifiers (comprehensive)")
82
+ @description("Blocks prompts, tool calls, and file reads/writes that contain medical data (record number, MBI, NPI, or blood type).")
83
+ @severity("medium")
84
+ @tags("category:privacy,threat:pii,detection:pattern,compliance:hipaa,owasp:llm06")
85
+ @reject_message("Content blocked: medical record identifier patterns detected.")
86
+ forbid (
87
+ principal,
88
+ action in [AgentOps::Action::"process_prompt", AgentOps::Action::"call_tool", AgentOps::Action::"read_file", AgentOps::Action::"write_file"],
89
+ resource
90
+ )
91
+ when {
92
+ context has pii_types &&
93
+ (
94
+ context.pii_types.contains("medical_record") ||
95
+ context.pii_types.contains("patient_record") ||
96
+ context.pii_types.contains("medicare_beneficiary_id") ||
97
+ context.pii_types.contains("npi") ||
98
+ context.pii_types.contains("medical_term") ||
99
+ context.pii_types.contains("blood_type") ||
100
+ context.pii_types.contains("MEDICAL")
101
+ )
102
+ };
103
+
104
+ @id("privacy.block-pii-tax-id-all")
105
+ @name("Block tax identifiers (comprehensive)")
106
+ @description("Blocks prompts, tool calls, and file reads/writes that contain a tax ID (ITIN, EIN, or PTIN).")
107
+ @severity("high")
108
+ @tags("category:privacy,threat:pii,detection:pattern,owasp:llm06")
109
+ @reject_message("Content blocked: tax identifier (ITIN or EIN) patterns detected.")
110
+ forbid (
111
+ principal,
112
+ action in [AgentOps::Action::"process_prompt", AgentOps::Action::"call_tool", AgentOps::Action::"read_file", AgentOps::Action::"write_file"],
113
+ resource
114
+ )
115
+ when {
116
+ context has pii_types &&
117
+ (
118
+ context.pii_types.contains("itin") ||
119
+ context.pii_types.contains("ein") ||
120
+ context.pii_types.contains("ptin")
121
+ )
122
+ };
123
+
124
+ @id("privacy.block-pii-credential-all")
125
+ @name("Block credentials (comprehensive)")
126
+ @description("Blocks prompts, tool calls, and file reads/writes that contain a credential or secret (API key, token, password hash, or private key).")
127
+ @severity("critical")
128
+ @tags("category:privacy,threat:pii,detection:pattern,owasp:llm06")
129
+ @reject_message("Content blocked: credential or API key patterns detected.")
130
+ forbid (
131
+ principal,
132
+ action in [AgentOps::Action::"process_prompt", AgentOps::Action::"call_tool", AgentOps::Action::"read_file", AgentOps::Action::"write_file"],
133
+ resource
134
+ )
135
+ when {
136
+ context has pii_types &&
137
+ (
138
+ context.pii_types.contains("aws_access_key") ||
139
+ context.pii_types.contains("api_key") ||
140
+ context.pii_types.contains("jwt_token") ||
141
+ context.pii_types.contains("encryption_key") ||
142
+ context.pii_types.contains("http_basic_auth") ||
143
+ context.pii_types.contains("gcp_credential") ||
144
+ context.pii_types.contains("gcp_api_key") ||
145
+ context.pii_types.contains("gcp_signed_policy") ||
146
+ context.pii_types.contains("session_cookie") ||
147
+ context.pii_types.contains("oauth_token") ||
148
+ context.pii_types.contains("tls_certificate") ||
149
+ context.pii_types.contains("password_hash") ||
150
+ context.pii_types.contains("csrf_token") ||
151
+ context.pii_types.contains("CREDENTIAL")
152
+ )
153
+ };
154
+
155
+ @id("privacy.block-pii-crypto-all")
156
+ @name("Block cryptocurrency addresses (comprehensive)")
157
+ @description("Blocks prompts, tool calls, and file reads/writes that contain a cryptocurrency wallet address.")
158
+ @severity("high")
159
+ @tags("category:privacy,threat:pii,detection:pattern,owasp:llm06")
160
+ @reject_message("Content blocked: cryptocurrency wallet address patterns detected.")
161
+ forbid (
162
+ principal,
163
+ action in [AgentOps::Action::"process_prompt", AgentOps::Action::"call_tool", AgentOps::Action::"read_file", AgentOps::Action::"write_file"],
164
+ resource
165
+ )
166
+ when {
167
+ context has pii_types &&
168
+ (
169
+ context.pii_types.contains("bitcoin_address") ||
170
+ context.pii_types.contains("ethereum_address")
171
+ )
172
+ };
173
+
174
+ @id("privacy.block-pii-names-all")
175
+ @name("Block personal names (comprehensive)")
176
+ @description("Blocks prompts, tool calls, and file reads/writes that contain a personal name.")
177
+ @severity("low")
178
+ @tags("category:privacy,threat:pii,detection:pattern,owasp:llm06")
179
+ @reject_message("Content blocked: personal name patterns detected.")
180
+ forbid (
181
+ principal,
182
+ action in [AgentOps::Action::"process_prompt", AgentOps::Action::"call_tool", AgentOps::Action::"read_file", AgentOps::Action::"write_file"],
183
+ resource
184
+ )
185
+ when {
186
+ context has pii_types &&
187
+ (
188
+ context.pii_types.contains("person_name") ||
189
+ context.pii_types.contains("PERSON")
190
+ )
191
+ };
192
+
193
+ @id("privacy.block-pii-email-all")
194
+ @name("Block email addresses (comprehensive)")
195
+ @description("Blocks prompts, tool calls, and file reads/writes that contain an email address.")
196
+ @severity("medium")
197
+ @tags("category:privacy,threat:pii,detection:pattern,owasp:llm06")
198
+ @reject_message("Content blocked: email address patterns detected.")
199
+ forbid (
200
+ principal,
201
+ action in [AgentOps::Action::"process_prompt", AgentOps::Action::"call_tool", AgentOps::Action::"read_file", AgentOps::Action::"write_file"],
202
+ resource
203
+ )
204
+ when {
205
+ context has pii_types &&
206
+ (
207
+ context.pii_types.contains("email") ||
208
+ context.pii_types.contains("EMAIL_ADDRESS")
209
+ )
210
+ };
211
+
212
+ @id("privacy.block-pii-phone-all")
213
+ @name("Block phone numbers (comprehensive)")
214
+ @description("Blocks prompts, tool calls, and file reads/writes that contain a phone number.")
215
+ @severity("medium")
216
+ @tags("category:privacy,threat:pii,detection:pattern,owasp:llm06")
217
+ @reject_message("Content blocked: phone number patterns detected.")
218
+ forbid (
219
+ principal,
220
+ action in [AgentOps::Action::"process_prompt", AgentOps::Action::"call_tool", AgentOps::Action::"read_file", AgentOps::Action::"write_file"],
221
+ resource
222
+ )
223
+ when {
224
+ context has pii_types &&
225
+ (
226
+ context.pii_types.contains("phone") ||
227
+ context.pii_types.contains("PHONE_NUMBER")
228
+ )
229
+ };
230
+
231
+ @id("privacy.block-pii-datetime-all")
232
+ @name("Block dates and times (comprehensive)")
233
+ @description("Blocks prompts, tool calls, and file reads/writes that contain a date or time (date of birth, timestamp, or card expiry).")
234
+ @severity("medium")
235
+ @tags("category:privacy,threat:pii,detection:pattern,owasp:llm06")
236
+ @reject_message("Content blocked: date or time patterns detected.")
237
+ forbid (
238
+ principal,
239
+ action in [AgentOps::Action::"process_prompt", AgentOps::Action::"call_tool", AgentOps::Action::"read_file", AgentOps::Action::"write_file"],
240
+ resource
241
+ )
242
+ when {
243
+ context has pii_types &&
244
+ (
245
+ context.pii_types.contains("date_of_birth") ||
246
+ context.pii_types.contains("date_time") ||
247
+ context.pii_types.contains("time") ||
248
+ context.pii_types.contains("card_expiry") ||
249
+ context.pii_types.contains("DATE_TIME")
250
+ )
251
+ };
252
+
253
+ @id("privacy.block-pii-url-all")
254
+ @name("Block URLs (comprehensive)")
255
+ @description("Blocks prompts, tool calls, and file reads/writes that contain a URL.")
256
+ @severity("low")
257
+ @tags("category:privacy,threat:pii,detection:pattern,owasp:llm06")
258
+ @reject_message("Content blocked: URL patterns detected.")
259
+ forbid (
260
+ principal,
261
+ action in [AgentOps::Action::"process_prompt", AgentOps::Action::"call_tool", AgentOps::Action::"read_file", AgentOps::Action::"write_file"],
262
+ resource
263
+ )
264
+ when {
265
+ context has pii_types &&
266
+ (
267
+ context.pii_types.contains("url") ||
268
+ context.pii_types.contains("URL")
269
+ )
270
+ };
271
+
272
+ @id("privacy.block-pii-location-all")
273
+ @name("Block locations (comprehensive)")
274
+ @description("Blocks prompts, tool calls, and file reads/writes that contain a location (street address, postal code, or military address).")
275
+ @severity("low")
276
+ @tags("category:privacy,threat:pii,detection:pattern,owasp:llm06")
277
+ @reject_message("Content blocked: street address or location patterns detected.")
278
+ forbid (
279
+ principal,
280
+ action in [AgentOps::Action::"process_prompt", AgentOps::Action::"call_tool", AgentOps::Action::"read_file", AgentOps::Action::"write_file"],
281
+ resource
282
+ )
283
+ when {
284
+ context has pii_types &&
285
+ (
286
+ context.pii_types.contains("street_address") ||
287
+ context.pii_types.contains("zip_code") ||
288
+ context.pii_types.contains("military_address") ||
289
+ context.pii_types.contains("LOCATION")
290
+ )
291
+ };
292
+
293
+ @id("privacy.block-pii-organization-all")
294
+ @name("Block organization names (comprehensive)")
295
+ @description("Blocks prompts, tool calls, and file reads/writes that contain an organization name.")
296
+ @severity("low")
297
+ @tags("category:privacy,threat:pii,detection:pattern,owasp:llm06")
298
+ @reject_message("Content blocked: organization name patterns detected.")
299
+ forbid (
300
+ principal,
301
+ action in [AgentOps::Action::"process_prompt", AgentOps::Action::"call_tool", AgentOps::Action::"read_file", AgentOps::Action::"write_file"],
302
+ resource
303
+ )
304
+ when {
305
+ context has pii_types &&
306
+ (
307
+ context.pii_types.contains("organization") ||
308
+ context.pii_types.contains("ORGANIZATION")
309
+ )
310
+ };
311
+
312
+ @id("privacy.block-pii-occupation-all")
313
+ @name("Block occupations (comprehensive)")
314
+ @description("Blocks prompts, tool calls, and file reads/writes that contain an occupation.")
315
+ @severity("low")
316
+ @tags("category:privacy,threat:pii,detection:pattern,owasp:llm06")
317
+ @reject_message("Content blocked: occupation patterns detected.")
318
+ forbid (
319
+ principal,
320
+ action in [AgentOps::Action::"process_prompt", AgentOps::Action::"call_tool", AgentOps::Action::"read_file", AgentOps::Action::"write_file"],
321
+ resource
322
+ )
323
+ when {
324
+ context has pii_types &&
325
+ (
326
+ context.pii_types.contains("occupation") ||
327
+ context.pii_types.contains("OCCUPATION")
328
+ )
329
+ };
330
+
331
+ @id("privacy.block-pii-username-all")
332
+ @name("Block usernames (comprehensive)")
333
+ @description("Blocks prompts, tool calls, and file reads/writes that contain a username.")
334
+ @severity("low")
335
+ @tags("category:privacy,threat:pii,detection:pattern,owasp:llm06")
336
+ @reject_message("Content blocked: username patterns detected.")
337
+ forbid (
338
+ principal,
339
+ action in [AgentOps::Action::"process_prompt", AgentOps::Action::"call_tool", AgentOps::Action::"read_file", AgentOps::Action::"write_file"],
340
+ resource
341
+ )
342
+ when {
343
+ context has pii_types &&
344
+ (
345
+ context.pii_types.contains("username") ||
346
+ context.pii_types.contains("USERNAME")
347
+ )
348
+ };
349
+
350
+ @id("privacy.block-pii-employee-customer-id-all")
351
+ @name("Block employee or customer IDs (comprehensive)")
352
+ @description("Blocks prompts, tool calls, and file reads/writes that contain an employee or customer ID.")
353
+ @severity("medium")
354
+ @tags("category:privacy,threat:pii,detection:pattern,owasp:llm06")
355
+ @reject_message("Content blocked: employee or customer identifier patterns detected.")
356
+ forbid (
357
+ principal,
358
+ action in [AgentOps::Action::"process_prompt", AgentOps::Action::"call_tool", AgentOps::Action::"read_file", AgentOps::Action::"write_file"],
359
+ resource
360
+ )
361
+ when {
362
+ context has pii_types &&
363
+ (
364
+ context.pii_types.contains("employee_id") ||
365
+ context.pii_types.contains("customer_id") ||
366
+ context.pii_types.contains("EMPLOYEE_ID") ||
367
+ context.pii_types.contains("CUSTOMER_ID")
368
+ )
369
+ };
370
+
371
+ @id("privacy.block-pii-device-id-all")
372
+ @name("Block device and network identifiers (comprehensive)")
373
+ @description("Blocks prompts, tool calls, and file reads/writes that contain a device or network identifier (IP, MAC, IMEI, or UUID).")
374
+ @severity("medium")
375
+ @tags("category:privacy,threat:pii,detection:pattern,owasp:llm06")
376
+ @reject_message("Content blocked: device or network identifier patterns detected.")
377
+ forbid (
378
+ principal,
379
+ action in [AgentOps::Action::"process_prompt", AgentOps::Action::"call_tool", AgentOps::Action::"read_file", AgentOps::Action::"write_file"],
380
+ resource
381
+ )
382
+ when {
383
+ context has pii_types &&
384
+ (
385
+ context.pii_types.contains("device_id") ||
386
+ context.pii_types.contains("ip_address") ||
387
+ context.pii_types.contains("ipv6_address") ||
388
+ context.pii_types.contains("imei") ||
389
+ context.pii_types.contains("device_serial") ||
390
+ context.pii_types.contains("mac_address") ||
391
+ context.pii_types.contains("user_agent") ||
392
+ context.pii_types.contains("serial_number") ||
393
+ context.pii_types.contains("uuid") ||
394
+ context.pii_types.contains("DEVICE_ID")
395
+ )
396
+ };
397
+
398
+ @id("privacy.block-pii-vehicle-all")
399
+ @name("Block vehicle identifiers (comprehensive)")
400
+ @description("Blocks prompts, tool calls, and file reads/writes that contain a vehicle identifier (VIN or license plate).")
401
+ @severity("medium")
402
+ @tags("category:privacy,threat:pii,detection:pattern,owasp:llm06")
403
+ @reject_message("Content blocked: vehicle identifier (VIN or plate) patterns detected.")
404
+ forbid (
405
+ principal,
406
+ action in [AgentOps::Action::"process_prompt", AgentOps::Action::"call_tool", AgentOps::Action::"read_file", AgentOps::Action::"write_file"],
407
+ resource
408
+ )
409
+ when {
410
+ context has pii_types &&
411
+ (
412
+ context.pii_types.contains("vin") ||
413
+ context.pii_types.contains("license_plate") ||
414
+ context.pii_types.contains("VEHICLE_IDENTIFIER")
415
+ )
416
+ };
417
+
418
+ @id("privacy.block-pii-financial-all")
419
+ @name("Block financial amounts (comprehensive)")
420
+ @description("Blocks prompts, tool calls, and file reads/writes that contain a financial amount or transaction ID.")
421
+ @severity("medium")
422
+ @tags("category:privacy,threat:pii,detection:pattern,owasp:llm06")
423
+ @reject_message("Content blocked: salary or financial amount patterns detected.")
424
+ forbid (
425
+ principal,
426
+ action in [AgentOps::Action::"process_prompt", AgentOps::Action::"call_tool", AgentOps::Action::"read_file", AgentOps::Action::"write_file"],
427
+ resource
428
+ )
429
+ when {
430
+ context has pii_types &&
431
+ (
432
+ context.pii_types.contains("salary") ||
433
+ context.pii_types.contains("financial_amount") ||
434
+ context.pii_types.contains("transaction_id") ||
435
+ context.pii_types.contains("FINANCIAL")
436
+ )
437
+ };
438
+
439
+ @id("privacy.block-pii-sensitive-attribute-all")
440
+ @name("Block sensitive attributes (comprehensive)")
441
+ @description("Blocks prompts, tool calls, and file reads/writes that contain a sensitive personal attribute (ethnicity, religion, age, etc.).")
442
+ @severity("high")
443
+ @tags("category:privacy,threat:pii,detection:pattern,owasp:llm06")
444
+ @reject_message("Content blocked: sensitive attribute (ethnicity, religion, etc.) patterns detected.")
445
+ forbid (
446
+ principal,
447
+ action in [AgentOps::Action::"process_prompt", AgentOps::Action::"call_tool", AgentOps::Action::"read_file", AgentOps::Action::"write_file"],
448
+ resource
449
+ )
450
+ when {
451
+ context has pii_types &&
452
+ (
453
+ context.pii_types.contains("ethnicity") ||
454
+ context.pii_types.contains("religion") ||
455
+ context.pii_types.contains("sexual_orientation") ||
456
+ context.pii_types.contains("political_affiliation") ||
457
+ context.pii_types.contains("nationality") ||
458
+ context.pii_types.contains("age") ||
459
+ context.pii_types.contains("gender") ||
460
+ context.pii_types.contains("marital_status") ||
461
+ context.pii_types.contains("education_level") ||
462
+ context.pii_types.contains("employment_status") ||
463
+ context.pii_types.contains("SENSITIVE_ATTRIBUTE")
464
+ )
465
+ };
@@ -0,0 +1,164 @@
1
+ // =============================================================================
2
+ // Structural PII (Tier 1)
3
+ // =============================================================================
4
+ // Blocks high-sensitivity identifiers that have a deterministic structure (SSNs, credit cards, IBANs, API keys) using fast regex pattern matching — high precision, low latency, few false positives. One forbid rule per identifier group.
5
+ //
6
+ // Sensitivity tiers and the structural (regex) / contextual (model) type
7
+ // vocabulary are defined canonically in schemas/_shared/pii_taxonomy.json and
8
+ // enforced by tools/lint-templates.
9
+ //
10
+ // Context keys consumed:
11
+ // - pii_types: Set<String> (union of structural lowercase + contextual uppercase types)
12
+ //
13
+ // Category: privacy
14
+ // Namespace: AgentOps
15
+ // =============================================================================
16
+
17
+ @id("privacy.block-pii-national-id")
18
+ @name("Block national ID numbers (structural)")
19
+ @description("Blocks prompts, tool calls, and file reads/writes that contain a national ID (SSN, passport, or driver's license).")
20
+ @severity("high")
21
+ @tags("category:privacy,threat:pii,detection:pattern,owasp:llm06")
22
+ @reject_message("Content blocked: national identifier (SSN, passport, or driver's license) patterns detected.")
23
+ forbid (
24
+ principal,
25
+ action in [AgentOps::Action::"process_prompt", AgentOps::Action::"call_tool", AgentOps::Action::"read_file", AgentOps::Action::"write_file"],
26
+ resource
27
+ )
28
+ when {
29
+ context has pii_types &&
30
+ (
31
+ context.pii_types.contains("ssn") ||
32
+ context.pii_types.contains("passport") ||
33
+ context.pii_types.contains("national_id") ||
34
+ context.pii_types.contains("drivers_license")
35
+ )
36
+ };
37
+
38
+ @id("privacy.block-pii-credit-card")
39
+ @name("Block credit card numbers (structural)")
40
+ @description("Blocks prompts, tool calls, and file reads/writes that contain a credit card number.")
41
+ @severity("critical")
42
+ @tags("category:privacy,threat:pii,detection:pattern,compliance:pci-dss,owasp:llm06")
43
+ @reject_message("Content blocked: credit card number patterns detected.")
44
+ forbid (
45
+ principal,
46
+ action in [AgentOps::Action::"process_prompt", AgentOps::Action::"call_tool", AgentOps::Action::"read_file", AgentOps::Action::"write_file"],
47
+ resource
48
+ )
49
+ when {
50
+ context has pii_types && context.pii_types.contains("credit_card")
51
+ };
52
+
53
+ @id("privacy.block-pii-bank-account")
54
+ @name("Block bank account numbers (structural)")
55
+ @description("Blocks prompts, tool calls, and file reads/writes that contain a bank account number (IBAN, SWIFT/BIC, or routing number).")
56
+ @severity("critical")
57
+ @tags("category:privacy,threat:pii,detection:pattern,owasp:llm06")
58
+ @reject_message("Content blocked: bank account (IBAN) number patterns detected.")
59
+ forbid (
60
+ principal,
61
+ action in [AgentOps::Action::"process_prompt", AgentOps::Action::"call_tool", AgentOps::Action::"read_file", AgentOps::Action::"write_file"],
62
+ resource
63
+ )
64
+ when {
65
+ context has pii_types &&
66
+ (
67
+ context.pii_types.contains("iban") ||
68
+ context.pii_types.contains("bank_account") ||
69
+ context.pii_types.contains("swift_bic") ||
70
+ context.pii_types.contains("aba_routing")
71
+ )
72
+ };
73
+
74
+ @id("privacy.block-pii-medical")
75
+ @name("Block medical identifiers (structural)")
76
+ @description("Blocks prompts, tool calls, and file reads/writes that contain medical data (record number, MBI, NPI, or blood type).")
77
+ @severity("medium")
78
+ @tags("category:privacy,threat:pii,detection:pattern,compliance:hipaa,owasp:llm06")
79
+ @reject_message("Content blocked: medical record identifier patterns detected.")
80
+ forbid (
81
+ principal,
82
+ action in [AgentOps::Action::"process_prompt", AgentOps::Action::"call_tool", AgentOps::Action::"read_file", AgentOps::Action::"write_file"],
83
+ resource
84
+ )
85
+ when {
86
+ context has pii_types &&
87
+ (
88
+ context.pii_types.contains("medical_record") ||
89
+ context.pii_types.contains("patient_record") ||
90
+ context.pii_types.contains("medicare_beneficiary_id") ||
91
+ context.pii_types.contains("npi") ||
92
+ context.pii_types.contains("medical_term") ||
93
+ context.pii_types.contains("blood_type")
94
+ )
95
+ };
96
+
97
+ @id("privacy.block-pii-tax-id")
98
+ @name("Block tax identifiers (structural)")
99
+ @description("Blocks prompts, tool calls, and file reads/writes that contain a tax ID (ITIN, EIN, or PTIN).")
100
+ @severity("high")
101
+ @tags("category:privacy,threat:pii,detection:pattern,owasp:llm06")
102
+ @reject_message("Content blocked: tax identifier (ITIN or EIN) patterns detected.")
103
+ forbid (
104
+ principal,
105
+ action in [AgentOps::Action::"process_prompt", AgentOps::Action::"call_tool", AgentOps::Action::"read_file", AgentOps::Action::"write_file"],
106
+ resource
107
+ )
108
+ when {
109
+ context has pii_types &&
110
+ (
111
+ context.pii_types.contains("itin") ||
112
+ context.pii_types.contains("ein") ||
113
+ context.pii_types.contains("ptin")
114
+ )
115
+ };
116
+
117
+ @id("privacy.block-pii-credential")
118
+ @name("Block credentials (structural)")
119
+ @description("Blocks prompts, tool calls, and file reads/writes that contain a credential or secret (API key, token, password hash, or private key).")
120
+ @severity("critical")
121
+ @tags("category:privacy,threat:pii,detection:pattern,owasp:llm06")
122
+ @reject_message("Content blocked: credential or API key patterns detected.")
123
+ forbid (
124
+ principal,
125
+ action in [AgentOps::Action::"process_prompt", AgentOps::Action::"call_tool", AgentOps::Action::"read_file", AgentOps::Action::"write_file"],
126
+ resource
127
+ )
128
+ when {
129
+ context has pii_types &&
130
+ (
131
+ context.pii_types.contains("aws_access_key") ||
132
+ context.pii_types.contains("api_key") ||
133
+ context.pii_types.contains("jwt_token") ||
134
+ context.pii_types.contains("encryption_key") ||
135
+ context.pii_types.contains("http_basic_auth") ||
136
+ context.pii_types.contains("gcp_credential") ||
137
+ context.pii_types.contains("gcp_api_key") ||
138
+ context.pii_types.contains("gcp_signed_policy") ||
139
+ context.pii_types.contains("session_cookie") ||
140
+ context.pii_types.contains("oauth_token") ||
141
+ context.pii_types.contains("tls_certificate") ||
142
+ context.pii_types.contains("password_hash") ||
143
+ context.pii_types.contains("csrf_token")
144
+ )
145
+ };
146
+
147
+ @id("privacy.block-pii-crypto")
148
+ @name("Block cryptocurrency addresses (structural)")
149
+ @description("Blocks prompts, tool calls, and file reads/writes that contain a cryptocurrency wallet address.")
150
+ @severity("high")
151
+ @tags("category:privacy,threat:pii,detection:pattern,owasp:llm06")
152
+ @reject_message("Content blocked: cryptocurrency wallet address patterns detected.")
153
+ forbid (
154
+ principal,
155
+ action in [AgentOps::Action::"process_prompt", AgentOps::Action::"call_tool", AgentOps::Action::"read_file", AgentOps::Action::"write_file"],
156
+ resource
157
+ )
158
+ when {
159
+ context has pii_types &&
160
+ (
161
+ context.pii_types.contains("bitcoin_address") ||
162
+ context.pii_types.contains("ethereum_address")
163
+ )
164
+ };