@chatpanel/pii 0.2.8 → 0.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.
- package/package.json +1 -1
- package/tool-harness.js +16 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chatpanel/pii",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.9",
|
|
4
4
|
"description": "The canonical ChatPanel privacy engine — reversible PII redaction + pseudonymization with local entity detection. Pure, dependency-free ESM shared by the ChatPanel extension, gateway, and bridge.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "index.js",
|
package/tool-harness.js
CHANGED
|
@@ -58,10 +58,22 @@ export function placeholderToolNote({ toolData = 'real' } = {}) {
|
|
|
58
58
|
+ 'values before the tool executes — the tool receives the TRUE value and returns correct '
|
|
59
59
|
+ 'results. ';
|
|
60
60
|
const rules =
|
|
61
|
-
'So:
|
|
62
|
-
+ '
|
|
63
|
-
+ '
|
|
64
|
-
|
|
61
|
+
'So: treat each placeholder as a CONCRETE, specific value you already have — it is enough to '
|
|
62
|
+
+ 'act on, NOT missing or unknown information. CALL THE TOOL using the placeholder exactly as '
|
|
63
|
+
+ 'written, as if it were the real value. '
|
|
64
|
+
// The common failure isn\'t a privacy refusal — it\'s the model deciding it "lacks data"
|
|
65
|
+
// because the value is a token, and answering from general knowledge instead of looking up.
|
|
66
|
+
+ 'If answering needs the real data behind a placeholder (e.g. which city [[LOCATION_1]] is, '
|
|
67
|
+
+ 'who [[PERSON_1]] is, what [[ORG_1]] does), do NOT reply that you lack information or cannot '
|
|
68
|
+
+ 'answer. Instead pick the most relevant available tool for that placeholder\'s TYPE — LOCATION '
|
|
69
|
+
+ '→ geography / place lookups, PERSON → people lookups, ORG → company/org lookups, dates/IDs → '
|
|
70
|
+
+ 'the matching lookup — and pass the placeholder straight through as the argument. The harness '
|
|
71
|
+
+ 'restores the true value before the tool runs, so the lookup returns correct results. Make your '
|
|
72
|
+
+ 'best-guess tool call FIRST; only conclude you lack data AFTER a tool has actually returned '
|
|
73
|
+
+ 'nothing useful. '
|
|
74
|
+
+ 'Do NOT ask the user to re-type the value and do NOT refuse on privacy grounds — the lookup '
|
|
75
|
+
+ 'will work. The real values are restored in your final answer automatically, so write your '
|
|
76
|
+
+ 'answer using the placeholders too.';
|
|
65
77
|
return intro + remote + rules;
|
|
66
78
|
}
|
|
67
79
|
|