@chatpanel/pii 0.7.2 → 0.7.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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/tool-harness.js +18 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chatpanel/pii",
3
- "version": "0.7.2",
3
+ "version": "0.7.4",
4
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",
package/tool-harness.js CHANGED
@@ -54,6 +54,22 @@ export function restoreToolArgs(value, vault) {
54
54
  // Codex chose its own web search over ChatPanel's `find` on one turn and answered from
55
55
  // nothing. The extra sentence says which tools restore and which do not, so the choice is
56
56
  // no longer a coin toss.
57
+ /**
58
+ * The note for a turn with NO tools armed. The model still meets `[[LOCATION_1]]` in the
59
+ * conversation, and a coding agent told nothing about it stops to ask what the "unresolved
60
+ * placeholder" means — exactly what a redaction layer must never cause. So: treat it as a
61
+ * concrete value, write around it, echo it exactly; the real value is restored on the way
62
+ * back. Short, because there is nothing to call.
63
+ */
64
+ export function placeholderNote() {
65
+ return 'PRIVACY PLACEHOLDERS: some values in this conversation are tokens like [[PERSON_1]], '
66
+ + '[[LOCATION_1]], [[ORG_1]] that stand in for the user\'s real private data. Treat each one as '
67
+ + 'a CONCRETE, specific value you already have — not missing or unknown information. Do not ask '
68
+ + 'what it stands for, do not say it is unresolved, and do not refuse on privacy grounds. Reason '
69
+ + 'and write with the placeholder exactly as written; the real value is restored in your answer '
70
+ + 'automatically.';
71
+ }
72
+
57
73
  export function placeholderToolNote({ toolData = 'real', ownTools = false } = {}) {
58
74
  const intro =
59
75
  'PRIVACY PLACEHOLDERS: some values in this conversation are tokens like [[PERSON_1]], '
@@ -87,7 +103,8 @@ export function placeholderToolNote({ toolData = 'real', ownTools = false } = {}
87
103
  + 'yourself — your own web search, shell, file or code tools — receives the placeholder '
88
104
  + 'text literally and will find nothing. So for ANY lookup that involves a placeholder, '
89
105
  + 'call the listed tool (for example `find` with action `web_search` or `history_search`) '
90
- + 'rather than your own; use your own tools only for things that involve no placeholder.'
106
+ + 'rather than your own. Prefer the listed tools for lookups in general the user sees '
107
+ + 'those as steps — and keep your own tools for what the listed ones cannot do.'
91
108
  : '';
92
109
  return intro + remote + rules + own;
93
110
  }