@highflame/policy 2.1.16 → 2.1.18

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.
@@ -217,13 +217,13 @@ const OVERWATCH_SEMANTIC_DEFAULT_CEDAR = `// ===================================
217
217
  // Detects and blocks injection attacks, prompt injection, jailbreak attempts,
218
218
  // and unsafe content using multi-layered detection:
219
219
  //
220
- // Tier 1 — YARA rules (always available, no external dependency):
220
+ // Tier 1 — Pattern-based detection (always available, no external dependency):
221
221
  // command_injection, sql_injection, path_traversal, detect_encoded
222
222
  //
223
- // Tier 2 — Javelin ML classifiers (require Highflame API token):
223
+ // Tier 2 — Injection and jailbreak classifiers (require Highflame API token):
224
224
  // injection_confidence, jailbreak_confidence
225
225
  //
226
- // Tier 3 — Content safety ML scores (require Highflame API token):
226
+ // Tier 3 — Content safety scores (require Highflame API token):
227
227
  // violence, weapons, hate_speech, crime, sexual, profanity
228
228
  //
229
229
  //
@@ -244,17 +244,17 @@ const OVERWATCH_SEMANTIC_DEFAULT_CEDAR = `// ===================================
244
244
 
245
245
 
246
246
  // ---------------------------------------------------------------------------
247
- // Tier 1: YARA-Based Injection Detection (always available)
248
- // These fire on actual YARA rule names from the detection engine.
249
- // No external API dependency — works offline with local YARA scanning.
247
+ // Tier 1: Pattern-Based Injection Detection (always available)
248
+ // These fire on detected threat names from the detection engine.
249
+ // No external API dependency — works offline with local scanning.
250
250
  // ---------------------------------------------------------------------------
251
251
 
252
252
  // Block command injection in tool calls
253
253
  @id("semantic-block-command-injection-tool")
254
254
  @name("Block command injection in tool calls")
255
- @description("Block tool execution when YARA detects command injection — reverse shells, rm -rf, privilege escalation, code execution, pipe-to-shell, or encoding evasion. Ref: AIShellJack (41-84% success rate).")
255
+ @description("Block tool execution when command injection is detected — reverse shells, rm -rf, privilege escalation, code execution, pipe-to-shell, or encoding evasion. Ref: AIShellJack (41-84% success rate).")
256
256
  @severity("critical")
257
- @tags("command-injection,yara,call-tool,mitre-t1059,owasp-asi02")
257
+ @tags("command-injection,call-tool,mitre-t1059,owasp-asi02")
258
258
  @reject_message("Tool execution blocked: command injection pattern detected — reverse shell, destructive command, privilege escalation, or code execution attempt.")
259
259
  forbid (
260
260
  principal,
@@ -268,9 +268,9 @@ when {
268
268
  // Block command injection in prompts
269
269
  @id("semantic-block-command-injection-prompt")
270
270
  @name("Block command injection in prompts")
271
- @description("Block prompts when YARA detects command injection patterns. Catches prompt-level injection where the user or injected content includes shell commands.")
271
+ @description("Block prompts when command injection patterns are detected. Catches prompt-level injection where the user or injected content includes shell commands.")
272
272
  @severity("critical")
273
- @tags("command-injection,yara,process-prompt,mitre-t1059")
273
+ @tags("command-injection,process-prompt,mitre-t1059")
274
274
  @reject_message("Prompt blocked: command injection pattern detected. The prompt contains shell commands, reverse shells, or code execution patterns.")
275
275
  forbid (
276
276
  principal,
@@ -284,9 +284,9 @@ when {
284
284
  // Block SQL injection in tool calls
285
285
  @id("semantic-block-sql-injection-tool")
286
286
  @name("Block SQL injection in tool calls")
287
- @description("Block tool execution when YARA detects SQL injection — tautologies (OR 1=1), UNION SELECT, DROP TABLE, time-based attacks (SLEEP, WAITFOR), or system object access (information_schema).")
287
+ @description("Block tool execution when SQL injection is detected — tautologies (OR 1=1), UNION SELECT, DROP TABLE, time-based attacks (SLEEP, WAITFOR), or system object access (information_schema).")
288
288
  @severity("high")
289
- @tags("sql-injection,yara,call-tool,database")
289
+ @tags("sql-injection,call-tool,database")
290
290
  @reject_message("Tool execution blocked: SQL injection pattern detected — tautology, UNION attack, destructive SQL, or system object access.")
291
291
  forbid (
292
292
  principal,
@@ -300,9 +300,9 @@ when {
300
300
  // Block SQL injection in prompts
301
301
  @id("semantic-block-sql-injection-prompt")
302
302
  @name("Block SQL injection in prompts")
303
- @description("Block prompts when YARA detects SQL injection patterns.")
303
+ @description("Block prompts when SQL injection patterns are detected.")
304
304
  @severity("high")
305
- @tags("sql-injection,yara,process-prompt,database")
305
+ @tags("sql-injection,process-prompt,database")
306
306
  @reject_message("Prompt blocked: SQL injection pattern detected.")
307
307
  forbid (
308
308
  principal,
@@ -316,9 +316,9 @@ when {
316
316
  // Block path traversal attacks
317
317
  @id("semantic-block-path-traversal")
318
318
  @name("Block path traversal attacks")
319
- @description("Block when YARA detects path traversal — 2+ levels of ../ combined with sensitive file targets (/etc/passwd, /etc/shadow) or file read/include operations with traversal.")
319
+ @description("Block when path traversal is detected — 2+ levels of ../ combined with sensitive file targets (/etc/passwd, /etc/shadow) or file read/include operations with traversal.")
320
320
  @severity("high")
321
- @tags("path-traversal,yara,file-access,mitre-t1005")
321
+ @tags("path-traversal,file-access,mitre-t1005")
322
322
  @reject_message("Blocked: path traversal attack detected — directory traversal sequences targeting sensitive system files.")
323
323
  forbid (
324
324
  principal,
@@ -332,9 +332,9 @@ when {
332
332
  // Block encoded/obfuscated payloads in tool calls
333
333
  @id("semantic-block-encoded")
334
334
  @name("Block encoded payloads in tool calls")
335
- @description("Block tool calls when YARA detects base64-encoded payloads (30+ chars) or hash IOCs. Base64 detection excludes npm package paths to reduce false positives.")
335
+ @description("Block tool calls when base64-encoded payloads (30+ chars) or hash IOCs are detected. Base64 detection excludes npm package paths to reduce false positives.")
336
336
  @severity("medium")
337
- @tags("encoded,obfuscation,yara,call-tool")
337
+ @tags("encoded,obfuscation,call-tool")
338
338
  @reject_message("Tool execution blocked: encoded or obfuscated payload detected. Base64-encoded content or hash IOCs found in tool arguments.")
339
339
  forbid (
340
340
  principal,
@@ -347,7 +347,7 @@ when {
347
347
 
348
348
 
349
349
  // ---------------------------------------------------------------------------
350
- // Tier 2: Javelin ML-Based Detection (require Highflame API token)
350
+ // Tier 2: Classifier-Based Detection (require Highflame API token)
351
351
  // Prompt injection and jailbreak classifiers. These are inert without
352
352
  // the API token — scores default to 0 (prompts) or are absent (tools).
353
353
  // ---------------------------------------------------------------------------
@@ -386,7 +386,7 @@ when {
386
386
 
387
387
 
388
388
  // ---------------------------------------------------------------------------
389
- // Tier 3: Content Safety (Javelin ML scores, require API token)
389
+ // Tier 3: Content Safety (classifier scores, require API token)
390
390
  // Trust & safety classification scores for violence, weapons, hate speech,
391
391
  // crime, sexual content, and profanity. Ensures enterprise-appropriate
392
392
  // content thresholds.
@@ -550,7 +550,7 @@ when {
550
550
  // Section 2: Destructive Operations (opt-in — inactive by default)
551
551
  // Blocks file deletion tools. Enable when agents should not have delete access.
552
552
  // NOTE: Only matches MCP tool names, not Bash rm commands (which use
553
- // tool_name "shell"). Bash destructive commands are caught by YARA
553
+ // tool_name "shell"). Bash destructive commands are caught by the
554
554
  // command_injection rule in semantic.cedar.
555
555
  // ---------------------------------------------------------------------------
556
556
 
@@ -581,7 +581,7 @@ when {
581
581
  // Blocks file read/write access to system directories.
582
582
  // NOTE: Targets read_file/write_file only — NOT call_tool. The path field
583
583
  // is empty for Bash commands. Bash access to system files is caught by
584
- // YARA rules in semantic.cedar (command_injection, path_traversal).
584
+ // rules in semantic.cedar (command_injection, path_traversal).
585
585
  // Ref: MITRE T1005, T1552
586
586
  // ---------------------------------------------------------------------------
587
587
 
@@ -614,15 +614,15 @@ when {
614
614
  // ---------------------------------------------------------------------------
615
615
  // Section 4: Threat-Based Tool Blocking (active)
616
616
  // Blocks tool calls based on threat severity from detection engines.
617
- // This is the primary catch-all — any YARA rule with severity HIGH (3)
617
+ // This is the primary catch-all — any rule with severity HIGH (3)
618
618
  // or CRITICAL (4) triggers this. Provides defense-in-depth behind
619
- // specific YARA rule policies in semantic.cedar and secrets.cedar.
619
+ // specific rule policies in semantic.cedar and secrets.cedar.
620
620
  // ---------------------------------------------------------------------------
621
621
 
622
622
  // Block tool calls with high/critical severity threats
623
623
  @id("tools-block-high-severity")
624
624
  @name("Block tool calls with high severity threats")
625
- @description("Block tool execution when YARA or Javelin detects threats with severity >= HIGH (3). Primary catch-all defense — any YARA rule with severity HIGH or CRITICAL triggers this.")
625
+ @description("Block tool execution when threats with severity >= HIGH (3) are detected. Primary catch-all defense — any rule with severity HIGH or CRITICAL triggers this.")
626
626
  @severity("high")
627
627
  @tags("tools,threats,severity,defense-in-depth")
628
628
  @reject_message("Tool execution blocked: high or critical severity threats detected in content by security scanners.")
@@ -1046,7 +1046,7 @@ when {
1046
1046
  export const OVERWATCH_CATEGORIES = [
1047
1047
  { id: 'secrets', name: 'Secrets Detection', description: 'Detect and block credentials, tokens, API keys, and sensitive key patterns in prompts, tool calls, and file operations' },
1048
1048
  { id: 'pii', name: 'PII Detection', description: 'Detect and block personally identifiable information (PII) such as credit card numbers, SSNs, and other sensitive data' },
1049
- { id: 'semantic', name: 'Semantic Threat Detection', description: 'Detect and block injection attacks, prompt injection, jailbreak attempts, and unsafe content using YARA rules and ML classifiers' },
1049
+ { id: 'semantic', name: 'Semantic Threat Detection', description: 'Detect and block injection attacks, prompt injection, jailbreak attempts, and unsafe content' },
1050
1050
  { id: 'tools', name: 'Tool Permissioning', description: 'Control access to shell execution, file operations, MCP servers, and sensitive system paths' },
1051
1051
  { id: 'organization', name: 'Organization Rules', description: 'Apply organization-wide policy baselines, team permissions, and agent-specific guardrails' },
1052
1052
  ];
@@ -1072,20 +1072,20 @@ export const OVERWATCH_TEMPLATES = [
1072
1072
  {
1073
1073
  id: 'secrets-default',
1074
1074
  name: 'Secrets Detection',
1075
- description: 'Detect and block credential leakage using YARA rule matching (secrets_leakage, ssh_key_exposure, pem_file_access, environment_variable_leakage) and sensitive file path protection',
1075
+ description: 'Detect and block credential leakage (secrets_leakage, ssh_key_exposure, pem_file_access, environment_variable_leakage) and sensitive file path protection',
1076
1076
  category: 'secrets',
1077
1077
  cedarText: OVERWATCH_SECRETS_DEFAULT_CEDAR,
1078
1078
  severity: 'critical',
1079
- tags: ['secrets', 'credentials', 'aws', 'github', 'ssh', 'pem', 'yara', 'baseline'],
1079
+ tags: ['secrets', 'credentials', 'aws', 'github', 'ssh', 'pem', 'baseline'],
1080
1080
  },
1081
1081
  {
1082
1082
  id: 'semantic-default',
1083
1083
  name: 'Semantic Threat Detection',
1084
- description: 'Detect and block injection attacks (command, SQL, path traversal), prompt injection, jailbreak, and unsafe content (violence, hate speech, etc.) using YARA rules and ML classifiers',
1084
+ description: 'Detect and block injection attacks (command, SQL, path traversal), prompt injection, jailbreak, and unsafe content (violence, hate speech, etc.)',
1085
1085
  category: 'semantic',
1086
1086
  cedarText: OVERWATCH_SEMANTIC_DEFAULT_CEDAR,
1087
1087
  severity: 'critical',
1088
- tags: ['injection', 'jailbreak', 'content-safety', 'yara', 'ml', 'owasp-llm01', 'owasp-llm02', 'baseline'],
1088
+ tags: ['injection', 'jailbreak', 'content-safety', 'ml', 'owasp-llm01', 'owasp-llm02', 'baseline'],
1089
1089
  },
1090
1090
  {
1091
1091
  id: 'tools-default',
@@ -1182,7 +1182,7 @@ export const OVERWATCH_TEMPLATES_JSON = `{
1182
1182
  {
1183
1183
  "id": "semantic",
1184
1184
  "name": "Semantic Threat Detection",
1185
- "description": "Detect and block injection attacks, prompt injection, jailbreak attempts, and unsafe content using YARA rules and ML classifiers"
1185
+ "description": "Detect and block injection attacks, prompt injection, jailbreak attempts, and unsafe content"
1186
1186
  },
1187
1187
  {
1188
1188
  "id": "tools",
@@ -1211,20 +1211,20 @@ export const OVERWATCH_TEMPLATES_JSON = `{
1211
1211
  {
1212
1212
  "id": "secrets-default",
1213
1213
  "name": "Secrets Detection",
1214
- "description": "Detect and block credential leakage using YARA rule matching (secrets_leakage, ssh_key_exposure, pem_file_access, environment_variable_leakage) and sensitive file path protection",
1214
+ "description": "Detect and block credential leakage (secrets_leakage, ssh_key_exposure, pem_file_access, environment_variable_leakage) and sensitive file path protection",
1215
1215
  "category": "secrets",
1216
1216
  "file": "defaults/secrets.cedar",
1217
1217
  "severity": "critical",
1218
- "tags": ["secrets", "credentials", "aws", "github", "ssh", "pem", "yara", "baseline"]
1218
+ "tags": ["secrets", "credentials", "aws", "github", "ssh", "pem", "baseline"]
1219
1219
  },
1220
1220
  {
1221
1221
  "id": "semantic-default",
1222
1222
  "name": "Semantic Threat Detection",
1223
- "description": "Detect and block injection attacks (command, SQL, path traversal), prompt injection, jailbreak, and unsafe content (violence, hate speech, etc.) using YARA rules and ML classifiers",
1223
+ "description": "Detect and block injection attacks (command, SQL, path traversal), prompt injection, jailbreak, and unsafe content (violence, hate speech, etc.)",
1224
1224
  "category": "semantic",
1225
1225
  "file": "defaults/semantic.cedar",
1226
1226
  "severity": "critical",
1227
- "tags": ["injection", "jailbreak", "content-safety", "yara", "ml", "owasp-llm01", "owasp-llm02", "baseline"]
1227
+ "tags": ["injection", "jailbreak", "content-safety", "ml", "owasp-llm01", "owasp-llm02", "baseline"]
1228
1228
  },
1229
1229
  {
1230
1230
  "id": "tools-default",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@highflame/policy",
3
- "version": "2.1.16",
3
+ "version": "2.1.18",
4
4
  "description": "Highflame Cedar policy types and engine wrapper",
5
5
  "readme": "README.md",
6
6
  "main": "dist/index.js",