@chatpanel/pii 0.7.1 → 0.7.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/package.json +2 -2
- package/tool-harness.js +18 -2
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chatpanel/pii",
|
|
3
|
-
"version": "0.7.
|
|
4
|
-
"description": "The canonical ChatPanel privacy engine
|
|
3
|
+
"version": "0.7.3",
|
|
4
|
+
"description": "The canonical ChatPanel privacy engine \u2014 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",
|
|
7
7
|
"exports": {
|
package/tool-harness.js
CHANGED
|
@@ -46,7 +46,15 @@ export function restoreToolArgs(value, vault) {
|
|
|
46
46
|
// [[LOCATION_1]] token as redacted and REFUSE to use it for a lookup ("I can't see
|
|
47
47
|
// your real city") — the opposite of what we want. Weak models call the tool blindly
|
|
48
48
|
// and it works (the harness restores the real value), so the note levels them up.
|
|
49
|
-
|
|
49
|
+
//
|
|
50
|
+
// `ownTools`: the model is a relayed CLI agent that brings tools of ITS OWN (Codex's web
|
|
51
|
+
// search, a shell, files). Those run on the far side of the harness and receive the
|
|
52
|
+
// placeholder LITERALLY — a search for "[[ORG_1]] stock price" finds nothing, and the agent
|
|
53
|
+
// reports that "the lookup did not resolve the company". Seen exactly so, on the desktop:
|
|
54
|
+
// Codex chose its own web search over ChatPanel's `find` on one turn and answered from
|
|
55
|
+
// nothing. The extra sentence says which tools restore and which do not, so the choice is
|
|
56
|
+
// no longer a coin toss.
|
|
57
|
+
export function placeholderToolNote({ toolData = 'real', ownTools = false } = {}) {
|
|
50
58
|
const intro =
|
|
51
59
|
'PRIVACY PLACEHOLDERS: some values in this conversation are tokens like [[PERSON_1]], '
|
|
52
60
|
+ '[[LOCATION_1]], [[ORG_1]] that stand in for the user\'s real private data. ';
|
|
@@ -74,7 +82,15 @@ export function placeholderToolNote({ toolData = 'real' } = {}) {
|
|
|
74
82
|
+ 'Do NOT ask the user to re-type the value and do NOT refuse on privacy grounds — the lookup '
|
|
75
83
|
+ 'will work. The real values are restored in your final answer automatically, so write your '
|
|
76
84
|
+ 'answer using the placeholders too.';
|
|
77
|
-
|
|
85
|
+
const own = ownTools
|
|
86
|
+
? ' ONLY THE TOOLS LISTED IN THIS CONVERSATION restore placeholders. Any tool you bring '
|
|
87
|
+
+ 'yourself — your own web search, shell, file or code tools — receives the placeholder '
|
|
88
|
+
+ 'text literally and will find nothing. So for ANY lookup that involves a placeholder, '
|
|
89
|
+
+ 'call the listed tool (for example `find` with action `web_search` or `history_search`) '
|
|
90
|
+
+ 'rather than your own. Prefer the listed tools for lookups in general — the user sees '
|
|
91
|
+
+ 'those as steps — and keep your own tools for what the listed ones cannot do.'
|
|
92
|
+
: '';
|
|
93
|
+
return intro + remote + rules + own;
|
|
78
94
|
}
|
|
79
95
|
|
|
80
96
|
// Tools whose results come from the PUBLIC web rather than from the user's own machine or
|