@highflame/policy 2.2.33 → 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.
- package/_schemas/agent_ops/templates/ported/agent-security/agent_identity_multi_agent_safety.cedar +3 -17
- package/_schemas/agent_ops/templates/ported/threat-detection/security_patterns.cedar +7 -19
- package/_schemas/agent_ops/templates/ported/threat-detection/semantic_defaults.cedar +7 -33
- package/_schemas/agent_ops/templates/templates.json +4 -6
- package/_schemas/ai_gateway/templates/defaults/tools.cedar +3 -17
- package/_schemas/ai_gateway/templates/templates.json +1 -2
- package/_schemas/guardrails/templates/defaults/security_patterns.cedar +7 -19
- package/_schemas/guardrails/templates/profiles/multi_agent/agent_safety.cedar +3 -17
- package/_schemas/guardrails/templates/templates.json +4 -6
- package/_schemas/overwatch/context.json +222 -0
- package/_schemas/overwatch/schema.cedarschema +72 -0
- package/_schemas/sentry/templates/templates.json +0 -14
- package/dist/aarm-annotation.d.ts +18 -0
- package/dist/aarm-annotation.js +36 -1
- package/dist/aarm-annotations.gen.js +21 -0
- package/dist/agent_ops-defaults.gen.js +25 -79
- package/dist/ai_gateway-defaults.gen.js +6 -21
- package/dist/ai_gateway-detectors.gen.js +2 -2
- package/dist/guardrails-defaults.gen.js +18 -46
- package/dist/guardrails-detectors.gen.js +2 -2
- package/dist/overwatch-context.gen.d.ts +2 -1
- package/dist/overwatch-context.gen.js +2 -0
- package/dist/overwatch-defaults.gen.js +105 -42
- package/dist/overwatch-detectors.gen.js +2 -2
- package/dist/overwatch-entities.gen.js +5 -1
- package/dist/sentry-defaults.gen.d.ts +1 -1
- package/dist/sentry-defaults.gen.js +0 -56
- package/dist/sentry-detectors.gen.js +2 -2
- package/dist/service-schemas.gen.d.ts +1 -1
- package/dist/service-schemas.gen.js +114 -0
- package/package.json +1 -1
- package/_schemas/sentry/templates/defaults/file_safety.cedar +0 -31
package/_schemas/agent_ops/templates/ported/agent-security/agent_identity_multi_agent_safety.cedar
CHANGED
|
@@ -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
|
-
|
|
110
|
-
|
|
111
|
-
|
|
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
|
|
5
|
-
//
|
|
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
|
|
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 (
|
|
5
|
-
//
|
|
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
|
-
//
|
|
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
|
|
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": "
|
|
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 (
|
|
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
|
-
|
|
92
|
-
|
|
93
|
-
|
|
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
|
|
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
|
|
5
|
-
//
|
|
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
|
|
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
|
-
|
|
110
|
-
|
|
111
|
-
|
|
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,
|
|
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
|
|
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": "
|
|
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
|
{
|
|
@@ -827,6 +827,228 @@
|
|
|
827
827
|
}
|
|
828
828
|
]
|
|
829
829
|
},
|
|
830
|
+
{
|
|
831
|
+
"name": "post_tool_call",
|
|
832
|
+
"description": "Inspect the output of a tool that has already run. The tool has run, so enforcement is limited to rewriting or withholding what the model sees.",
|
|
833
|
+
"context_attributes": [
|
|
834
|
+
{
|
|
835
|
+
"key": "role",
|
|
836
|
+
"type": "string",
|
|
837
|
+
"required": false,
|
|
838
|
+
"description": "role projected for the post_tool_call surface."
|
|
839
|
+
},
|
|
840
|
+
{
|
|
841
|
+
"key": "privilege_scope",
|
|
842
|
+
"type": "array",
|
|
843
|
+
"required": false,
|
|
844
|
+
"description": "privilege_scope projected for the post_tool_call surface."
|
|
845
|
+
},
|
|
846
|
+
{
|
|
847
|
+
"key": "content",
|
|
848
|
+
"type": "string",
|
|
849
|
+
"required": true,
|
|
850
|
+
"description": "The tool's OUTPUT (stdout+stderr, or serialized response)"
|
|
851
|
+
},
|
|
852
|
+
{
|
|
853
|
+
"key": "source",
|
|
854
|
+
"type": "string",
|
|
855
|
+
"required": true,
|
|
856
|
+
"description": "IDE source"
|
|
857
|
+
},
|
|
858
|
+
{
|
|
859
|
+
"key": "event",
|
|
860
|
+
"type": "string",
|
|
861
|
+
"required": true,
|
|
862
|
+
"description": "Hook event name"
|
|
863
|
+
},
|
|
864
|
+
{
|
|
865
|
+
"key": "user_email",
|
|
866
|
+
"type": "string",
|
|
867
|
+
"required": true,
|
|
868
|
+
"description": "User identifier"
|
|
869
|
+
},
|
|
870
|
+
{
|
|
871
|
+
"key": "tool_name",
|
|
872
|
+
"type": "string",
|
|
873
|
+
"required": false,
|
|
874
|
+
"description": "tool_name projected for the post_tool_call surface."
|
|
875
|
+
},
|
|
876
|
+
{
|
|
877
|
+
"key": "mcp_server",
|
|
878
|
+
"type": "string",
|
|
879
|
+
"required": false,
|
|
880
|
+
"description": "mcp_server projected for the post_tool_call surface."
|
|
881
|
+
},
|
|
882
|
+
{
|
|
883
|
+
"key": "mcp_tool",
|
|
884
|
+
"type": "string",
|
|
885
|
+
"required": false,
|
|
886
|
+
"description": "mcp_tool projected for the post_tool_call surface."
|
|
887
|
+
},
|
|
888
|
+
{
|
|
889
|
+
"key": "exit_code",
|
|
890
|
+
"type": "number",
|
|
891
|
+
"required": false,
|
|
892
|
+
"description": "Absent when the IDE does not propagate it"
|
|
893
|
+
},
|
|
894
|
+
{
|
|
895
|
+
"key": "path",
|
|
896
|
+
"type": "string",
|
|
897
|
+
"required": false,
|
|
898
|
+
"description": "path projected for the post_tool_call surface."
|
|
899
|
+
},
|
|
900
|
+
{
|
|
901
|
+
"key": "cwd",
|
|
902
|
+
"type": "string",
|
|
903
|
+
"required": false,
|
|
904
|
+
"description": "cwd projected for the post_tool_call surface."
|
|
905
|
+
},
|
|
906
|
+
{
|
|
907
|
+
"key": "workspace_root",
|
|
908
|
+
"type": "string",
|
|
909
|
+
"required": false,
|
|
910
|
+
"description": "workspace_root projected for the post_tool_call surface."
|
|
911
|
+
},
|
|
912
|
+
{
|
|
913
|
+
"key": "threat_count",
|
|
914
|
+
"type": "number",
|
|
915
|
+
"required": false,
|
|
916
|
+
"description": "threat_count projected for the post_tool_call surface."
|
|
917
|
+
},
|
|
918
|
+
{
|
|
919
|
+
"key": "highest_severity",
|
|
920
|
+
"type": "string",
|
|
921
|
+
"required": false,
|
|
922
|
+
"description": "highest_severity projected for the post_tool_call surface."
|
|
923
|
+
},
|
|
924
|
+
{
|
|
925
|
+
"key": "threat_categories",
|
|
926
|
+
"type": "array",
|
|
927
|
+
"required": false,
|
|
928
|
+
"description": "threat_categories projected for the post_tool_call surface."
|
|
929
|
+
},
|
|
930
|
+
{
|
|
931
|
+
"key": "detected_threats",
|
|
932
|
+
"type": "array",
|
|
933
|
+
"required": false,
|
|
934
|
+
"description": "detected_threats projected for the post_tool_call surface."
|
|
935
|
+
},
|
|
936
|
+
{
|
|
937
|
+
"key": "max_threat_severity",
|
|
938
|
+
"type": "number",
|
|
939
|
+
"required": false,
|
|
940
|
+
"description": "max_threat_severity projected for the post_tool_call surface."
|
|
941
|
+
},
|
|
942
|
+
{
|
|
943
|
+
"key": "secrets_detected",
|
|
944
|
+
"type": "boolean",
|
|
945
|
+
"required": false,
|
|
946
|
+
"description": "secrets_detected projected for the post_tool_call surface."
|
|
947
|
+
},
|
|
948
|
+
{
|
|
949
|
+
"key": "secret_types",
|
|
950
|
+
"type": "array",
|
|
951
|
+
"required": false,
|
|
952
|
+
"description": "secret_types projected for the post_tool_call surface."
|
|
953
|
+
},
|
|
954
|
+
{
|
|
955
|
+
"key": "secret_count",
|
|
956
|
+
"type": "number",
|
|
957
|
+
"required": false,
|
|
958
|
+
"description": "secret_count projected for the post_tool_call surface."
|
|
959
|
+
},
|
|
960
|
+
{
|
|
961
|
+
"key": "pii_detected",
|
|
962
|
+
"type": "boolean",
|
|
963
|
+
"required": false,
|
|
964
|
+
"description": "pii_detected projected for the post_tool_call surface."
|
|
965
|
+
},
|
|
966
|
+
{
|
|
967
|
+
"key": "pii_types",
|
|
968
|
+
"type": "array",
|
|
969
|
+
"required": false,
|
|
970
|
+
"description": "pii_types projected for the post_tool_call surface."
|
|
971
|
+
},
|
|
972
|
+
{
|
|
973
|
+
"key": "pii_count",
|
|
974
|
+
"type": "number",
|
|
975
|
+
"required": false,
|
|
976
|
+
"description": "pii_count projected for the post_tool_call surface."
|
|
977
|
+
},
|
|
978
|
+
{
|
|
979
|
+
"key": "pii_score",
|
|
980
|
+
"type": "number",
|
|
981
|
+
"required": false,
|
|
982
|
+
"description": "pii_score projected for the post_tool_call surface."
|
|
983
|
+
},
|
|
984
|
+
{
|
|
985
|
+
"key": "indirect_injection_score",
|
|
986
|
+
"type": "number",
|
|
987
|
+
"required": false,
|
|
988
|
+
"description": "indirect_injection_score projected for the post_tool_call surface."
|
|
989
|
+
},
|
|
990
|
+
{
|
|
991
|
+
"key": "invisible_chars_detected",
|
|
992
|
+
"type": "boolean",
|
|
993
|
+
"required": false,
|
|
994
|
+
"description": "invisible_chars_detected projected for the post_tool_call surface."
|
|
995
|
+
},
|
|
996
|
+
{
|
|
997
|
+
"key": "invisible_chars_score",
|
|
998
|
+
"type": "number",
|
|
999
|
+
"required": false,
|
|
1000
|
+
"description": "invisible_chars_score projected for the post_tool_call surface."
|
|
1001
|
+
},
|
|
1002
|
+
{
|
|
1003
|
+
"key": "session_pii_detected",
|
|
1004
|
+
"type": "boolean",
|
|
1005
|
+
"required": false,
|
|
1006
|
+
"description": "session_pii_detected projected for the post_tool_call surface."
|
|
1007
|
+
},
|
|
1008
|
+
{
|
|
1009
|
+
"key": "session_pii_types",
|
|
1010
|
+
"type": "array",
|
|
1011
|
+
"required": false,
|
|
1012
|
+
"description": "session_pii_types projected for the post_tool_call surface."
|
|
1013
|
+
},
|
|
1014
|
+
{
|
|
1015
|
+
"key": "session_secrets_detected",
|
|
1016
|
+
"type": "boolean",
|
|
1017
|
+
"required": false,
|
|
1018
|
+
"description": "session_secrets_detected projected for the post_tool_call surface."
|
|
1019
|
+
},
|
|
1020
|
+
{
|
|
1021
|
+
"key": "session_secret_types",
|
|
1022
|
+
"type": "array",
|
|
1023
|
+
"required": false,
|
|
1024
|
+
"description": "session_secret_types projected for the post_tool_call surface."
|
|
1025
|
+
},
|
|
1026
|
+
{
|
|
1027
|
+
"key": "session_threat_turns",
|
|
1028
|
+
"type": "number",
|
|
1029
|
+
"required": false,
|
|
1030
|
+
"description": "session_threat_turns projected for the post_tool_call surface."
|
|
1031
|
+
},
|
|
1032
|
+
{
|
|
1033
|
+
"key": "session_max_secret_score",
|
|
1034
|
+
"type": "number",
|
|
1035
|
+
"required": false,
|
|
1036
|
+
"description": "session_max_secret_score projected for the post_tool_call surface."
|
|
1037
|
+
},
|
|
1038
|
+
{
|
|
1039
|
+
"key": "session_max_pii_score",
|
|
1040
|
+
"type": "number",
|
|
1041
|
+
"required": false,
|
|
1042
|
+
"description": "session_max_pii_score projected for the post_tool_call surface."
|
|
1043
|
+
},
|
|
1044
|
+
{
|
|
1045
|
+
"key": "session_cumulative_risk_score",
|
|
1046
|
+
"type": "number",
|
|
1047
|
+
"required": false,
|
|
1048
|
+
"description": "session_cumulative_risk_score projected for the post_tool_call surface."
|
|
1049
|
+
}
|
|
1050
|
+
]
|
|
1051
|
+
},
|
|
830
1052
|
{
|
|
831
1053
|
"name": "connect_server",
|
|
832
1054
|
"description": "Connect to an MCP server",
|
|
@@ -266,6 +266,78 @@ action call_tool appliesTo {
|
|
|
266
266
|
},
|
|
267
267
|
};
|
|
268
268
|
|
|
269
|
+
// Inspect the OUTPUT of a tool that has already run.
|
|
270
|
+
// Threat focus: a credential or PII printed by a tool entering the agent's
|
|
271
|
+
// context. The tool has run, so a permission verdict is meaningless here — the
|
|
272
|
+
// only enforcement available is rewriting or withholding what the model sees,
|
|
273
|
+
// which is why transform rules (@redaction_strategy) are the point of this
|
|
274
|
+
// action. Context is deliberately narrower than call_tool: pre-execution
|
|
275
|
+
// signals (tool risk, loop, sequence) belong to the call, not its result.
|
|
276
|
+
action post_tool_call appliesTo {
|
|
277
|
+
principal: [User, Agent],
|
|
278
|
+
resource: [Tool, FilePath, LlmPrompt],
|
|
279
|
+
context: {
|
|
280
|
+
// Identity (AARM R6 / CAP-IDN-011) — projected from the principal's token; optional.
|
|
281
|
+
role?: String,
|
|
282
|
+
privilege_scope?: Set<String>,
|
|
283
|
+
// --- Event & Source ---
|
|
284
|
+
content: String, // The tool's OUTPUT (stdout+stderr, or serialized response)
|
|
285
|
+
source: String, // IDE source
|
|
286
|
+
event: String, // Hook event name
|
|
287
|
+
user_email: String, // User identifier
|
|
288
|
+
|
|
289
|
+
// --- Tool & MCP ---
|
|
290
|
+
tool_name?: String,
|
|
291
|
+
mcp_server?: String,
|
|
292
|
+
mcp_tool?: String,
|
|
293
|
+
|
|
294
|
+
// --- Result ---
|
|
295
|
+
exit_code?: Long, // Absent when the IDE does not propagate it
|
|
296
|
+
|
|
297
|
+
// --- File & Path ---
|
|
298
|
+
path?: String,
|
|
299
|
+
|
|
300
|
+
// --- Workspace ---
|
|
301
|
+
cwd?: String,
|
|
302
|
+
workspace_root?: String,
|
|
303
|
+
|
|
304
|
+
// --- Threat Detection ---
|
|
305
|
+
threat_count?: Long,
|
|
306
|
+
highest_severity?: String,
|
|
307
|
+
threat_categories?: Set<String>,
|
|
308
|
+
detected_threats?: Set<String>,
|
|
309
|
+
max_threat_severity?: Long,
|
|
310
|
+
|
|
311
|
+
// --- Secrets --- the primary signal for this surface
|
|
312
|
+
secrets_detected?: Bool,
|
|
313
|
+
secret_types?: Set<String>,
|
|
314
|
+
secret_count?: Long,
|
|
315
|
+
|
|
316
|
+
// --- PII Detection ---
|
|
317
|
+
pii_detected?: Bool,
|
|
318
|
+
pii_types?: Set<String>,
|
|
319
|
+
pii_count?: Long,
|
|
320
|
+
pii_score?: Long,
|
|
321
|
+
|
|
322
|
+
// --- Indirect injection via tool output --- (OWASP ASI01)
|
|
323
|
+
indirect_injection_score?: Long,
|
|
324
|
+
|
|
325
|
+
// --- Encoding & Unicode Attacks ---
|
|
326
|
+
invisible_chars_detected?: Bool,
|
|
327
|
+
invisible_chars_score?: Long,
|
|
328
|
+
|
|
329
|
+
// --- Session Detection History (cross-turn sticky flags) ---
|
|
330
|
+
session_pii_detected?: Bool,
|
|
331
|
+
session_pii_types?: Set<String>,
|
|
332
|
+
session_secrets_detected?: Bool,
|
|
333
|
+
session_secret_types?: Set<String>,
|
|
334
|
+
session_threat_turns?: Long,
|
|
335
|
+
session_max_secret_score?: Long,
|
|
336
|
+
session_max_pii_score?: Long,
|
|
337
|
+
session_cumulative_risk_score?: Long,
|
|
338
|
+
},
|
|
339
|
+
};
|
|
340
|
+
|
|
269
341
|
// Connect to an MCP server
|
|
270
342
|
// Threat focus: supply chain, tool poisoning, rug pull, config risk
|
|
271
343
|
action connect_server appliesTo {
|