@highflame/policy 2.2.4 → 2.2.6

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 (24) hide show
  1. package/_schemas/ai_gateway/templates/defaults/pii.cedar +164 -0
  2. package/_schemas/ai_gateway/templates/defaults/pii_advanced.cedar +465 -0
  3. package/_schemas/ai_gateway/templates/defaults/pii_model.cedar +90 -0
  4. package/_schemas/ai_gateway/templates/secrets.cedar +46 -0
  5. package/_schemas/ai_gateway/templates/templates.json +88 -11
  6. package/_schemas/guardrails/templates/defaults/pii.cedar +137 -28
  7. package/_schemas/guardrails/templates/defaults/pii_model.cedar +90 -0
  8. package/_schemas/guardrails/templates/profiles/advanced_detection/pii.cedar +433 -31
  9. package/_schemas/guardrails/templates/templates.json +158 -43
  10. package/_schemas/sentry/templates/defaults/clipboard.cedar +3 -18
  11. package/_schemas/sentry/templates/defaults/file_safety.cedar +2 -17
  12. package/_schemas/sentry/templates/defaults/pii.cedar +102 -96
  13. package/_schemas/sentry/templates/defaults/pii_advanced.cedar +465 -0
  14. package/_schemas/sentry/templates/defaults/pii_model.cedar +90 -0
  15. package/_schemas/sentry/templates/templates.json +68 -11
  16. package/dist/ai_gateway-defaults.gen.d.ts +1 -1
  17. package/dist/ai_gateway-defaults.gen.js +838 -59
  18. package/dist/guardrails-defaults.gen.js +834 -226
  19. package/dist/overwatch-defaults.gen.js +703 -114
  20. package/dist/sentry-defaults.gen.js +746 -138
  21. package/package.json +1 -1
  22. package/_schemas/ai_gateway/templates/pii_redaction.cedar +0 -94
  23. package/_schemas/guardrails/templates/profiles/chat_assistant/privacy.cedar +0 -35
  24. package/_schemas/guardrails/templates/profiles/data_pipeline/privacy.cedar +0 -63
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@highflame/policy",
3
- "version": "2.2.4",
3
+ "version": "2.2.6",
4
4
  "engines": {
5
5
  "node": ">=18"
6
6
  },
@@ -1,94 +0,0 @@
1
- // =============================================================================
2
- // PII & Secrets Redaction
3
- // =============================================================================
4
- // Blocks AI Gateway operations when personally identifiable information or
5
- // secrets are detected in the content. Covers both LLM prompt processing
6
- // and MCP tool calls, plus a bulk-exposure catch-all.
7
- //
8
- // Context keys consumed:
9
- // - pii_detected: Bool
10
- // - secrets_detected: Bool
11
- // - pii_count: Long
12
- //
13
- // Compliance:
14
- // - OWASP LLM06
15
- // - GDPR, HIPAA (depending on data classification)
16
- //
17
- // Category: data-protection
18
- // Namespace: AIGateway
19
- // =============================================================================
20
-
21
- @id("data-protection.block-pii")
22
- @name("Block PII in prompts")
23
- @description("Blocks process_prompt when pii_detected is true.")
24
- @severity("high")
25
- @tags("category:data-protection,threat:pii,detection:rule,surface:process-prompt,owasp:llm06")
26
- @reject_message("Prompt blocked: personally identifiable information was detected — remove sensitive data and retry.")
27
- forbid (
28
- principal,
29
- action == AIGateway::Action::"process_prompt",
30
- resource
31
- )
32
- when {
33
- context has pii_detected && context.pii_detected == true
34
- };
35
-
36
- @id("data-protection.block-secrets")
37
- @name("Block secrets in prompts")
38
- @description("Blocks process_prompt when secrets_detected is true.")
39
- @severity("critical")
40
- @tags("category:data-protection,threat:secrets,detection:rule,surface:process-prompt")
41
- @reject_message("Prompt blocked: secrets or credentials were detected — remove sensitive data and retry.")
42
- forbid (
43
- principal,
44
- action == AIGateway::Action::"process_prompt",
45
- resource
46
- )
47
- when {
48
- context has secrets_detected && context.secrets_detected == true
49
- };
50
-
51
- @id("data-protection.block-pii-tools")
52
- @name("Block PII in tool calls")
53
- @description("Blocks call_tool when pii_detected is true.")
54
- @severity("high")
55
- @tags("category:data-protection,threat:pii,detection:rule,surface:call-tool,owasp:llm06")
56
- @reject_message("Tool execution blocked: personally identifiable information was detected in tool arguments.")
57
- forbid (
58
- principal,
59
- action == AIGateway::Action::"call_tool",
60
- resource
61
- )
62
- when {
63
- context has pii_detected && context.pii_detected == true
64
- };
65
-
66
- @id("data-protection.block-secrets-tools")
67
- @name("Block secrets in tool calls")
68
- @description("Blocks call_tool when secrets_detected is true.")
69
- @severity("critical")
70
- @tags("category:data-protection,threat:secrets,detection:rule,surface:call-tool")
71
- @reject_message("Tool execution blocked: secrets or credentials were detected in tool arguments.")
72
- forbid (
73
- principal,
74
- action == AIGateway::Action::"call_tool",
75
- resource
76
- )
77
- when {
78
- context has secrets_detected && context.secrets_detected == true
79
- };
80
-
81
- @id("data-protection.block-pii-bulk")
82
- @name("Block bulk PII exposure")
83
- @description("Blocks any action when pii_count >= 3.")
84
- @severity("critical")
85
- @tags("category:data-protection,threat:exfiltration,detection:aggregate,posture:catch-all")
86
- @reject_message("Request blocked: multiple PII matches were detected — possible data exfiltration.")
87
- forbid (
88
- principal,
89
- action,
90
- resource
91
- )
92
- when {
93
- context has pii_count && context.pii_count >= 3
94
- };
@@ -1,35 +0,0 @@
1
- // =============================================================================
2
- // Chat Assistant — Privacy
3
- // =============================================================================
4
- // PII protection for customer-facing chatbots. Blocks PII in both directions
5
- // (input + output) across prompts, tool calls, and file operations.
6
- //
7
- // Context keys consumed:
8
- // - pii_detected: Bool
9
- //
10
- // Compliance:
11
- // - GDPR Art. 32, HIPAA, PCI-DSS
12
- //
13
- // Category: privacy
14
- // Namespace: Guardrails
15
- // =============================================================================
16
-
17
- @id("privacy.chat-block-pii")
18
- @name("Block PII in chat (both directions)")
19
- @description("Blocks process_prompt, call_tool, read_file, and write_file when pii_detected is true.")
20
- @severity("high")
21
- @tags("category:privacy,threat:pii,detection:rule,compliance:gdpr,compliance:hipaa")
22
- @reject_message("Request blocked: personally identifiable information was detected.")
23
- forbid (
24
- principal,
25
- action in [
26
- Guardrails::Action::"process_prompt",
27
- Guardrails::Action::"call_tool",
28
- Guardrails::Action::"read_file",
29
- Guardrails::Action::"write_file"
30
- ],
31
- resource
32
- )
33
- when {
34
- context has pii_detected && context.pii_detected == true
35
- };
@@ -1,63 +0,0 @@
1
- // =============================================================================
2
- // Data Pipeline — Privacy
3
- // =============================================================================
4
- // Strict PII protection for RAG pipelines and data processing agents.
5
- // Zero-tolerance for sensitive PII types — data pipelines must not leak PII.
6
- //
7
- // Context keys consumed:
8
- // - pii_detected: Bool
9
- // - pii_types: Set<String>
10
- //
11
- // Compliance:
12
- // - GDPR Art. 32, HIPAA §164.312, PCI DSS 3.4
13
- //
14
- // Category: privacy
15
- // Namespace: Guardrails
16
- // =============================================================================
17
-
18
- @id("privacy.data-pipeline-block-pii")
19
- @name("Block PII in data pipeline")
20
- @description("Blocks process_prompt, call_tool, read_file, and write_file when pii_detected is true.")
21
- @severity("critical")
22
- @tags("category:privacy,threat:pii,detection:rule,compliance:gdpr,compliance:hipaa")
23
- @reject_message("Request blocked: PII detected in a data pipeline — pipelines must not process or leak personal data.")
24
- forbid (
25
- principal,
26
- action in [
27
- Guardrails::Action::"process_prompt",
28
- Guardrails::Action::"call_tool",
29
- Guardrails::Action::"read_file",
30
- Guardrails::Action::"write_file"
31
- ],
32
- resource
33
- )
34
- when {
35
- context has pii_detected && context.pii_detected == true
36
- };
37
-
38
- @id("privacy.data-pipeline-block-pii-sensitive")
39
- @name("Block sensitive PII types in data pipeline")
40
- @description("Blocks process_prompt, call_tool, read_file, and write_file when pii_types contains SSN, credit_card, passport, medical_id, or tax_id.")
41
- @severity("critical")
42
- @tags("category:privacy,threat:pii,detection:rule,compliance:gdpr,compliance:hipaa,compliance:pci-dss")
43
- @reject_message("Request blocked: highly sensitive PII (SSN, credit card, passport, medical ID, or tax ID) detected in a data pipeline.")
44
- forbid (
45
- principal,
46
- action in [
47
- Guardrails::Action::"process_prompt",
48
- Guardrails::Action::"call_tool",
49
- Guardrails::Action::"read_file",
50
- Guardrails::Action::"write_file"
51
- ],
52
- resource
53
- )
54
- when {
55
- context has pii_types &&
56
- (
57
- context.pii_types.contains("ssn") ||
58
- context.pii_types.contains("credit_card") ||
59
- context.pii_types.contains("passport") ||
60
- context.pii_types.contains("medical_id") ||
61
- context.pii_types.contains("tax_id")
62
- )
63
- };