@harness-engineering/core 0.26.2 → 0.26.4

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/dist/index.js CHANGED
@@ -524,8 +524,18 @@ async function readFileContent(path46) {
524
524
  return (0, import_types.Err)(error);
525
525
  }
526
526
  }
527
- async function findFiles(pattern, cwd = process.cwd()) {
528
- return (0, import_glob.glob)(pattern, { cwd, absolute: true });
527
+ var DEFAULT_FIND_FILES_IGNORE = [
528
+ "**/node_modules/**",
529
+ "**/dist/**",
530
+ "**/build/**",
531
+ "**/coverage/**"
532
+ ];
533
+ async function findFiles(pattern, cwd = process.cwd(), extraIgnore = []) {
534
+ return (0, import_glob.glob)(pattern, {
535
+ cwd,
536
+ absolute: true,
537
+ ignore: [...DEFAULT_FIND_FILES_IGNORE, ...extraIgnore]
538
+ });
529
539
  }
530
540
  function relativePosix(from, to) {
531
541
  return (0, import_node_path.relative)(from, to).replaceAll("\\", "/");
@@ -14240,7 +14250,11 @@ var reRolingPatterns = [
14240
14250
  severity: "high",
14241
14251
  category: "explicit-re-roling",
14242
14252
  description: "Direct instruction override attempt",
14243
- pattern: /(?:new\s+)?(?:system\s+)?(?:instruction|directive|role|persona)\s*[:=]\s*/i
14253
+ // Requires an override verb (new/override/replace/set/reassign/reset/switch/update/change)
14254
+ // before the keyword so plain documentation headings like `_Agent & Persona:_` or YAML
14255
+ // keys like `role: developer` do not trigger. Real overrides ("new system instruction:",
14256
+ // "override directive:", "set role: admin") still match.
14257
+ pattern: /(?:new|override|replace|set|reassign|reset|switch(?:\s+to)?|update|change)\s+(?:system\s+)?(?:instruction|directive|role|persona)s?\s*[:=]\s*/i
14244
14258
  }
14245
14259
  ];
14246
14260
  var permissionEscalationPatterns = [
package/dist/index.mjs CHANGED
@@ -57,7 +57,7 @@ import {
57
57
  runAll,
58
58
  validateDependencies,
59
59
  violationId
60
- } from "./chunk-4UI65RLE.mjs";
60
+ } from "./chunk-JIOBXIVB.mjs";
61
61
 
62
62
  // src/index.ts
63
63
  export * from "@harness-engineering/types";
@@ -10963,7 +10963,11 @@ var reRolingPatterns = [
10963
10963
  severity: "high",
10964
10964
  category: "explicit-re-roling",
10965
10965
  description: "Direct instruction override attempt",
10966
- pattern: /(?:new\s+)?(?:system\s+)?(?:instruction|directive|role|persona)\s*[:=]\s*/i
10966
+ // Requires an override verb (new/override/replace/set/reassign/reset/switch/update/change)
10967
+ // before the keyword so plain documentation headings like `_Agent & Persona:_` or YAML
10968
+ // keys like `role: developer` do not trigger. Real overrides ("new system instruction:",
10969
+ // "override directive:", "set role: admin") still match.
10970
+ pattern: /(?:new|override|replace|set|reassign|reset|switch(?:\s+to)?|update|change)\s+(?:system\s+)?(?:instruction|directive|role|persona)s?\s*[:=]\s*/i
10967
10971
  }
10968
10972
  ];
10969
10973
  var permissionEscalationPatterns = [