shroud-privacy 2.2.2 → 2.2.3
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/README.md +2 -2
- package/dist/detectors/regex.js +26 -0
- package/openclaw.plugin.json +1 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -183,7 +183,6 @@ To enable proof hashes and fake samples for deeper audit:
|
|
|
183
183
|
| `auditHashSalt` | string | `""` | Salt for proof hashes |
|
|
184
184
|
| `auditHashTruncate` | number | `12` | Truncate proof hashes to N hex chars |
|
|
185
185
|
| `auditMaxFakesSample` | number | `0` | Include up to N fake values in audit (0 = off) |
|
|
186
|
-
| `logMappings` | boolean | `false` | Log mapping table (debug only) |
|
|
187
186
|
| `customPatterns` | array | `[]` | User-defined regex detection patterns |
|
|
188
187
|
| `detectorOverrides` | object | `{}` | Override built-in rules: disable or change confidence per rule name |
|
|
189
188
|
| `maxToolDepth` | number | `10` | Max nested tool call depth before warning |
|
|
@@ -299,6 +298,7 @@ Shroud includes a `ContextDetector` that wraps the regex engine with post-detect
|
|
|
299
298
|
- **Hostname propagation**: `hostname FCNETR1` in one place → bare `FCNETR1` detected everywhere in the text.
|
|
300
299
|
- **Learned entities**: Hostnames and infra identifiers seen in previous messages are remembered and detected in future messages without requiring config-line context.
|
|
301
300
|
- **Documentation filtering**: RFC 5737 TEST-NET IPs (192.0.2.x, 198.51.100.x, 203.0.113.x), RFC 3849 IPv6 doc prefix (`2001:db8::/32`), IPv6 loopback (`::1`), `example.com` emails, and well-known placeholders are automatically skipped.
|
|
301
|
+
- **Public URL filtering**: URLs pointing to well-known public platforms (YouTube, GitHub, Wikipedia, Google, Reddit, Stack Overflow, npm, PyPI, Docker Hub, etc.) are never obfuscated — they aren't PII. Emails at these domains are still detected.
|
|
302
302
|
- **Common word decay**: Words like `permit`, `deny`, `default` that happen to match patterns get 50% confidence reduction.
|
|
303
303
|
- **Recursive deobfuscation**: Up to 3 passes for nested structures (fakes inside JSON-encoded strings).
|
|
304
304
|
- **Subnet-aware deobfuscation**: When an LLM derives network/broadcast addresses from fake host IPs (e.g., computing `.0` or `.255`), Shroud reverse-maps them via the SubnetMapper. Works for both CGNAT (IPv4) and ULA (IPv6) fake ranges, including LLM-compressed IPv6 forms.
|
|
@@ -452,7 +452,7 @@ Supports context manager, auto-restart on crash, residual fake detection, and ho
|
|
|
452
452
|
|
|
453
453
|
```bash
|
|
454
454
|
npm install
|
|
455
|
-
npm test # run vitest (
|
|
455
|
+
npm test # run vitest (777 tests)
|
|
456
456
|
npm run build # compile TypeScript
|
|
457
457
|
npm run lint # type-check without emitting
|
|
458
458
|
```
|
package/dist/detectors/regex.js
CHANGED
|
@@ -24,6 +24,24 @@ const DOC_DOMAINS = new Set([
|
|
|
24
24
|
"example.com", "example.net", "example.org", // RFC 2606
|
|
25
25
|
"localhost", "invalid",
|
|
26
26
|
]);
|
|
27
|
+
/** Well-known public domains whose URLs are never PII. */
|
|
28
|
+
const PUBLIC_DOMAINS = new Set([
|
|
29
|
+
"youtube.com", "youtu.be", "m.youtube.com",
|
|
30
|
+
"google.com", "google.co.uk", "google.de", "google.fr",
|
|
31
|
+
"github.com", "gitlab.com", "bitbucket.org",
|
|
32
|
+
"stackoverflow.com", "stackexchange.com",
|
|
33
|
+
"wikipedia.org", "wikimedia.org",
|
|
34
|
+
"twitter.com", "x.com",
|
|
35
|
+
"reddit.com",
|
|
36
|
+
"linkedin.com",
|
|
37
|
+
"medium.com",
|
|
38
|
+
"npmjs.com", "pypi.org", "crates.io",
|
|
39
|
+
"docker.com", "hub.docker.com",
|
|
40
|
+
"microsoft.com", "apple.com",
|
|
41
|
+
"mozilla.org",
|
|
42
|
+
"w3.org",
|
|
43
|
+
"archive.org",
|
|
44
|
+
]);
|
|
27
45
|
const DOC_HOSTNAMES = new Set([
|
|
28
46
|
"localhost", "HOSTNAME", "EXAMPLE", "CHANGEME",
|
|
29
47
|
"YOUR_HOST", "YOURHOST", "hostname", "example",
|
|
@@ -73,6 +91,14 @@ export function isDocExample(value, category) {
|
|
|
73
91
|
return true;
|
|
74
92
|
}
|
|
75
93
|
}
|
|
94
|
+
// Public domains — skip for URLs only (emails @youtube.com are still PII)
|
|
95
|
+
if (category === Category.URL) {
|
|
96
|
+
for (const d of PUBLIC_DOMAINS) {
|
|
97
|
+
if (lower.includes(`//${d}`) || lower.includes(`//${d}/`) || lower.includes(`.${d}`)) {
|
|
98
|
+
return true;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}
|
|
76
102
|
return false;
|
|
77
103
|
}
|
|
78
104
|
case Category.BGP_ASN:
|
package/openclaw.plugin.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"id": "shroud-privacy",
|
|
3
3
|
"name": "Shroud",
|
|
4
|
-
"version": "2.2.
|
|
4
|
+
"version": "2.2.3",
|
|
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",
|
|
@@ -21,7 +21,6 @@
|
|
|
21
21
|
"auditHashSalt": { "type": "string", "default": "", "description": "Salt for proof hashes" },
|
|
22
22
|
"auditHashTruncate": { "type": "integer", "default": 12, "minimum": 4, "maximum": 64, "description": "Truncate proof hashes to N hex chars" },
|
|
23
23
|
"auditMaxFakesSample": { "type": "integer", "default": 0, "minimum": 0, "maximum": 20, "description": "Include up to N fake replacement values in audit log (0 = disabled)" },
|
|
24
|
-
"logMappings": { "type": "boolean", "default": false, "description": "Log mapping table (debug only)" },
|
|
25
24
|
"detectorOverrides": {
|
|
26
25
|
"type": "object",
|
|
27
26
|
"additionalProperties": {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "shroud-privacy",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.3",
|
|
4
4
|
"description": "Privacy obfuscation for AI agents — detects PII and replaces with deterministic fake values before anything reaches the LLM. Works with OpenClaw (plugin) or any agent (APP protocol).",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|