@highflame/policy 2.2.34 → 2.2.35

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.
@@ -10,7 +10,6 @@
10
10
  // - agent_trust_level, agent_type, tool_name, tool_is_sensitive
11
11
  // - session_pii_detected, session_pii_types
12
12
  // - session_secrets_detected, session_injection_detected
13
- // - session_command_injection
14
13
  // - session_threat_turns: Long
15
14
  // - session_cumulative_risk_score: Long
16
15
  // - suspicious_pattern: Bool
@@ -106,22 +105,9 @@ when {
106
105
  context has session_injection_detected && context.session_injection_detected == true
107
106
  };
108
107
 
109
- @id("agent-identity.multi-agent-post-command-injection-shell")
110
- @name("Block shell after command injection in session")
111
- @description("Blocks call_tool when session_command_injection is true and tool_name is a shell tool.")
112
- @severity("critical")
113
- @tags("category:agent-identity,threat:command-injection,scope:per-agent,detection:aggregate,surface:call-tool,mitre:t1059")
114
- @reject_message("Tool execution blocked: command injection was detected earlier in this session — no agent may execute shell commands afterwards.")
115
- forbid (
116
- principal is AgentOps::Agent,
117
- action == AgentOps::Action::"call_tool",
118
- resource
119
- )
120
- when {
121
- context has session_command_injection && context.session_command_injection == true &&
122
- context has tool_name &&
123
- (context.tool_name == "shell" || context.tool_name == "execute_command" || context.tool_name == "bash")
124
- };
108
+ // The post-command-injection shell rule was removed while that detector is
109
+ // disabled, so this template cannot instantiate a rule that can never fire.
110
+ // See highflame-shield#386; restore it when the detector is re-enabled.
125
111
 
126
112
  // ---------------------------------------------------------------------------
127
113
  // Section 4: Cumulative risk circuit breakers
@@ -1,38 +1,26 @@
1
1
  // =============================================================================
2
2
  // Security Pattern Detection (Default)
3
3
  // =============================================================================
4
- // Blocks command injection, path traversal, and SQL injection using
5
- // regex-based pattern detection from Shield's security detectors.
4
+ // Blocks path traversal and SQL injection using regex-based pattern detection
5
+ // from Shield's security detectors.
6
+ //
7
+ // The command-injection rule was removed while that detector is disabled, so
8
+ // this template cannot instantiate a rule that can never fire. See
9
+ // highflame-shield#386; restore the rule when the detector is re-enabled.
6
10
  //
7
11
  // Context keys consumed:
8
- // - command_injection_detected: Bool
9
12
  // - path_traversal_detected: Bool
10
13
  // - path_traversal_severity: String
11
14
  // - sql_injection_detected: Bool
12
15
  // - sql_injection_score: Long (0-100)
13
16
  //
14
17
  // Compliance:
15
- // - MITRE T1059 (Command Injection), T1005 (Data from Local System)
18
+ // - MITRE T1005 (Data from Local System)
16
19
  //
17
20
  // Category: security
18
21
  // Namespace: AgentOps
19
22
  // =============================================================================
20
23
 
21
- @id("security.block-command-injection")
22
- @name("Block command injection")
23
- @description("Blocks process_prompt and call_tool when command_injection_detected is true.")
24
- @severity("critical")
25
- @tags("category:security,threat:command-injection,detection:pattern,mitre:t1059")
26
- @reject_message("Request blocked: command injection pattern detected — reverse shell, destructive command, or privilege escalation.")
27
- forbid (
28
- principal,
29
- action in [AgentOps::Action::"process_prompt", AgentOps::Action::"call_tool"],
30
- resource
31
- )
32
- when {
33
- context has command_injection_detected && context.command_injection_detected == true
34
- };
35
-
36
24
  @id("security.block-path-traversal")
37
25
  @name("Block path traversal")
38
26
  @description("Blocks process_prompt, call_tool, read_file, and write_file when path_traversal_detected is true and severity is high or critical.")
@@ -1,11 +1,15 @@
1
1
  // =============================================================================
2
2
  // Semantic Threat Detection (Default)
3
3
  // =============================================================================
4
- // Blocks injection attacks (command, SQL, path traversal), prompt injection,
5
- // jailbreak attempts, and encoded payloads using two detection tiers:
4
+ // Blocks injection attacks (SQL, path traversal), prompt injection, jailbreak
5
+ // attempts, and encoded payloads using two detection tiers:
6
6
  //
7
7
  // Tier 1 — Pattern-based (always available, no external dependency)
8
- // command_injection, sql_injection, path_traversal, detect_encoded
8
+ // sql_injection, path_traversal, detect_encoded
9
+ //
10
+ // The command-injection rules were removed while that detector is disabled, so
11
+ // this template cannot instantiate rules that can never fire. See
12
+ // highflame-shield#386; restore them when the detector is re-enabled.
9
13
  //
10
14
  // Tier 2 — ML classifiers (require Highflame API token)
11
15
  // injection_score, jailbreak_score
@@ -30,36 +34,6 @@
30
34
  // Tier 1: Pattern-based injection detection
31
35
  // ---------------------------------------------------------------------------
32
36
 
33
- @id("semantic.block-command-injection-tool")
34
- @name("Block command injection in tool calls")
35
- @description("Blocks call_tool when detected_threats contains \"command_injection\".")
36
- @severity("critical")
37
- @tags("category:semantic,threat:command-injection,detection:pattern,surface:call-tool,mitre:t1059,owasp:asi02")
38
- @reject_message("Tool execution blocked: command injection pattern detected — reverse shell, destructive command, or privilege escalation.")
39
- forbid (
40
- principal,
41
- action == AgentOps::Action::"call_tool",
42
- resource
43
- )
44
- when {
45
- context has detected_threats && context.detected_threats.contains("command_injection")
46
- };
47
-
48
- @id("semantic.block-command-injection-prompt")
49
- @name("Block command injection in prompts")
50
- @description("Blocks process_prompt when detected_threats contains \"command_injection\".")
51
- @severity("critical")
52
- @tags("category:semantic,threat:command-injection,detection:pattern,surface:process-prompt,mitre:t1059")
53
- @reject_message("Prompt blocked: command injection pattern detected.")
54
- forbid (
55
- principal,
56
- action == AgentOps::Action::"process_prompt",
57
- resource
58
- )
59
- when {
60
- context has detected_threats && context.detected_threats.contains("command_injection")
61
- };
62
-
63
37
  @id("semantic.block-sql-injection-tool")
64
38
  @name("Block SQL injection in tool calls")
65
39
  @description("Blocks call_tool when detected_threats contains \"sql_injection\".")
@@ -251,17 +251,15 @@
251
251
  {
252
252
  "id": "security.patterns",
253
253
  "name": "Security Pattern Detection",
254
- "description": "Block command injection, path traversal, and SQL injection using regex-based pattern detection.",
254
+ "description": "Block path traversal and SQL injection using regex-based pattern detection.",
255
255
  "category": "threat-detection",
256
256
  "file": "ported/threat-detection/security_patterns.cedar",
257
- "severity": "critical",
257
+ "severity": "high",
258
258
  "tags": [
259
259
  "category:security",
260
- "threat:command-injection",
261
260
  "threat:sql-injection",
262
261
  "threat:path-traversal",
263
- "detection:pattern",
264
- "mitre:t1059"
262
+ "detection:pattern"
265
263
  ]
266
264
  },
267
265
  {
@@ -610,7 +608,7 @@
610
608
  {
611
609
  "id": "semantic.defaults",
612
610
  "name": "Semantic Threat Detection",
613
- "description": "Block injection attacks (command, SQL, path, encoded) plus ML-detected prompt injection and jailbreak attempts.",
611
+ "description": "Block injection attacks (SQL, path, encoded) plus ML-detected prompt injection and jailbreak attempts.",
614
612
  "category": "threat-detection",
615
613
  "file": "ported/threat-detection/semantic_defaults.cedar",
616
614
  "severity": "critical",
@@ -8,7 +8,6 @@
8
8
  // - Computed risk score (tool_risk_score)
9
9
  // - Detector category labels (tool_category, tool_is_sensitive)
10
10
  // - Threat aggregation (threat_count, max_threat_severity)
11
- // - Detection rule triggers (detected_threats)
12
11
  //
13
12
  // Context keys consumed:
14
13
  // - tool_risk_score: Long (0-100)
@@ -16,11 +15,9 @@
16
15
  // - tool_is_sensitive: Bool
17
16
  // - threat_count: Long
18
17
  // - max_threat_severity: Long (0-4)
19
- // - detected_threats: Set<String>
20
18
  //
21
19
  // Compliance:
22
20
  // - OWASP LLM06, OWASP ASI02
23
- // - MITRE T1059
24
21
  //
25
22
  // Category: tools
26
23
  // Namespace: AIGateway
@@ -88,17 +85,6 @@ when {
88
85
  context.threat_count >= 1 && context.max_threat_severity >= 3
89
86
  };
90
87
 
91
- @id("tools.block-command-injection")
92
- @name("Block command injection")
93
- @description("Blocks call_tool when detected_threats contains \"command_injection\".")
94
- @severity("critical")
95
- @tags("category:tools,threat:command-injection,detection:rule,surface:call-tool,mitre:t1059,owasp:asi02")
96
- @reject_message("Tool execution blocked: command injection pattern detected in tool arguments.")
97
- forbid (
98
- principal,
99
- action == AIGateway::Action::"call_tool",
100
- resource
101
- )
102
- when {
103
- context has detected_threats && context.detected_threats.contains("command_injection")
104
- };
88
+ // The command-injection rule was removed while that detector is disabled, so
89
+ // this template cannot instantiate a rule that can never fire. See
90
+ // highflame-shield#386; restore it when the detector is re-enabled.
@@ -75,13 +75,12 @@
75
75
  {
76
76
  "id": "tools.defaults",
77
77
  "name": "Tool Permissioning",
78
- "description": "Enforce tool risk scoring, block dangerous tools, and detect command injection in MCP tool arguments.",
78
+ "description": "Enforce tool risk scoring and block dangerous tools in MCP tool arguments.",
79
79
  "category": "tools",
80
80
  "file": "defaults/tools.cedar",
81
81
  "severity": "critical",
82
82
  "tags": [
83
83
  "category:tools",
84
- "threat:command-injection",
85
84
  "owasp:llm06",
86
85
  "owasp:asi02"
87
86
  ]
@@ -1,38 +1,26 @@
1
1
  // =============================================================================
2
2
  // Security Pattern Detection (Default)
3
3
  // =============================================================================
4
- // Blocks command injection, path traversal, and SQL injection using
5
- // regex-based pattern detection from Shield's security detectors.
4
+ // Blocks path traversal and SQL injection using regex-based pattern detection
5
+ // from Shield's security detectors.
6
+ //
7
+ // The command-injection rule was removed while that detector is disabled, so
8
+ // this template cannot instantiate a rule that can never fire. See
9
+ // highflame-shield#386; restore the rule when the detector is re-enabled.
6
10
  //
7
11
  // Context keys consumed:
8
- // - command_injection_detected: Bool
9
12
  // - path_traversal_detected: Bool
10
13
  // - path_traversal_severity: String
11
14
  // - sql_injection_detected: Bool
12
15
  // - sql_injection_score: Long (0-100)
13
16
  //
14
17
  // Compliance:
15
- // - MITRE T1059 (Command Injection), T1005 (Data from Local System)
18
+ // - MITRE T1005 (Data from Local System)
16
19
  //
17
20
  // Category: security
18
21
  // Namespace: Guardrails
19
22
  // =============================================================================
20
23
 
21
- @id("security.block-command-injection")
22
- @name("Block command injection")
23
- @description("Blocks process_prompt and call_tool when command_injection_detected is true.")
24
- @severity("critical")
25
- @tags("category:security,threat:command-injection,detection:pattern,mitre:t1059")
26
- @reject_message("Request blocked: command injection pattern detected — reverse shell, destructive command, or privilege escalation.")
27
- forbid (
28
- principal,
29
- action in [Guardrails::Action::"process_prompt", Guardrails::Action::"call_tool"],
30
- resource
31
- )
32
- when {
33
- context has command_injection_detected && context.command_injection_detected == true
34
- };
35
-
36
24
  @id("security.block-path-traversal")
37
25
  @name("Block path traversal")
38
26
  @description("Blocks process_prompt, call_tool, read_file, and write_file when path_traversal_detected is true and severity is high or critical.")
@@ -10,7 +10,6 @@
10
10
  // - agent_trust_level, agent_type, tool_name, tool_is_sensitive
11
11
  // - session_pii_detected, session_pii_types
12
12
  // - session_secrets_detected, session_injection_detected
13
- // - session_command_injection
14
13
  // - session_threat_turns: Long
15
14
  // - session_cumulative_risk_score: Long
16
15
  // - suspicious_pattern: Bool
@@ -106,22 +105,9 @@ when {
106
105
  context has session_injection_detected && context.session_injection_detected == true
107
106
  };
108
107
 
109
- @id("agent-identity.multi-agent-post-command-injection-shell")
110
- @name("Block shell after command injection in session")
111
- @description("Blocks call_tool when session_command_injection is true and tool_name is a shell tool.")
112
- @severity("critical")
113
- @tags("category:agent-identity,threat:command-injection,scope:per-agent,detection:aggregate,surface:call-tool,mitre:t1059")
114
- @reject_message("Tool execution blocked: command injection was detected earlier in this session — no agent may execute shell commands afterwards.")
115
- forbid (
116
- principal is Guardrails::Agent,
117
- action == Guardrails::Action::"call_tool",
118
- resource
119
- )
120
- when {
121
- context has session_command_injection && context.session_command_injection == true &&
122
- context has tool_name &&
123
- (context.tool_name == "shell" || context.tool_name == "execute_command" || context.tool_name == "bash")
124
- };
108
+ // The post-command-injection shell rule was removed while that detector is
109
+ // disabled, so this template cannot instantiate a rule that can never fire.
110
+ // See highflame-shield#386; restore it when the detector is re-enabled.
125
111
 
126
112
  // ---------------------------------------------------------------------------
127
113
  // Section 4: Cumulative risk circuit breakers
@@ -6,7 +6,7 @@
6
6
  {
7
7
  "id": "security",
8
8
  "name": "Security",
9
- "description": "Block prompt injection, jailbreak attempts, command injection, path traversal, and SQL injection."
9
+ "description": "Block prompt injection, jailbreak attempts, path traversal, and SQL injection."
10
10
  },
11
11
  {
12
12
  "id": "privacy",
@@ -185,17 +185,15 @@
185
185
  {
186
186
  "id": "security.patterns",
187
187
  "name": "Security Pattern Detection",
188
- "description": "Block command injection, path traversal, and SQL injection using regex-based pattern detection.",
188
+ "description": "Block path traversal and SQL injection using regex-based pattern detection.",
189
189
  "category": "security",
190
190
  "file": "defaults/security_patterns.cedar",
191
- "severity": "critical",
191
+ "severity": "high",
192
192
  "tags": [
193
193
  "category:security",
194
- "threat:command-injection",
195
194
  "threat:sql-injection",
196
195
  "threat:path-traversal",
197
- "detection:pattern",
198
- "mitre:t1059"
196
+ "detection:pattern"
199
197
  ]
200
198
  },
201
199
  {
@@ -23,11 +23,6 @@
23
23
  "name": "Content Safety",
24
24
  "description": "Block violent, harmful, hateful, sexual, or profane content."
25
25
  },
26
- {
27
- "id": "file-safety",
28
- "name": "File & Attachment Safety",
29
- "description": "Block file uploads containing secrets or PII."
30
- },
31
26
  {
32
27
  "id": "clipboard",
33
28
  "name": "Clipboard Policy",
@@ -146,15 +141,6 @@
146
141
  "compliance:hipaa"
147
142
  ]
148
143
  },
149
- {
150
- "id": "file-safety.block-upload-secrets",
151
- "name": "File & Attachment Safety",
152
- "description": "Block file uploads containing secrets in document content.",
153
- "category": "file-safety",
154
- "file": "defaults/file_safety.cedar",
155
- "severity": "critical",
156
- "tags": ["category:file-safety", "threat:secrets"]
157
- },
158
144
  {
159
145
  "id": "clipboard.defaults",
160
146
  "name": "Clipboard Policy",
@@ -1263,38 +1263,26 @@ when {
1263
1263
  const AGENT_OPS_SECURITY_PATTERNS_CEDAR = `// =============================================================================
1264
1264
  // Security Pattern Detection (Default)
1265
1265
  // =============================================================================
1266
- // Blocks command injection, path traversal, and SQL injection using
1267
- // regex-based pattern detection from Shield's security detectors.
1266
+ // Blocks path traversal and SQL injection using regex-based pattern detection
1267
+ // from Shield's security detectors.
1268
+ //
1269
+ // The command-injection rule was removed while that detector is disabled, so
1270
+ // this template cannot instantiate a rule that can never fire. See
1271
+ // highflame-shield#386; restore the rule when the detector is re-enabled.
1268
1272
  //
1269
1273
  // Context keys consumed:
1270
- // - command_injection_detected: Bool
1271
1274
  // - path_traversal_detected: Bool
1272
1275
  // - path_traversal_severity: String
1273
1276
  // - sql_injection_detected: Bool
1274
1277
  // - sql_injection_score: Long (0-100)
1275
1278
  //
1276
1279
  // Compliance:
1277
- // - MITRE T1059 (Command Injection), T1005 (Data from Local System)
1280
+ // - MITRE T1005 (Data from Local System)
1278
1281
  //
1279
1282
  // Category: security
1280
1283
  // Namespace: AgentOps
1281
1284
  // =============================================================================
1282
1285
 
1283
- @id("security.block-command-injection")
1284
- @name("Block command injection")
1285
- @description("Blocks process_prompt and call_tool when command_injection_detected is true.")
1286
- @severity("critical")
1287
- @tags("category:security,threat:command-injection,detection:pattern,mitre:t1059")
1288
- @reject_message("Request blocked: command injection pattern detected — reverse shell, destructive command, or privilege escalation.")
1289
- forbid (
1290
- principal,
1291
- action in [AgentOps::Action::"process_prompt", AgentOps::Action::"call_tool"],
1292
- resource
1293
- )
1294
- when {
1295
- context has command_injection_detected && context.command_injection_detected == true
1296
- };
1297
-
1298
1286
  @id("security.block-path-traversal")
1299
1287
  @name("Block path traversal")
1300
1288
  @description("Blocks process_prompt, call_tool, read_file, and write_file when path_traversal_detected is true and severity is high or critical.")
@@ -2552,7 +2540,6 @@ const AGENT_OPS_AGENT_IDENTITY_MULTI_AGENT_SAFETY_CEDAR = `// ==================
2552
2540
  // - agent_trust_level, agent_type, tool_name, tool_is_sensitive
2553
2541
  // - session_pii_detected, session_pii_types
2554
2542
  // - session_secrets_detected, session_injection_detected
2555
- // - session_command_injection
2556
2543
  // - session_threat_turns: Long
2557
2544
  // - session_cumulative_risk_score: Long
2558
2545
  // - suspicious_pattern: Bool
@@ -2648,22 +2635,9 @@ when {
2648
2635
  context has session_injection_detected && context.session_injection_detected == true
2649
2636
  };
2650
2637
 
2651
- @id("agent-identity.multi-agent-post-command-injection-shell")
2652
- @name("Block shell after command injection in session")
2653
- @description("Blocks call_tool when session_command_injection is true and tool_name is a shell tool.")
2654
- @severity("critical")
2655
- @tags("category:agent-identity,threat:command-injection,scope:per-agent,detection:aggregate,surface:call-tool,mitre:t1059")
2656
- @reject_message("Tool execution blocked: command injection was detected earlier in this session — no agent may execute shell commands afterwards.")
2657
- forbid (
2658
- principal is AgentOps::Agent,
2659
- action == AgentOps::Action::"call_tool",
2660
- resource
2661
- )
2662
- when {
2663
- context has session_command_injection && context.session_command_injection == true &&
2664
- context has tool_name &&
2665
- (context.tool_name == "shell" || context.tool_name == "execute_command" || context.tool_name == "bash")
2666
- };
2638
+ // The post-command-injection shell rule was removed while that detector is
2639
+ // disabled, so this template cannot instantiate a rule that can never fire.
2640
+ // See highflame-shield#386; restore it when the detector is re-enabled.
2667
2641
 
2668
2642
  // ---------------------------------------------------------------------------
2669
2643
  // Section 4: Cumulative risk circuit breakers
@@ -3918,11 +3892,15 @@ when {
3918
3892
  const AGENT_OPS_SEMANTIC_DEFAULTS_CEDAR = `// =============================================================================
3919
3893
  // Semantic Threat Detection (Default)
3920
3894
  // =============================================================================
3921
- // Blocks injection attacks (command, SQL, path traversal), prompt injection,
3922
- // jailbreak attempts, and encoded payloads using two detection tiers:
3895
+ // Blocks injection attacks (SQL, path traversal), prompt injection, jailbreak
3896
+ // attempts, and encoded payloads using two detection tiers:
3923
3897
  //
3924
3898
  // Tier 1 — Pattern-based (always available, no external dependency)
3925
- // command_injection, sql_injection, path_traversal, detect_encoded
3899
+ // sql_injection, path_traversal, detect_encoded
3900
+ //
3901
+ // The command-injection rules were removed while that detector is disabled, so
3902
+ // this template cannot instantiate rules that can never fire. See
3903
+ // highflame-shield#386; restore them when the detector is re-enabled.
3926
3904
  //
3927
3905
  // Tier 2 — ML classifiers (require Highflame API token)
3928
3906
  // injection_score, jailbreak_score
@@ -3947,36 +3925,6 @@ const AGENT_OPS_SEMANTIC_DEFAULTS_CEDAR = `// ==================================
3947
3925
  // Tier 1: Pattern-based injection detection
3948
3926
  // ---------------------------------------------------------------------------
3949
3927
 
3950
- @id("semantic.block-command-injection-tool")
3951
- @name("Block command injection in tool calls")
3952
- @description("Blocks call_tool when detected_threats contains \\"command_injection\\".")
3953
- @severity("critical")
3954
- @tags("category:semantic,threat:command-injection,detection:pattern,surface:call-tool,mitre:t1059,owasp:asi02")
3955
- @reject_message("Tool execution blocked: command injection pattern detected — reverse shell, destructive command, or privilege escalation.")
3956
- forbid (
3957
- principal,
3958
- action == AgentOps::Action::"call_tool",
3959
- resource
3960
- )
3961
- when {
3962
- context has detected_threats && context.detected_threats.contains("command_injection")
3963
- };
3964
-
3965
- @id("semantic.block-command-injection-prompt")
3966
- @name("Block command injection in prompts")
3967
- @description("Blocks process_prompt when detected_threats contains \\"command_injection\\".")
3968
- @severity("critical")
3969
- @tags("category:semantic,threat:command-injection,detection:pattern,surface:process-prompt,mitre:t1059")
3970
- @reject_message("Prompt blocked: command injection pattern detected.")
3971
- forbid (
3972
- principal,
3973
- action == AgentOps::Action::"process_prompt",
3974
- resource
3975
- )
3976
- when {
3977
- context has detected_threats && context.detected_threats.contains("command_injection")
3978
- };
3979
-
3980
3928
  @id("semantic.block-sql-injection-tool")
3981
3929
  @name("Block SQL injection in tool calls")
3982
3930
  @description("Blocks call_tool when detected_threats contains \\"sql_injection\\".")
@@ -4690,11 +4638,11 @@ export const AGENT_OPS_TEMPLATES = [
4690
4638
  {
4691
4639
  id: 'security.patterns',
4692
4640
  name: 'Security Pattern Detection',
4693
- description: 'Block command injection, path traversal, and SQL injection using regex-based pattern detection.',
4641
+ description: 'Block path traversal and SQL injection using regex-based pattern detection.',
4694
4642
  category: 'threat-detection',
4695
4643
  cedarText: AGENT_OPS_SECURITY_PATTERNS_CEDAR,
4696
- severity: 'critical',
4697
- tags: ['category:security', 'threat:command-injection', 'threat:sql-injection', 'threat:path-traversal', 'detection:pattern', 'mitre:t1059'],
4644
+ severity: 'high',
4645
+ tags: ['category:security', 'threat:sql-injection', 'threat:path-traversal', 'detection:pattern'],
4698
4646
  },
4699
4647
  {
4700
4648
  id: 'trust-safety.semantic',
@@ -4924,7 +4872,7 @@ export const AGENT_OPS_TEMPLATES = [
4924
4872
  {
4925
4873
  id: 'semantic.defaults',
4926
4874
  name: 'Semantic Threat Detection',
4927
- description: 'Block injection attacks (command, SQL, path, encoded) plus ML-detected prompt injection and jailbreak attempts.',
4875
+ description: 'Block injection attacks (SQL, path, encoded) plus ML-detected prompt injection and jailbreak attempts.',
4928
4876
  category: 'threat-detection',
4929
4877
  cedarText: AGENT_OPS_SEMANTIC_DEFAULTS_CEDAR,
4930
4878
  severity: 'critical',
@@ -5251,17 +5199,15 @@ export const AGENT_OPS_TEMPLATES_JSON = `{
5251
5199
  {
5252
5200
  "id": "security.patterns",
5253
5201
  "name": "Security Pattern Detection",
5254
- "description": "Block command injection, path traversal, and SQL injection using regex-based pattern detection.",
5202
+ "description": "Block path traversal and SQL injection using regex-based pattern detection.",
5255
5203
  "category": "threat-detection",
5256
5204
  "file": "ported/threat-detection/security_patterns.cedar",
5257
- "severity": "critical",
5205
+ "severity": "high",
5258
5206
  "tags": [
5259
5207
  "category:security",
5260
- "threat:command-injection",
5261
5208
  "threat:sql-injection",
5262
5209
  "threat:path-traversal",
5263
- "detection:pattern",
5264
- "mitre:t1059"
5210
+ "detection:pattern"
5265
5211
  ]
5266
5212
  },
5267
5213
  {
@@ -5610,7 +5556,7 @@ export const AGENT_OPS_TEMPLATES_JSON = `{
5610
5556
  {
5611
5557
  "id": "semantic.defaults",
5612
5558
  "name": "Semantic Threat Detection",
5613
- "description": "Block injection attacks (command, SQL, path, encoded) plus ML-detected prompt injection and jailbreak attempts.",
5559
+ "description": "Block injection attacks (SQL, path, encoded) plus ML-detected prompt injection and jailbreak attempts.",
5614
5560
  "category": "threat-detection",
5615
5561
  "file": "ported/threat-detection/semantic_defaults.cedar",
5616
5562
  "severity": "critical",
@@ -168,7 +168,6 @@ const AI_GATEWAY_TOOLS_DEFAULTS_CEDAR = `// ====================================
168
168
  // - Computed risk score (tool_risk_score)
169
169
  // - Detector category labels (tool_category, tool_is_sensitive)
170
170
  // - Threat aggregation (threat_count, max_threat_severity)
171
- // - Detection rule triggers (detected_threats)
172
171
  //
173
172
  // Context keys consumed:
174
173
  // - tool_risk_score: Long (0-100)
@@ -176,11 +175,9 @@ const AI_GATEWAY_TOOLS_DEFAULTS_CEDAR = `// ====================================
176
175
  // - tool_is_sensitive: Bool
177
176
  // - threat_count: Long
178
177
  // - max_threat_severity: Long (0-4)
179
- // - detected_threats: Set<String>
180
178
  //
181
179
  // Compliance:
182
180
  // - OWASP LLM06, OWASP ASI02
183
- // - MITRE T1059
184
181
  //
185
182
  // Category: tools
186
183
  // Namespace: AIGateway
@@ -248,20 +245,9 @@ when {
248
245
  context.threat_count >= 1 && context.max_threat_severity >= 3
249
246
  };
250
247
 
251
- @id("tools.block-command-injection")
252
- @name("Block command injection")
253
- @description("Blocks call_tool when detected_threats contains \\"command_injection\\".")
254
- @severity("critical")
255
- @tags("category:tools,threat:command-injection,detection:rule,surface:call-tool,mitre:t1059,owasp:asi02")
256
- @reject_message("Tool execution blocked: command injection pattern detected in tool arguments.")
257
- forbid (
258
- principal,
259
- action == AIGateway::Action::"call_tool",
260
- resource
261
- )
262
- when {
263
- context has detected_threats && context.detected_threats.contains("command_injection")
264
- };
248
+ // The command-injection rule was removed while that detector is disabled, so
249
+ // this template cannot instantiate a rule that can never fire. See
250
+ // highflame-shield#386; restore it when the detector is re-enabled.
265
251
  `;
266
252
  const AI_GATEWAY_AGENT_SECURITY_DEFAULTS_CEDAR = `// =============================================================================
267
253
  // Agent Security (Default)
@@ -1411,11 +1397,11 @@ export const AI_GATEWAY_TEMPLATES = [
1411
1397
  {
1412
1398
  id: 'tools.defaults',
1413
1399
  name: 'Tool Permissioning',
1414
- description: 'Enforce tool risk scoring, block dangerous tools, and detect command injection in MCP tool arguments.',
1400
+ description: 'Enforce tool risk scoring and block dangerous tools in MCP tool arguments.',
1415
1401
  category: 'tools',
1416
1402
  cedarText: AI_GATEWAY_TOOLS_DEFAULTS_CEDAR,
1417
1403
  severity: 'critical',
1418
- tags: ['category:tools', 'threat:command-injection', 'owasp:llm06', 'owasp:asi02'],
1404
+ tags: ['category:tools', 'owasp:llm06', 'owasp:asi02'],
1419
1405
  },
1420
1406
  {
1421
1407
  id: 'agent-security.defaults',
@@ -1571,13 +1557,12 @@ export const AI_GATEWAY_TEMPLATES_JSON = `{
1571
1557
  {
1572
1558
  "id": "tools.defaults",
1573
1559
  "name": "Tool Permissioning",
1574
- "description": "Enforce tool risk scoring, block dangerous tools, and detect command injection in MCP tool arguments.",
1560
+ "description": "Enforce tool risk scoring and block dangerous tools in MCP tool arguments.",
1575
1561
  "category": "tools",
1576
1562
  "file": "defaults/tools.cedar",
1577
1563
  "severity": "critical",
1578
1564
  "tags": [
1579
1565
  "category:tools",
1580
- "threat:command-injection",
1581
1566
  "owasp:llm06",
1582
1567
  "owasp:asi02"
1583
1568
  ]
@@ -808,38 +808,26 @@ when {
808
808
  const GUARDRAILS_SECURITY_PATTERNS_CEDAR = `// =============================================================================
809
809
  // Security Pattern Detection (Default)
810
810
  // =============================================================================
811
- // Blocks command injection, path traversal, and SQL injection using
812
- // regex-based pattern detection from Shield's security detectors.
811
+ // Blocks path traversal and SQL injection using regex-based pattern detection
812
+ // from Shield's security detectors.
813
+ //
814
+ // The command-injection rule was removed while that detector is disabled, so
815
+ // this template cannot instantiate a rule that can never fire. See
816
+ // highflame-shield#386; restore the rule when the detector is re-enabled.
813
817
  //
814
818
  // Context keys consumed:
815
- // - command_injection_detected: Bool
816
819
  // - path_traversal_detected: Bool
817
820
  // - path_traversal_severity: String
818
821
  // - sql_injection_detected: Bool
819
822
  // - sql_injection_score: Long (0-100)
820
823
  //
821
824
  // Compliance:
822
- // - MITRE T1059 (Command Injection), T1005 (Data from Local System)
825
+ // - MITRE T1005 (Data from Local System)
823
826
  //
824
827
  // Category: security
825
828
  // Namespace: Guardrails
826
829
  // =============================================================================
827
830
 
828
- @id("security.block-command-injection")
829
- @name("Block command injection")
830
- @description("Blocks process_prompt and call_tool when command_injection_detected is true.")
831
- @severity("critical")
832
- @tags("category:security,threat:command-injection,detection:pattern,mitre:t1059")
833
- @reject_message("Request blocked: command injection pattern detected — reverse shell, destructive command, or privilege escalation.")
834
- forbid (
835
- principal,
836
- action in [Guardrails::Action::"process_prompt", Guardrails::Action::"call_tool"],
837
- resource
838
- )
839
- when {
840
- context has command_injection_detected && context.command_injection_detected == true
841
- };
842
-
843
831
  @id("security.block-path-traversal")
844
832
  @name("Block path traversal")
845
833
  @description("Blocks process_prompt, call_tool, read_file, and write_file when path_traversal_detected is true and severity is high or critical.")
@@ -2097,7 +2085,6 @@ const GUARDRAILS_AGENT_IDENTITY_MULTI_AGENT_SAFETY_CEDAR = `// =================
2097
2085
  // - agent_trust_level, agent_type, tool_name, tool_is_sensitive
2098
2086
  // - session_pii_detected, session_pii_types
2099
2087
  // - session_secrets_detected, session_injection_detected
2100
- // - session_command_injection
2101
2088
  // - session_threat_turns: Long
2102
2089
  // - session_cumulative_risk_score: Long
2103
2090
  // - suspicious_pattern: Bool
@@ -2193,22 +2180,9 @@ when {
2193
2180
  context has session_injection_detected && context.session_injection_detected == true
2194
2181
  };
2195
2182
 
2196
- @id("agent-identity.multi-agent-post-command-injection-shell")
2197
- @name("Block shell after command injection in session")
2198
- @description("Blocks call_tool when session_command_injection is true and tool_name is a shell tool.")
2199
- @severity("critical")
2200
- @tags("category:agent-identity,threat:command-injection,scope:per-agent,detection:aggregate,surface:call-tool,mitre:t1059")
2201
- @reject_message("Tool execution blocked: command injection was detected earlier in this session — no agent may execute shell commands afterwards.")
2202
- forbid (
2203
- principal is Guardrails::Agent,
2204
- action == Guardrails::Action::"call_tool",
2205
- resource
2206
- )
2207
- when {
2208
- context has session_command_injection && context.session_command_injection == true &&
2209
- context has tool_name &&
2210
- (context.tool_name == "shell" || context.tool_name == "execute_command" || context.tool_name == "bash")
2211
- };
2183
+ // The post-command-injection shell rule was removed while that detector is
2184
+ // disabled, so this template cannot instantiate a rule that can never fire.
2185
+ // See highflame-shield#386; restore it when the detector is re-enabled.
2212
2186
 
2213
2187
  // ---------------------------------------------------------------------------
2214
2188
  // Section 4: Cumulative risk circuit breakers
@@ -3464,7 +3438,7 @@ when {
3464
3438
  // CATEGORIES
3465
3439
  // =============================================================================
3466
3440
  export const GUARDRAILS_CATEGORIES = [
3467
- { id: 'security', name: 'Security', description: 'Block prompt injection, jailbreak attempts, command injection, path traversal, and SQL injection.' },
3441
+ { id: 'security', name: 'Security', description: 'Block prompt injection, jailbreak attempts, path traversal, and SQL injection.' },
3468
3442
  { id: 'privacy', name: 'Privacy', description: 'Block personally identifiable information (PII) in prompts and responses.' },
3469
3443
  { id: 'data-protection', name: 'Data Protection', description: 'Block secrets, API keys, tokens, and bulk credential exposure.' },
3470
3444
  { id: 'trust-safety', name: 'Trust & Safety', description: 'Block toxic, violent, hateful, sexual, or profane content; restrict regulated topics.' },
@@ -3577,11 +3551,11 @@ export const GUARDRAILS_TEMPLATES = [
3577
3551
  {
3578
3552
  id: 'security.patterns',
3579
3553
  name: 'Security Pattern Detection',
3580
- description: 'Block command injection, path traversal, and SQL injection using regex-based pattern detection.',
3554
+ description: 'Block path traversal and SQL injection using regex-based pattern detection.',
3581
3555
  category: 'security',
3582
3556
  cedarText: GUARDRAILS_SECURITY_PATTERNS_CEDAR,
3583
- severity: 'critical',
3584
- tags: ['category:security', 'threat:command-injection', 'threat:sql-injection', 'threat:path-traversal', 'detection:pattern', 'mitre:t1059'],
3557
+ severity: 'high',
3558
+ tags: ['category:security', 'threat:sql-injection', 'threat:path-traversal', 'detection:pattern'],
3585
3559
  },
3586
3560
  {
3587
3561
  id: 'trust-safety.semantic',
@@ -3821,7 +3795,7 @@ export const GUARDRAILS_TEMPLATES_JSON = `{
3821
3795
  {
3822
3796
  "id": "security",
3823
3797
  "name": "Security",
3824
- "description": "Block prompt injection, jailbreak attempts, command injection, path traversal, and SQL injection."
3798
+ "description": "Block prompt injection, jailbreak attempts, path traversal, and SQL injection."
3825
3799
  },
3826
3800
  {
3827
3801
  "id": "privacy",
@@ -4000,17 +3974,15 @@ export const GUARDRAILS_TEMPLATES_JSON = `{
4000
3974
  {
4001
3975
  "id": "security.patterns",
4002
3976
  "name": "Security Pattern Detection",
4003
- "description": "Block command injection, path traversal, and SQL injection using regex-based pattern detection.",
3977
+ "description": "Block path traversal and SQL injection using regex-based pattern detection.",
4004
3978
  "category": "security",
4005
3979
  "file": "defaults/security_patterns.cedar",
4006
- "severity": "critical",
3980
+ "severity": "high",
4007
3981
  "tags": [
4008
3982
  "category:security",
4009
- "threat:command-injection",
4010
3983
  "threat:sql-injection",
4011
3984
  "threat:path-traversal",
4012
- "detection:pattern",
4013
- "mitre:t1059"
3985
+ "detection:pattern"
4014
3986
  ]
4015
3987
  },
4016
3988
  {
@@ -239,11 +239,15 @@ when { context has secrets_detected && context.secrets_detected == true };
239
239
  const OVERWATCH_SEMANTIC_DEFAULTS_CEDAR = `// =============================================================================
240
240
  // Semantic Threat Detection (Default)
241
241
  // =============================================================================
242
- // Blocks injection attacks (command, SQL, path traversal), prompt injection,
243
- // jailbreak attempts, and encoded payloads using two detection tiers:
242
+ // Blocks injection attacks (SQL, path traversal), prompt injection, jailbreak
243
+ // attempts, and encoded payloads using two detection tiers:
244
244
  //
245
245
  // Tier 1 — Pattern-based (always available, no external dependency)
246
- // command_injection, sql_injection, path_traversal, detect_encoded
246
+ // sql_injection, path_traversal, detect_encoded
247
+ //
248
+ // The command-injection rules were removed while that detector is disabled, so
249
+ // this template cannot instantiate rules that can never fire. See
250
+ // highflame-shield#386; restore them when the detector is re-enabled.
247
251
  //
248
252
  // Tier 2 — ML classifiers (require Highflame API token)
249
253
  // injection_score, jailbreak_score
@@ -268,36 +272,6 @@ const OVERWATCH_SEMANTIC_DEFAULTS_CEDAR = `// ==================================
268
272
  // Tier 1: Pattern-based injection detection
269
273
  // ---------------------------------------------------------------------------
270
274
 
271
- @id("semantic.block-command-injection-tool")
272
- @name("Block command injection in tool calls")
273
- @description("Blocks call_tool when detected_threats contains \\"command_injection\\".")
274
- @severity("critical")
275
- @tags("category:semantic,threat:command-injection,detection:pattern,surface:call-tool,mitre:t1059,owasp:asi02")
276
- @reject_message("Tool execution blocked: command injection pattern detected — reverse shell, destructive command, or privilege escalation.")
277
- forbid (
278
- principal,
279
- action == Overwatch::Action::"call_tool",
280
- resource
281
- )
282
- when {
283
- context has detected_threats && context.detected_threats.contains("command_injection")
284
- };
285
-
286
- @id("semantic.block-command-injection-prompt")
287
- @name("Block command injection in prompts")
288
- @description("Blocks process_prompt when detected_threats contains \\"command_injection\\".")
289
- @severity("critical")
290
- @tags("category:semantic,threat:command-injection,detection:pattern,surface:process-prompt,mitre:t1059")
291
- @reject_message("Prompt blocked: command injection pattern detected.")
292
- forbid (
293
- principal,
294
- action == Overwatch::Action::"process_prompt",
295
- resource
296
- )
297
- when {
298
- context has detected_threats && context.detected_threats.contains("command_injection")
299
- };
300
-
301
275
  @id("semantic.block-sql-injection-tool")
302
276
  @name("Block SQL injection in tool calls")
303
277
  @description("Blocks call_tool when detected_threats contains \\"sql_injection\\".")
@@ -1851,7 +1825,7 @@ when {
1851
1825
  export const OVERWATCH_CATEGORIES = [
1852
1826
  { id: 'data-protection', name: 'Secrets & Data Protection', description: 'Block credential leakage and protect sensitive file paths.' },
1853
1827
  { id: 'privacy', name: 'PII Detection', description: 'Block personally identifiable information across prompts, tool calls, and file operations.' },
1854
- { id: 'semantic', name: 'Semantic Threat Detection', description: 'Block injection attacks (command, SQL, path traversal, encoded), prompt injection, and jailbreak attempts.' },
1828
+ { id: 'semantic', name: 'Semantic Threat Detection', description: 'Block injection attacks (SQL, path traversal, encoded), prompt injection, and jailbreak attempts.' },
1855
1829
  { id: 'trust-safety', name: 'Content Safety', description: 'Block violent, hateful, sexual, criminal, or excessively profane content.' },
1856
1830
  { id: 'tools', name: 'Tool Permissioning', description: 'Control shell execution, file operations, MCP servers, and sensitive system paths.' },
1857
1831
  { id: 'agent-identity', name: 'Agent-Specific Guardrails', description: 'Per-agent security policies applied based on agent identity.' },
@@ -1908,7 +1882,7 @@ export const OVERWATCH_TEMPLATES = [
1908
1882
  {
1909
1883
  id: 'semantic.defaults',
1910
1884
  name: 'Semantic Threat Detection',
1911
- description: 'Block injection attacks (command, SQL, path, encoded) plus ML-detected prompt injection and jailbreak attempts.',
1885
+ description: 'Block injection attacks (SQL, path, encoded) plus ML-detected prompt injection and jailbreak attempts.',
1912
1886
  category: 'semantic',
1913
1887
  cedarText: OVERWATCH_SEMANTIC_DEFAULTS_CEDAR,
1914
1888
  severity: 'critical',
@@ -2072,7 +2046,7 @@ export const OVERWATCH_TEMPLATES_JSON = `{
2072
2046
  {
2073
2047
  "id": "semantic",
2074
2048
  "name": "Semantic Threat Detection",
2075
- "description": "Block injection attacks (command, SQL, path traversal, encoded), prompt injection, and jailbreak attempts."
2049
+ "description": "Block injection attacks (SQL, path traversal, encoded), prompt injection, and jailbreak attempts."
2076
2050
  },
2077
2051
  {
2078
2052
  "id": "trust-safety",
@@ -2159,7 +2133,7 @@ export const OVERWATCH_TEMPLATES_JSON = `{
2159
2133
  {
2160
2134
  "id": "semantic.defaults",
2161
2135
  "name": "Semantic Threat Detection",
2162
- "description": "Block injection attacks (command, SQL, path, encoded) plus ML-detected prompt injection and jailbreak attempts.",
2136
+ "description": "Block injection attacks (SQL, path, encoded) plus ML-detected prompt injection and jailbreak attempts.",
2163
2137
  "category": "semantic",
2164
2138
  "file": "defaults/semantic.cedar",
2165
2139
  "severity": "critical",
@@ -2,7 +2,7 @@
2
2
  * Sentry policy category identifiers.
3
3
  * Maps to UI tab names in Studio.
4
4
  */
5
- export type SentryCategory = 'data-protection' | 'privacy' | 'semantic' | 'trust-safety' | 'file-safety' | 'clipboard' | 'organization';
5
+ export type SentryCategory = 'data-protection' | 'privacy' | 'semantic' | 'trust-safety' | 'clipboard' | 'organization';
6
6
  /**
7
7
  * Category metadata for UI display.
8
8
  */
@@ -1110,38 +1110,6 @@ when {
1110
1110
  )
1111
1111
  };
1112
1112
  `;
1113
- const SENTRY_FILE_SAFETY_BLOCK_UPLOAD_SECRETS_CEDAR = `// =============================================================================
1114
- // File & Attachment Safety (Default)
1115
- // =============================================================================
1116
- // Blocks file uploads to AI chat services when document content contains
1117
- // secrets. PII in uploads is handled by the canonical privacy.* templates
1118
- // (defaults/pii*.cedar), which scope to upload_file.
1119
- //
1120
- // Context keys consumed:
1121
- // - secrets_detected: Bool
1122
- //
1123
- // Compliance:
1124
- // - NIST 800-53 SC-28; GDPR Art. 32
1125
- //
1126
- // Category: file-safety
1127
- // Namespace: Sentry
1128
- // =============================================================================
1129
-
1130
- @id("file-safety.block-upload-secrets")
1131
- @name("Block file uploads with secrets")
1132
- @description("Blocks upload_file when secrets_detected is true.")
1133
- @severity("critical")
1134
- @tags("category:file-safety,threat:secrets,detection:rule,surface:upload-file,owasp:llm06")
1135
- @reject_message("File upload blocked: secrets or credentials detected in document content.")
1136
- forbid (
1137
- principal,
1138
- action == Sentry::Action::"upload_file",
1139
- resource
1140
- )
1141
- when {
1142
- context has secrets_detected && context.secrets_detected == true
1143
- };
1144
- `;
1145
1113
  const SENTRY_CLIPBOARD_DEFAULTS_CEDAR = `// =============================================================================
1146
1114
  // Clipboard Policy (Default)
1147
1115
  // =============================================================================
@@ -1263,7 +1231,6 @@ export const SENTRY_CATEGORIES = [
1263
1231
  { id: 'privacy', name: 'PII Detection', description: 'Block personally identifiable information across messages and uploads.' },
1264
1232
  { id: 'semantic', name: 'Semantic Threat Detection', description: 'Block prompt injection, jailbreak attempts, and high-severity threats.' },
1265
1233
  { id: 'trust-safety', name: 'Content Safety', description: 'Block violent, harmful, hateful, sexual, or profane content.' },
1266
- { id: 'file-safety', name: 'File & Attachment Safety', description: 'Block file uploads containing secrets or PII.' },
1267
1234
  { id: 'clipboard', name: 'Clipboard Policy', description: 'Control paste operations into AI chat services.' },
1268
1235
  { id: 'organization', name: 'Organization Rules', description: 'Organization-wide baselines and session-aware threat escalation.' },
1269
1236
  ];
@@ -1350,15 +1317,6 @@ export const SENTRY_TEMPLATES = [
1350
1317
  severity: 'critical',
1351
1318
  tags: ['category:privacy', 'threat:pii', 'detection:pattern', 'compliance:pci-dss', 'compliance:hipaa'],
1352
1319
  },
1353
- {
1354
- id: 'file-safety.block-upload-secrets',
1355
- name: 'File & Attachment Safety',
1356
- description: 'Block file uploads containing secrets in document content.',
1357
- category: 'file-safety',
1358
- cedarText: SENTRY_FILE_SAFETY_BLOCK_UPLOAD_SECRETS_CEDAR,
1359
- severity: 'critical',
1360
- tags: ['category:file-safety', 'threat:secrets'],
1361
- },
1362
1320
  {
1363
1321
  id: 'clipboard.defaults',
1364
1322
  name: 'Clipboard Policy',
@@ -1407,11 +1365,6 @@ export const SENTRY_TEMPLATES_JSON = `{
1407
1365
  "name": "Content Safety",
1408
1366
  "description": "Block violent, harmful, hateful, sexual, or profane content."
1409
1367
  },
1410
- {
1411
- "id": "file-safety",
1412
- "name": "File & Attachment Safety",
1413
- "description": "Block file uploads containing secrets or PII."
1414
- },
1415
1368
  {
1416
1369
  "id": "clipboard",
1417
1370
  "name": "Clipboard Policy",
@@ -1530,15 +1483,6 @@ export const SENTRY_TEMPLATES_JSON = `{
1530
1483
  "compliance:hipaa"
1531
1484
  ]
1532
1485
  },
1533
- {
1534
- "id": "file-safety.block-upload-secrets",
1535
- "name": "File & Attachment Safety",
1536
- "description": "Block file uploads containing secrets in document content.",
1537
- "category": "file-safety",
1538
- "file": "defaults/file_safety.cedar",
1539
- "severity": "critical",
1540
- "tags": ["category:file-safety", "threat:secrets"]
1541
- },
1542
1486
  {
1543
1487
  "id": "clipboard.defaults",
1544
1488
  "name": "Clipboard Policy",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@highflame/policy",
3
- "version": "2.2.34",
3
+ "version": "2.2.35",
4
4
  "engines": {
5
5
  "node": ">=18"
6
6
  },
@@ -1,31 +0,0 @@
1
- // =============================================================================
2
- // File & Attachment Safety (Default)
3
- // =============================================================================
4
- // Blocks file uploads to AI chat services when document content contains
5
- // secrets. PII in uploads is handled by the canonical privacy.* templates
6
- // (defaults/pii*.cedar), which scope to upload_file.
7
- //
8
- // Context keys consumed:
9
- // - secrets_detected: Bool
10
- //
11
- // Compliance:
12
- // - NIST 800-53 SC-28; GDPR Art. 32
13
- //
14
- // Category: file-safety
15
- // Namespace: Sentry
16
- // =============================================================================
17
-
18
- @id("file-safety.block-upload-secrets")
19
- @name("Block file uploads with secrets")
20
- @description("Blocks upload_file when secrets_detected is true.")
21
- @severity("critical")
22
- @tags("category:file-safety,threat:secrets,detection:rule,surface:upload-file,owasp:llm06")
23
- @reject_message("File upload blocked: secrets or credentials detected in document content.")
24
- forbid (
25
- principal,
26
- action == Sentry::Action::"upload_file",
27
- resource
28
- )
29
- when {
30
- context has secrets_detected && context.secrets_detected == true
31
- };