Skip to content

Every agent's model. One place. Codex on DeepSeek, Claude Code on Kimi, from the menu bar.

masking: the Insights card says what Turn on masking masks, and your own words count as on

yetone894603bcd8c2
diff --git a/internal/gui/assets/plugins/redact/i18n.js b/internal/gui/assets/plugins/redact/i18n.js
index 5f7361d38..b24a0fb19 100644
--- a/internal/gui/assets/plugins/redact/i18n.js
+++ b/internal/gui/assets/plugins/redact/i18n.js
@@ -5,7 +5,8 @@ magpie.strings({
"Turn on masking": "打开脱敏",
"You can also change it in": "也可以在这里调整:",
"Requests go to vendors as they are": "请求按原样发给厂商",
- "Turned on, keys, passwords, computer names and emails become placeholders before they leave this computer, and are put back in each answer. What each request had masked shows here.": "打开脱敏后,密钥、密码、计算机名、邮箱这些值在离开这台电脑前会换成占位符,回复里再换回来。每条请求遮了什么,都会显示在这里。",
+ "Turned on, keys, passwords and tokens become placeholders before they leave this computer, and are put back in each answer. Emails and phone numbers too once Mask personal data is on. What each request had masked shows here.": "打开脱敏后,密钥、密码、令牌这些值在离开这台电脑前会换成占位符,回复里再换回来。打开「脱敏个人信息」后,邮箱和手机号也会。每条请求遮了什么,都会显示在这里。",
+ "Only keys, passwords and tokens are masked now, and a request that carries one shows here as it goes. Emails and phone numbers are masked once Mask personal data is on, in": "现在只脱敏密钥、密码和令牌,带着它们的请求一发出就会出现在这里。邮箱和手机号要打开「脱敏个人信息」才会脱敏,在",
"magpie masked these on this computer": "magpie 在这台电脑上脱敏",
"By value": "按值",
"Read again every 15 seconds while this page is open": "页面打开时每 15 秒刷新一次",
@@ -50,7 +51,8 @@ magpie.strings({
"Turn on masking": "開啟脫敏",
"You can also change it in": "也可以在這裡調整:",
"Requests go to vendors as they are": "請求照原樣發給廠商",
- "Turned on, keys, passwords, computer names and emails become placeholders before they leave this computer, and are put back in each answer. What each request had masked shows here.": "開啟脫敏後,金鑰、密碼、電腦名稱、電子郵件這些值在離開這台電腦前會換成佔位符,回覆裡再換回來。每則請求遮了什麼,都會顯示在這裡。",
+ "Turned on, keys, passwords and tokens become placeholders before they leave this computer, and are put back in each answer. Emails and phone numbers too once Mask personal data is on. What each request had masked shows here.": "開啟脫敏後,金鑰、密碼、權杖這些值在離開這台電腦前會換成佔位符,回覆裡再換回來。開啟「脫敏個人資訊」後,電子郵件和手機號碼也會。每則請求遮了什麼,都會顯示在這裡。",
+ "Only keys, passwords and tokens are masked now, and a request that carries one shows here as it goes. Emails and phone numbers are masked once Mask personal data is on, in": "現在只脫敏金鑰、密碼和權杖,帶著它們的請求一發出就會出現在這裡。電子郵件和手機號碼要開啟「脫敏個人資訊」才會脫敏,在",
"magpie masked these on this computer": "magpie 在這台電腦上脫敏",
"By value": "按值",
"Read again every 15 seconds while this page is open": "頁面開啟時每 15 秒重新整理一次",
@@ -95,7 +97,8 @@ magpie.strings({
"Turn on masking": "マスクをオンにする",
"You can also change it in": "こちらでも変更できます:",
"Requests go to vendors as they are": "リクエストはそのままベンダーに送られます",
- "Turned on, keys, passwords, computer names and emails become placeholders before they leave this computer, and are put back in each answer. What each request had masked shows here.": "オンにすると、キー・パスワード・コンピュータ名・メールアドレスはこのコンピュータを出る前にプレースホルダーに置き換わり、返答の中で元に戻されます。各リクエストで何をマスクしたかがここに表示されます。",
+ "Turned on, keys, passwords and tokens become placeholders before they leave this computer, and are put back in each answer. Emails and phone numbers too once Mask personal data is on. What each request had masked shows here.": "オンにすると、キー・パスワード・トークンはこのコンピュータを出る前にプレースホルダーに置き換わり、返答の中で元に戻されます。「個人情報をマスク」をオンにすると、メールアドレスと電話番号も対象になります。各リクエストで何をマスクしたかがここに表示されます。",
+ "Only keys, passwords and tokens are masked now, and a request that carries one shows here as it goes. Emails and phone numbers are masked once Mask personal data is on, in": "いまマスクするのはキー・パスワード・トークンだけで、それを含むリクエストは送信と同時にここに表示されます。メールアドレスと電話番号は「個人情報をマスク」をオンにするとマスクされます。設定場所:",
"magpie masked these on this computer": "magpie がこのコンピュータでマスク",
"By value": "値別",
"Read again every 15 seconds while this page is open": "このページを開いている間、15 秒ごとに読み直します",
@@ -140,7 +143,8 @@ magpie.strings({
"Turn on masking": "Maskierung einschalten",
"You can also change it in": "Auch zu ändern unter",
"Requests go to vendors as they are": "Anfragen gehen unverändert an die Anbieter",
- "Turned on, keys, passwords, computer names and emails become placeholders before they leave this computer, and are put back in each answer. What each request had masked shows here.": "Eingeschaltet werden Schlüssel, Passwörter, Computernamen und E-Mails zu Platzhaltern, bevor sie diesen Computer verlassen, und in jeder Antwort zurückgesetzt. Was jede Anfrage maskiert hatte, steht dann hier.",
+ "Turned on, keys, passwords and tokens become placeholders before they leave this computer, and are put back in each answer. Emails and phone numbers too once Mask personal data is on. What each request had masked shows here.": "Eingeschaltet werden Schlüssel, Passwörter und Tokens zu Platzhaltern, bevor sie diesen Computer verlassen, und in jeder Antwort zurückgesetzt. E-Mails und Telefonnummern ebenso, sobald „Personenbezogene Daten maskieren“ an ist. Was jede Anfrage maskiert hatte, steht hier.",
+ "Only keys, passwords and tokens are masked now, and a request that carries one shows here as it goes. Emails and phone numbers are masked once Mask personal data is on, in": "Maskiert werden jetzt nur Schlüssel, Passwörter und Tokens; eine Anfrage mit einem davon erscheint hier, sobald sie rausgeht. E-Mails und Telefonnummern werden maskiert, sobald „Personenbezogene Daten maskieren“ an ist, unter",
"magpie masked these on this computer": "magpie hat sie auf diesem Computer maskiert",
"By value": "Nach Wert",
"Read again every 15 seconds while this page is open": "Wird alle 15 Sekunden neu gelesen, solange diese Seite offen ist",
diff --git a/internal/gui/assets/plugins/redact/page.js b/internal/gui/assets/plugins/redact/page.js
index 07ef80f64..3d54de88e 100644
--- a/internal/gui/assets/plugins/redact/page.js
+++ b/internal/gui/assets/plugins/redact/page.js
@@ -50,7 +50,9 @@ function maskLoad(force) {
return p;
}
const maskSettings = () => prefs || state?.settings || {};
-const maskOn = () => { const s = maskSettings(); return !!(s.redact || s.redactPersonal); };
+// on as the masker is (masking.Wanted): your own words mask with neither
+// switch on
+const maskOn = () => { const s = maskSettings(); return !!(s.redact || s.redactPersonal || s.redactWords?.length); };
function maskPageOpen() {
if (!providers && !maskProvAsked) {
@@ -145,7 +147,7 @@ function drawMaskCard() {
maskStrip(days, sum.days, move);
if (move && sum.n) maskCountUp(num, sum.n);
if (sum.agents.length && sum.providers.length) band.append(maskFlow(sum, move));
- else band.append(el("div", "msk-flow-none", t("A request that carries a key, a password or personal data shows here as it goes")));
+ else band.append(maskNone());
if (move) for (const [i, n] of [...band.children].entries()) n.animate([{ opacity: 0, transform: "translateY(6px)", filter: "blur(6px)" }, {}], { duration: 900, delay: i * 120, easing: "cubic-bezier(.2, .7, .1, 1)", fill: "backwards" });
}
@@ -163,9 +165,26 @@ function maskOffCard(box) {
link.onclick = (e) => openSettingsAt(e, "privacy");
also.append(el("span", "", t("You can also change it in")), link);
box.append(s, el("h2", "", t("Requests go to vendors as they are")),
- el("p", "", t("Turned on, keys, passwords, computer names and emails become placeholders before they leave this computer, and are put back in each answer. What each request had masked shows here.")),
+ el("p", "", t("Turned on, keys, passwords and tokens become placeholders before they leave this computer, and are put back in each answer. Emails and phone numbers too once Mask personal data is on. What each request had masked shows here.")),
b, also);
}
+// maskNone: what the card says while nothing was masked. With secrets
+// alone on, an agent's everyday requests carry nothing to mask (an email
+// or a name isn't a secret), so it says that, and where personal data is
+// turned on, rather than a 0 that reads as masking not working
+function maskNone() {
+ const s = maskSettings(), box = el("div", "msk-flow-none");
+ if (s.redactPersonal || !s.redact) {
+ box.textContent = t("A request that carries a key, a password or personal data shows here as it goes");
+ return box;
+ }
+ box.append(el("span", "", t("Only keys, passwords and tokens are masked now, and a request that carries one shows here as it goes. Emails and phone numbers are masked once Mask personal data is on, in")));
+ const link = el("button", "text", t("Settings › Privacy"));
+ link.type = "button";
+ link.onclick = (e) => openSettingsAt(e, "privacy");
+ box.append(" ", link);
+ return box;
+}
function maskTurnOn(e) {
const b = e.currentTarget;
b.disabled = true;
diff --git a/internal/gui/tests/masking-records.test.cjs b/internal/gui/tests/masking-records.test.cjs
index 9f2517c69..8ed2897a7 100644
--- a/internal/gui/tests/masking-records.test.cjs
+++ b/internal/gui/tests/masking-records.test.cjs
@@ -66,7 +66,7 @@ const records = [
];
function serve(lang, sum, asked, opts = {}) {
- const settings = { theme: "light", lang, tray: "panel", currency: "usd", redact: !opts.off, redactPersonal: !opts.off, redactActions: { PRIVATE_KEY: "block" } };
+ const settings = { theme: "light", lang, tray: "panel", currency: "usd", redact: !opts.off, redactPersonal: !opts.off, redactActions: { PRIVATE_KEY: "block" }, ...opts.settings };
return async (route) => {
const req = route.request(), url = new URL(req.url());
const json = (data) => route.fulfill({ json: data });
@@ -305,6 +305,41 @@ for (const engine of (process.env.BROWSER ? [process.env.BROWSER] : ["chromium",
await page.locator("#maskCard:not(.off) .msk-head").waitFor();
assert.deepEqual(errors, []);
});
+ // what the off card promises is what its button turns on: secrets,
+ // not emails or computer names. Then, with secrets alone on and
+ // nothing masked, the card says so and where personal data is turned
+ // on, not a bare 0 (Lesnolie on X: "一直是 0"); your own words alone
+ // mask, and the card says masking is on
+ test(`${engine} ${lang}: secrets alone and nothing masked, the card says what is masked and where personal data is`, async (t) => {
+ const empty = (d) => ({ ...summary(d), requests: 0, n: 0, distinct: 0, blocked: 0, kinds: [], agents: [], providers: [], values: [], by: {} });
+ const { browser, page, errors } = await open(engine, lang, 640, empty, null, { off: true, none: true });
+ t.after(() => browser.close());
+ await page.locator("#maskCard.off").waitFor();
+ if (lang === "en") {
+ const off = await page.locator("#maskCard").innerText();
+ assert(!/computer names|emails become/.test(off), `the off card promises what Turn on masking doesn't turn on: ${off}`);
+ }
+ await page.locator("#maskCard .primary").click();
+ const none = page.locator("#maskCard .msk-flow-none");
+ await none.locator("button").waitFor();
+ if (lang === "en") assert.match(await none.innerText(), /^Only keys, passwords and tokens are masked now.*Mask personal data is on, in Settings › Privacy$/s);
+ else for (const w of ["Only keys", "Emails and phone", "A request that carries"]) assert(!(await none.innerText()).includes(w), `${w} left in English`);
+ assert.deepEqual(await wide(page), { page: false, over: [] });
+ await shot(page, `${engine}-${lang}-secrets-only`);
+ await none.locator("button").click();
+ await page.locator("#view-settings").waitFor({ state: "visible" });
+ assert.deepEqual(errors, []);
+ });
+ test(`${engine} ${lang}: your own words alone are masking on`, async (t) => {
+ const empty = (d) => ({ ...summary(d), requests: 0, n: 0, distinct: 0, blocked: 0, kinds: [], agents: [], providers: [], values: [], by: {} });
+ const { browser, page, errors } = await open(engine, lang, 640, empty, null, { off: true, none: true, settings: { redactWords: ["Nightjar"] } });
+ t.after(() => browser.close());
+ await page.locator("#maskCard .msk-head").waitFor();
+ assert.equal(await page.locator("#maskCard.off").count(), 0, "words alone mask, the card says off");
+ assert.equal(await page.locator("#maskCard .msk-head button").count(), 0, "no Turn on masking while words mask");
+ assert(!(await page.locator("#maskCard .msk-flow-none").innerText()).includes("Only keys"), "words alone: not the secrets-only line");
+ assert.deepEqual(errors, []);
+ });
}
test(`${engine}: a masked call on the Gateway page, and a key in the address, open its request`, async (t) => {