@highflame/policy 2.2.35 → 2.2.36
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/context.json +30 -0
- package/_schemas/agent_ops/schema.cedarschema +7 -0
- package/_schemas/ai_gateway/context.json +30 -0
- package/_schemas/ai_gateway/schema.cedarschema +7 -0
- package/_schemas/guardrails/context.json +30 -0
- package/_schemas/guardrails/schema.cedarschema +7 -0
- package/_schemas/overwatch/context.json +30 -0
- package/_schemas/overwatch/schema.cedarschema +7 -0
- package/dist/agent_ops-context.gen.d.ts +6 -1
- package/dist/agent_ops-context.gen.js +10 -0
- package/dist/ai_gateway-context.gen.d.ts +6 -1
- package/dist/ai_gateway-context.gen.js +10 -0
- package/dist/ai_gateway-detectors.gen.js +6 -1
- package/dist/guardrails-context.gen.d.ts +6 -1
- package/dist/guardrails-context.gen.js +10 -0
- package/dist/guardrails-detectors.gen.js +6 -1
- package/dist/overwatch-context.gen.d.ts +6 -1
- package/dist/overwatch-context.gen.js +10 -0
- package/dist/overwatch-detectors.gen.js +6 -1
- package/dist/service-schemas.gen.d.ts +4 -4
- package/dist/service-schemas.gen.js +48 -0
- package/package.json +1 -1
|
@@ -443,7 +443,7 @@ export const GUARDRAILS_DETECTORS = [
|
|
|
443
443
|
inhouse: false,
|
|
444
444
|
model: null,
|
|
445
445
|
latencyP50Ms: 2,
|
|
446
|
-
emits: [{ name: "tool_operation_classes", type: "Set<String>", modifiable: false, semantic: "category_set", description: "Operation classes parsed from the command (e.g. file_delete, network_egress, privilege_escalation)." }],
|
|
446
|
+
emits: [{ name: "tool_operation_classes", type: "Set<String>", modifiable: false, semantic: "category_set", description: "Operation classes parsed from the command (e.g. file_delete, network_egress, privilege_escalation)." }, { name: "resolved_target_paths", type: "String", modifiable: false, description: "Newline-delimited (leading+trailing \\n) union of statically-resolved absolute target paths the command touches, any capability. Every value is \\n-anchored and Cedar `like` is full-string anchored, so patterns MUST start with `*`: anchored sub-tree `*\\n/etc/*` (matches only paths under /etc, unlike the loose `*/etc/*` which also hits a project `etc/` dir at any depth); bare directory target `*\\n/etc\\n*` (e.g. `rm -rf /etc`, no trailing slash); exact file `*\\n/etc/passwd\\n*`. Purely lexical resolution (cwd-join + path.Clean; quoting/escape/wrapper/cd/VAR/bash -c normalized); remote endpoints and dynamic operands are never fabricated." }, { name: "read_target_paths", type: "String", modifiable: false, description: "Newline-delimited resolved absolute paths the command reads or enumerates. \\n-anchored — match with `like` patterns starting with `*` (see resolved_target_paths)." }, { name: "write_target_paths", type: "String", modifiable: false, description: "Newline-delimited resolved absolute paths the command writes, creates, or destroys (redirects, writers, cp/mv/dd, curl/wget -o, scp/rsync local dest, tar/unzip/cpio extraction, yq -i). \\n-anchored — match with `like` patterns starting with `*` (see resolved_target_paths)." }, { name: "exec_target_paths", type: "String", modifiable: false, description: "Newline-delimited resolved absolute paths executed as a script. \\n-anchored — match with `like` patterns starting with `*` (see resolved_target_paths)." }, { name: "unresolved_target", type: "Bool", modifiable: false, semantic: "boolean_flag", description: "True when a shell command's target hid behind a variable, glob, command substitution, or inline shell code that static analysis could not resolve, or when the 64-path / 4096-byte path-list cap truncated the results. Benign dev traffic sets this frequently (variables, globs, and command substitution are everywhere, and the truncation cap trips it too), so it is NOT a deny signal on its own — combine it with a path or operation match, and reserve a blanket deny-on-unresolved rule for high-assurance or allowlisted environments." }],
|
|
447
447
|
supportedModes: ["enforce", "monitor", "alert"],
|
|
448
448
|
defendsAgainst: ["command_injection", "unauthorized_access"],
|
|
449
449
|
exampleAttacks: [{ title: "Destructive shell op", vulnerabilityId: "command_injection", snippet: "rm -rf / --no-preserve-root", expectedSignal: {} }],
|
|
@@ -479,6 +479,7 @@ export const GUARDRAILS_FIELD_TO_DETECTORS = {
|
|
|
479
479
|
"encoded_count": ["encoded_injection"],
|
|
480
480
|
"encoded_score": ["encoded_injection"],
|
|
481
481
|
"encoded_types": ["encoded_injection"],
|
|
482
|
+
"exec_target_paths": ["bash_ast_classifier"],
|
|
482
483
|
"factuality_score": ["hallucination"],
|
|
483
484
|
"file_extension": ["file_metadata"],
|
|
484
485
|
"file_name": ["file_metadata"],
|
|
@@ -549,6 +550,8 @@ export const GUARDRAILS_FIELD_TO_DETECTORS = {
|
|
|
549
550
|
"pii_types": ["pii"],
|
|
550
551
|
"profanity_score": ["toxicity"],
|
|
551
552
|
"prompt_injection_score": ["deepcontext"],
|
|
553
|
+
"read_target_paths": ["bash_ast_classifier"],
|
|
554
|
+
"resolved_target_paths": ["bash_ast_classifier"],
|
|
552
555
|
"rpm_exceeded": ["budget_checker"],
|
|
553
556
|
"rpm_remaining_pct": ["budget_checker"],
|
|
554
557
|
"rug_pull_detected": ["rug_pull"],
|
|
@@ -590,8 +593,10 @@ export const GUARDRAILS_FIELD_TO_DETECTORS = {
|
|
|
590
593
|
"topic_confidence": ["topic"],
|
|
591
594
|
"tpm_exceeded": ["budget_checker"],
|
|
592
595
|
"tpm_remaining_pct": ["budget_checker"],
|
|
596
|
+
"unresolved_target": ["bash_ast_classifier"],
|
|
593
597
|
"violence_score": ["toxicity"],
|
|
594
598
|
"weapons_score": ["toxicity"],
|
|
599
|
+
"write_target_paths": ["bash_ast_classifier"],
|
|
595
600
|
};
|
|
596
601
|
export function guardrailsDetectorById(id) {
|
|
597
602
|
return GUARDRAILS_DETECTORS.find((d) => d.id === id);
|
|
@@ -10,6 +10,7 @@ export declare const OverwatchContextKey: {
|
|
|
10
10
|
readonly Cwd: "cwd";
|
|
11
11
|
readonly DetectedThreats: "detected_threats";
|
|
12
12
|
readonly Event: "event";
|
|
13
|
+
readonly ExecTargetPaths: "exec_target_paths";
|
|
13
14
|
readonly ExitCode: "exit_code";
|
|
14
15
|
readonly HateSpeechScore: "hate_speech_score";
|
|
15
16
|
readonly HighestSeverity: "highest_severity";
|
|
@@ -50,6 +51,8 @@ export declare const OverwatchContextKey: {
|
|
|
50
51
|
readonly PrivilegeScope: "privilege_scope";
|
|
51
52
|
readonly ProfanityScore: "profanity_score";
|
|
52
53
|
readonly PromptText: "prompt_text";
|
|
54
|
+
readonly ReadTargetPaths: "read_target_paths";
|
|
55
|
+
readonly ResolvedTargetPaths: "resolved_target_paths";
|
|
53
56
|
readonly ResponseContent: "response_content";
|
|
54
57
|
readonly Role: "role";
|
|
55
58
|
readonly RugPullDetected: "rug_pull_detected";
|
|
@@ -84,14 +87,16 @@ export declare const OverwatchContextKey: {
|
|
|
84
87
|
readonly ToolPoisoningDetected: "tool_poisoning_detected";
|
|
85
88
|
readonly ToolPoisoningScore: "tool_poisoning_score";
|
|
86
89
|
readonly ToolRiskScore: "tool_risk_score";
|
|
90
|
+
readonly UnresolvedTarget: "unresolved_target";
|
|
87
91
|
readonly UserEmail: "user_email";
|
|
88
92
|
readonly ViolenceScore: "violence_score";
|
|
89
93
|
readonly WeaponsScore: "weapons_score";
|
|
90
94
|
readonly WorkspaceRoot: "workspace_root";
|
|
95
|
+
readonly WriteTargetPaths: "write_target_paths";
|
|
91
96
|
};
|
|
92
97
|
export type OverwatchContextKey = (typeof OverwatchContextKey)[keyof typeof OverwatchContextKey];
|
|
93
98
|
/**
|
|
94
99
|
* The full set of authorable context attribute keys for Overwatch.
|
|
95
100
|
* Iterate this to enumerate the authorable surface (cockpit, conformance).
|
|
96
101
|
*/
|
|
97
|
-
export declare const OverwatchContextKeys: readonly ["content", "crime_score", "cwd", "detected_threats", "event", "exit_code", "hate_speech_score", "highest_severity", "indirect_injection_score", "injection_deep_context_score", "injection_pulse_score", "injection_score", "invisible_chars_detected", "invisible_chars_score", "jailbreak_deep_context_score", "jailbreak_pulse_score", "jailbreak_score", "loop_count", "loop_detected", "loop_tool", "malicious_package_detected", "malicious_package_score", "malicious_packages", "max_threat_severity", "mcp_config_risk", "mcp_risk_score", "mcp_server", "mcp_server_verified", "mcp_tool", "package_advisory_count", "package_check_status", "package_ecosystems", "package_install_detected", "package_names", "package_risk_score", "packages_checked", "path", "pattern_type", "pii_count", "pii_detected", "pii_score", "pii_types", "privilege_scope", "profanity_score", "prompt_text", "response_content", "role", "rug_pull_detected", "rug_pull_score", "secret_count", "secret_types", "secrets_detected", "sequence_risk", "session_command_injection", "session_cumulative_risk_score", "session_injection_detected", "session_max_command_injection_score", "session_max_injection_score", "session_max_jailbreak_score", "session_max_pii_score", "session_max_secret_score", "session_pii_detected", "session_pii_types", "session_secret_types", "session_secrets_detected", "session_threat_turns", "sexual_score", "source", "suspicious_pattern", "threat_categories", "threat_count", "tool_category", "tool_is_builtin", "tool_is_sensitive", "tool_name", "tool_operation_classes", "tool_poisoning_detected", "tool_poisoning_score", "tool_risk_score", "user_email", "violence_score", "weapons_score", "workspace_root"];
|
|
102
|
+
export declare const OverwatchContextKeys: readonly ["content", "crime_score", "cwd", "detected_threats", "event", "exec_target_paths", "exit_code", "hate_speech_score", "highest_severity", "indirect_injection_score", "injection_deep_context_score", "injection_pulse_score", "injection_score", "invisible_chars_detected", "invisible_chars_score", "jailbreak_deep_context_score", "jailbreak_pulse_score", "jailbreak_score", "loop_count", "loop_detected", "loop_tool", "malicious_package_detected", "malicious_package_score", "malicious_packages", "max_threat_severity", "mcp_config_risk", "mcp_risk_score", "mcp_server", "mcp_server_verified", "mcp_tool", "package_advisory_count", "package_check_status", "package_ecosystems", "package_install_detected", "package_names", "package_risk_score", "packages_checked", "path", "pattern_type", "pii_count", "pii_detected", "pii_score", "pii_types", "privilege_scope", "profanity_score", "prompt_text", "read_target_paths", "resolved_target_paths", "response_content", "role", "rug_pull_detected", "rug_pull_score", "secret_count", "secret_types", "secrets_detected", "sequence_risk", "session_command_injection", "session_cumulative_risk_score", "session_injection_detected", "session_max_command_injection_score", "session_max_injection_score", "session_max_jailbreak_score", "session_max_pii_score", "session_max_secret_score", "session_pii_detected", "session_pii_types", "session_secret_types", "session_secrets_detected", "session_threat_turns", "sexual_score", "source", "suspicious_pattern", "threat_categories", "threat_count", "tool_category", "tool_is_builtin", "tool_is_sensitive", "tool_name", "tool_operation_classes", "tool_poisoning_detected", "tool_poisoning_score", "tool_risk_score", "unresolved_target", "user_email", "violence_score", "weapons_score", "workspace_root", "write_target_paths"];
|
|
@@ -12,6 +12,7 @@ export const OverwatchContextKey = {
|
|
|
12
12
|
Cwd: 'cwd',
|
|
13
13
|
DetectedThreats: 'detected_threats',
|
|
14
14
|
Event: 'event',
|
|
15
|
+
ExecTargetPaths: 'exec_target_paths',
|
|
15
16
|
ExitCode: 'exit_code',
|
|
16
17
|
HateSpeechScore: 'hate_speech_score',
|
|
17
18
|
HighestSeverity: 'highest_severity',
|
|
@@ -52,6 +53,8 @@ export const OverwatchContextKey = {
|
|
|
52
53
|
PrivilegeScope: 'privilege_scope',
|
|
53
54
|
ProfanityScore: 'profanity_score',
|
|
54
55
|
PromptText: 'prompt_text',
|
|
56
|
+
ReadTargetPaths: 'read_target_paths',
|
|
57
|
+
ResolvedTargetPaths: 'resolved_target_paths',
|
|
55
58
|
ResponseContent: 'response_content',
|
|
56
59
|
Role: 'role',
|
|
57
60
|
RugPullDetected: 'rug_pull_detected',
|
|
@@ -86,10 +89,12 @@ export const OverwatchContextKey = {
|
|
|
86
89
|
ToolPoisoningDetected: 'tool_poisoning_detected',
|
|
87
90
|
ToolPoisoningScore: 'tool_poisoning_score',
|
|
88
91
|
ToolRiskScore: 'tool_risk_score',
|
|
92
|
+
UnresolvedTarget: 'unresolved_target',
|
|
89
93
|
UserEmail: 'user_email',
|
|
90
94
|
ViolenceScore: 'violence_score',
|
|
91
95
|
WeaponsScore: 'weapons_score',
|
|
92
96
|
WorkspaceRoot: 'workspace_root',
|
|
97
|
+
WriteTargetPaths: 'write_target_paths',
|
|
93
98
|
};
|
|
94
99
|
/**
|
|
95
100
|
* The full set of authorable context attribute keys for Overwatch.
|
|
@@ -101,6 +106,7 @@ export const OverwatchContextKeys = [
|
|
|
101
106
|
OverwatchContextKey.Cwd,
|
|
102
107
|
OverwatchContextKey.DetectedThreats,
|
|
103
108
|
OverwatchContextKey.Event,
|
|
109
|
+
OverwatchContextKey.ExecTargetPaths,
|
|
104
110
|
OverwatchContextKey.ExitCode,
|
|
105
111
|
OverwatchContextKey.HateSpeechScore,
|
|
106
112
|
OverwatchContextKey.HighestSeverity,
|
|
@@ -141,6 +147,8 @@ export const OverwatchContextKeys = [
|
|
|
141
147
|
OverwatchContextKey.PrivilegeScope,
|
|
142
148
|
OverwatchContextKey.ProfanityScore,
|
|
143
149
|
OverwatchContextKey.PromptText,
|
|
150
|
+
OverwatchContextKey.ReadTargetPaths,
|
|
151
|
+
OverwatchContextKey.ResolvedTargetPaths,
|
|
144
152
|
OverwatchContextKey.ResponseContent,
|
|
145
153
|
OverwatchContextKey.Role,
|
|
146
154
|
OverwatchContextKey.RugPullDetected,
|
|
@@ -175,8 +183,10 @@ export const OverwatchContextKeys = [
|
|
|
175
183
|
OverwatchContextKey.ToolPoisoningDetected,
|
|
176
184
|
OverwatchContextKey.ToolPoisoningScore,
|
|
177
185
|
OverwatchContextKey.ToolRiskScore,
|
|
186
|
+
OverwatchContextKey.UnresolvedTarget,
|
|
178
187
|
OverwatchContextKey.UserEmail,
|
|
179
188
|
OverwatchContextKey.ViolenceScore,
|
|
180
189
|
OverwatchContextKey.WeaponsScore,
|
|
181
190
|
OverwatchContextKey.WorkspaceRoot,
|
|
191
|
+
OverwatchContextKey.WriteTargetPaths,
|
|
182
192
|
];
|
|
@@ -107,7 +107,7 @@ export const OVERWATCH_DETECTORS = [
|
|
|
107
107
|
inhouse: false,
|
|
108
108
|
model: null,
|
|
109
109
|
latencyP50Ms: 2,
|
|
110
|
-
emits: [{ name: "tool_operation_classes", type: "Set<String>", modifiable: false, semantic: "category_set", description: "Operation classes parsed from the command (e.g. file_delete, network_egress, privilege_escalation)." }],
|
|
110
|
+
emits: [{ name: "tool_operation_classes", type: "Set<String>", modifiable: false, semantic: "category_set", description: "Operation classes parsed from the command (e.g. file_delete, network_egress, privilege_escalation)." }, { name: "resolved_target_paths", type: "String", modifiable: false, description: "Newline-delimited (leading+trailing \\n) union of statically-resolved absolute target paths the command touches, any capability. Every value is \\n-anchored and Cedar `like` is full-string anchored, so patterns MUST start with `*`: anchored sub-tree `*\\n/etc/*` (matches only paths under /etc, unlike the loose `*/etc/*` which also hits a project `etc/` dir at any depth); bare directory target `*\\n/etc\\n*` (e.g. `rm -rf /etc`, no trailing slash); exact file `*\\n/etc/passwd\\n*`. Purely lexical resolution (cwd-join + path.Clean; quoting/escape/wrapper/cd/VAR/bash -c normalized); remote endpoints and dynamic operands are never fabricated." }, { name: "read_target_paths", type: "String", modifiable: false, description: "Newline-delimited resolved absolute paths the command reads or enumerates. \\n-anchored — match with `like` patterns starting with `*` (see resolved_target_paths)." }, { name: "write_target_paths", type: "String", modifiable: false, description: "Newline-delimited resolved absolute paths the command writes, creates, or destroys (redirects, writers, cp/mv/dd, curl/wget -o, scp/rsync local dest, tar/unzip/cpio extraction, yq -i). \\n-anchored — match with `like` patterns starting with `*` (see resolved_target_paths)." }, { name: "exec_target_paths", type: "String", modifiable: false, description: "Newline-delimited resolved absolute paths executed as a script. \\n-anchored — match with `like` patterns starting with `*` (see resolved_target_paths)." }, { name: "unresolved_target", type: "Bool", modifiable: false, semantic: "boolean_flag", description: "True when a shell command's target hid behind a variable, glob, command substitution, or inline shell code that static analysis could not resolve, or when the 64-path / 4096-byte path-list cap truncated the results. Benign dev traffic sets this frequently (variables, globs, and command substitution are everywhere, and the truncation cap trips it too), so it is NOT a deny signal on its own — combine it with a path or operation match, and reserve a blanket deny-on-unresolved rule for high-assurance or allowlisted environments." }],
|
|
111
111
|
supportedModes: ["enforce", "monitor", "alert"],
|
|
112
112
|
defendsAgainst: ["command_injection", "unauthorized_access"],
|
|
113
113
|
exampleAttacks: [{ title: "Destructive shell op", vulnerabilityId: "command_injection", snippet: "rm -rf / --no-preserve-root", expectedSignal: {} }],
|
|
@@ -201,6 +201,7 @@ export const OVERWATCH_DETECTORS = [
|
|
|
201
201
|
// resolved at codegen). Used by the client field→detector resolver — no Shield round-trip.
|
|
202
202
|
export const OVERWATCH_FIELD_TO_DETECTORS = {
|
|
203
203
|
"crime_score": ["toxicity"],
|
|
204
|
+
"exec_target_paths": ["bash_ast_classifier"],
|
|
204
205
|
"hate_speech_score": ["toxicity"],
|
|
205
206
|
"indirect_injection_score": ["deepcontext"],
|
|
206
207
|
"injection_deep_context_score": ["deepcontext"],
|
|
@@ -235,6 +236,8 @@ export const OVERWATCH_FIELD_TO_DETECTORS = {
|
|
|
235
236
|
"pii_score": ["pii"],
|
|
236
237
|
"pii_types": ["pii"],
|
|
237
238
|
"profanity_score": ["toxicity"],
|
|
239
|
+
"read_target_paths": ["bash_ast_classifier"],
|
|
240
|
+
"resolved_target_paths": ["bash_ast_classifier"],
|
|
238
241
|
"rug_pull_detected": ["rug_pull"],
|
|
239
242
|
"rug_pull_score": ["rug_pull"],
|
|
240
243
|
"secret_count": ["secrets"],
|
|
@@ -260,8 +263,10 @@ export const OVERWATCH_FIELD_TO_DETECTORS = {
|
|
|
260
263
|
"tool_poisoning_detected": ["tool_poisoning"],
|
|
261
264
|
"tool_poisoning_score": ["tool_poisoning"],
|
|
262
265
|
"tool_risk_score": ["tool_risk"],
|
|
266
|
+
"unresolved_target": ["bash_ast_classifier"],
|
|
263
267
|
"violence_score": ["toxicity"],
|
|
264
268
|
"weapons_score": ["toxicity"],
|
|
269
|
+
"write_target_paths": ["bash_ast_classifier"],
|
|
265
270
|
};
|
|
266
271
|
export function overwatchDetectorById(id) {
|
|
267
272
|
return OVERWATCH_DETECTORS.find((d) => d.id === id);
|