@highflame/policy 2.2.34 → 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.
Files changed (39) hide show
  1. package/_schemas/agent_ops/context.json +30 -0
  2. package/_schemas/agent_ops/schema.cedarschema +7 -0
  3. package/_schemas/agent_ops/templates/ported/agent-security/agent_identity_multi_agent_safety.cedar +3 -17
  4. package/_schemas/agent_ops/templates/ported/threat-detection/security_patterns.cedar +7 -19
  5. package/_schemas/agent_ops/templates/ported/threat-detection/semantic_defaults.cedar +7 -33
  6. package/_schemas/agent_ops/templates/templates.json +4 -6
  7. package/_schemas/ai_gateway/context.json +30 -0
  8. package/_schemas/ai_gateway/schema.cedarschema +7 -0
  9. package/_schemas/ai_gateway/templates/defaults/tools.cedar +3 -17
  10. package/_schemas/ai_gateway/templates/templates.json +1 -2
  11. package/_schemas/guardrails/context.json +30 -0
  12. package/_schemas/guardrails/schema.cedarschema +7 -0
  13. package/_schemas/guardrails/templates/defaults/security_patterns.cedar +7 -19
  14. package/_schemas/guardrails/templates/profiles/multi_agent/agent_safety.cedar +3 -17
  15. package/_schemas/guardrails/templates/templates.json +4 -6
  16. package/_schemas/overwatch/context.json +30 -0
  17. package/_schemas/overwatch/schema.cedarschema +7 -0
  18. package/_schemas/sentry/templates/templates.json +0 -14
  19. package/dist/agent_ops-context.gen.d.ts +6 -1
  20. package/dist/agent_ops-context.gen.js +10 -0
  21. package/dist/agent_ops-defaults.gen.js +25 -79
  22. package/dist/ai_gateway-context.gen.d.ts +6 -1
  23. package/dist/ai_gateway-context.gen.js +10 -0
  24. package/dist/ai_gateway-defaults.gen.js +6 -21
  25. package/dist/ai_gateway-detectors.gen.js +6 -1
  26. package/dist/guardrails-context.gen.d.ts +6 -1
  27. package/dist/guardrails-context.gen.js +10 -0
  28. package/dist/guardrails-defaults.gen.js +18 -46
  29. package/dist/guardrails-detectors.gen.js +6 -1
  30. package/dist/overwatch-context.gen.d.ts +6 -1
  31. package/dist/overwatch-context.gen.js +10 -0
  32. package/dist/overwatch-defaults.gen.js +11 -37
  33. package/dist/overwatch-detectors.gen.js +6 -1
  34. package/dist/sentry-defaults.gen.d.ts +1 -1
  35. package/dist/sentry-defaults.gen.js +0 -56
  36. package/dist/service-schemas.gen.d.ts +4 -4
  37. package/dist/service-schemas.gen.js +48 -0
  38. package/package.json +1 -1
  39. package/_schemas/sentry/templates/defaults/file_safety.cedar +0 -31
@@ -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
  {
@@ -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
  ];
@@ -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",
@@ -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);
@@ -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",