shroud-privacy 2.2.8 → 2.2.9

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.
@@ -42,6 +42,24 @@ const PUBLIC_DOMAINS = new Set([
42
42
  "w3.org",
43
43
  "archive.org",
44
44
  ]);
45
+ /**
46
+ * Operational path prefixes — local system/workspace paths that agents need
47
+ * to function. These are NOT sensitive infrastructure to hide from the LLM.
48
+ */
49
+ const OPERATIONAL_PATH_PREFIXES = [
50
+ "/home/", // user home directories (workspace, scripts, media)
51
+ "/tmp/", // temp files
52
+ "/proc/", // procfs
53
+ "/sys/", // sysfs
54
+ "/dev/", // devices
55
+ "/run/", // runtime data
56
+ "/snap/", // snap packages
57
+ "/root/", // root home
58
+ "/nix/", // nix store
59
+ // NOTE: /etc/, /usr/, /var/, /bin/, /sbin/, /lib/, /opt/ are NOT included —
60
+ // they may contain infrastructure config paths (nginx, systemd units, etc.)
61
+ // that should be obfuscated in network/OT contexts.
62
+ ];
45
63
  const DOC_HOSTNAMES = new Set([
46
64
  "localhost", "HOSTNAME", "EXAMPLE", "CHANGEME",
47
65
  "YOUR_HOST", "YOURHOST", "hostname", "example",
@@ -114,12 +132,18 @@ export function isDocExample(value, category) {
114
132
  // Private ASNs are real infra identifiers — don't skip them
115
133
  return false;
116
134
  case Category.FILE_PATH: {
117
- // Skip paths that are clearly URL path components from public domains.
118
- // e.g., /www.npmjs.com/package/shroud-privacy, /github.com/org/repo
119
- // This is a safety net — the span fix in detect() should prevent these,
120
- // but production environments may have edge cases we can't reproduce.
121
135
  if (value.startsWith("/")) {
122
136
  const pathLower = value.toLowerCase();
137
+ // Skip operational/system paths — these are local workspace paths the
138
+ // agent needs to function, not sensitive infrastructure to hide from the LLM.
139
+ // Sensitive paths are things like /opt/network-configs/router.cfg on internal
140
+ // servers — those won't match these prefixes.
141
+ for (const pfx of OPERATIONAL_PATH_PREFIXES) {
142
+ if (pathLower.startsWith(pfx))
143
+ return true;
144
+ }
145
+ // Skip paths that are clearly URL path components from public domains.
146
+ // e.g., /www.npmjs.com/package/shroud-privacy, /github.com/org/repo
123
147
  for (const d of PUBLIC_DOMAINS) {
124
148
  if (pathLower.startsWith(`/${d}/`) || pathLower.startsWith(`/${d}`)
125
149
  || pathLower.startsWith(`/www.${d}/`) || pathLower.startsWith(`/www.${d}`)) {
@@ -616,7 +640,11 @@ export const BUILTIN_PATTERNS = [
616
640
  },
617
641
  {
618
642
  name: "gps_coordinate",
619
- pattern: /(?<!\w)-?\d{1,3}\.\d{4,8}[,\s]+-?\d{1,3}\.\d{4,8}(?!\w)/g,
643
+ // Require realistic lat/lon ranges: lat [-90,90], lon [-180,180].
644
+ // Must be comma-separated (not just whitespace — that matches too many
645
+ // false positives in financial data, ML weights, research metrics).
646
+ // Require 4-8 decimal places (GPS precision).
647
+ pattern: /(?<!\w)-?(?:[0-8]?\d(?:\.\d{4,8})|90(?:\.0{4,8}))\s*,\s*-?(?:1[0-7]\d(?:\.\d{4,8})|0?\d{1,2}(?:\.\d{4,8})|180(?:\.0{4,8}))(?!\w)/g,
620
648
  category: Category.GPS_COORDINATE,
621
649
  confidence: 0.85,
622
650
  },
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "id": "shroud-privacy",
3
3
  "name": "Shroud",
4
- "version": "2.2.8",
4
+ "version": "2.2.9",
5
5
  "description": "Privacy obfuscation with deterministic fake values and deobfuscation — PII never reaches the LLM, tool calls still work",
6
6
  "configSchema": {
7
7
  "type": "object",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shroud-privacy",
3
- "version": "2.2.8",
3
+ "version": "2.2.9",
4
4
  "description": "Privacy and infrastructure protection for AI agents — detects sensitive data (PII, network topology, credentials, OT/SCADA) and replaces with deterministic fakes before anything reaches the LLM.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",