@chatpanel/pii 0.2.7 → 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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chatpanel/pii",
3
- "version": "0.2.7",
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/pipeline.js CHANGED
@@ -22,11 +22,11 @@ export function effectiveTier(cfg, isPro) {
22
22
  return t === 'full' && !isPro ? 'basic' : t;
23
23
  }
24
24
 
25
- // Free ceiling: a generous custom dictionary so Free users can fully experience
26
- // the feature. The first FREE_DICT_LIMIT entries apply; an unlimited dictionary
27
- // (plus wider scope and the model layer) is Pro. Enforced here as defense-in-
28
- // depth — the UI also surfaces the cap, but never trust the UI alone.
29
- export const FREE_DICT_LIMIT = 100;
25
+ // Free ceiling: a small taste of the custom dictionary. The first FREE_DICT_LIMIT
26
+ // entries apply; an unlimited dictionary (plus wider scope and the model layer) is
27
+ // Pro. Enforced here as defense-in-depth — the UI also surfaces the cap, but never
28
+ // trust the UI alone.
29
+ export const FREE_DICT_LIMIT = 5;
30
30
 
31
31
  export function gatedDictionary(cfg, isPro) {
32
32
  const d = Array.isArray(cfg?.dictionary) ? cfg.dictionary : [];
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: CALL THE TOOL using the placeholder exactly as written, as if it were the real value. '
62
- + 'Do NOT say you cannot see the real value, do NOT ask the user to re-type it, and do NOT '
63
- + 'refuse on privacy grounds the lookup will work. The real values are restored in your '
64
- + 'final answer automatically, so write your answer using the placeholders too.';
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