Every agent's model. One place. Codex on DeepSeek, Claude Code on Kimi, from the menu bar.
readme, site: privacy masking gets its own section, with the Masking page
yetone5509128b1b6f
diff --git a/README.md b/README.mdindex 8f035cda0..e9f92c5e5 100644--- a/README.md+++ b/README.md@@ -37,6 +37,7 @@ Each agent keeps its model in its own file, in its own format, with its own keys- **Pick any model for any agent** from one list. magpie edits the one key that matters in the agent's own config.- **Use one provider everywhere**: an API key, a local model, or the Claude, ChatGPT, Copilot, Gemini or Grok plan you're signed in to.- **Keep going when a quota runs out**: a routing group moves to the next account or model, and the agent never sees the error.+- **Keep your secrets off the vendor's servers**: keys, passwords and emails in a prompt are masked on your computer before the request leaves it, and put back in the reply.It's for you if you use more than one agent, more than one provider, or more than one account. If you use one agent on its vendor's own plan and that's enough, you don't need it.@@ -122,6 +123,26 @@ Click a value and a searchable list opens: every model of every provider you add</tr></table>+### Privacy masking++Agents put what they read into the prompt: an `.env`, a config file, a log with a token in it. With masking on, magpie swaps those values for placeholders on your computer before a request leaves it, and swaps them back in the reply. Your agent and your files keep the real values; the vendor never sees them.++<picture>+ <source media="(prefers-color-scheme: dark)" srcset="site/public/img/masking-dark.png">+ <img src="site/public/img/masking-light.png" width="900" alt="Insights › Masking: 5,812 values kept from vendors in 7 days, flowing from Claude Code and Codex through magpie to OpenAI, Kimi and DeepSeek, and each request's masked values">+</picture>++| | |+| :-- | :-- |+| **Found two ways** | Rules for what is certain (API keys, private keys, tokens, emails, and card and ID numbers whose checksum adds up), and, if you want it, a model that runs on this computer for the names, addresses and passwords no rule can find (a 1.6 GB download, on the CPU) |+| **Put back everywhere** | A value becomes a placeholder such as `{{API_KEY_k3v9x2mq}}`, and every placeholder in the reply turns back into its value: streamed text and tool-call arguments too, so a command the agent runs has the real key |+| **Nothing breaks** | A value gets the same placeholder every time, so the conversation, the prompt cache and thinking signatures stay valid. A value masked once is masked wherever it shows up later |+| **Never on disk** | Values are held in memory only. The record keeps each value's kind, length and first characters. If masking is on and can't run, the request is held back (503), never sent as written |+| **You can check it** | **Insights › Masking** lists every request it changed, with what the vendor got instead, side by side, and **Try it** in Settings shows what a text would become |+| **Your rules** | Secrets and personal data each on or off, finer kinds (passport, IBAN, MAC, public IP…), your own words and patterns, and whether a value found is masked, only warned about, or held back (**Mask**, **Warn**, **Block**) |++The cost: the model sees `{{API_KEY_…}}`, not the key, so a task about the value itself (why is this token refused?) can't be done on it. Put such values under **Never mask**. Rules can be wrong now and then; the Masking page is where you'd see it. Turn it on in **Settings → Privacy**.+### ProvidersPick a preset, paste a key. Model lists come from the vendor, with names and reasoning levels filled in from [models.dev](https://models.dev), so a model released this morning is in your picker on the next refresh.@@ -270,7 +291,7 @@ Find them under Plugins › Discover › Gateway middleware. See [Gateway middle## Privacy-Your prompts, replies, keys and accounts go only to the providers you use. Once a day a released magpie tells us it is in use: a random id, its version and system, and which agents, providers and models it is used with, by magpie's own ids (a provider you added yourself is only `custom`), and for each partner listed first in the add sheet, how many times a day it was shown, opened and added (counts only). No names, URLs, accounts, keys, prompts or usage. Turn part or all of it off in **Settings → Privacy**, or with `DO_NOT_TRACK=1`. A partner's website and key links go through `usemagpie.ai/go/…`, which counts the click, and usemagpie.ai counts fetches of the partner list; the server sees these whatever the settings, and keeps no id or address. Icons named by a plugin, an import link or the library are fetched through `usemagpie.ai/api/icon`, so their hosts see Cloudflare's address, not yours; the server only passes the picture on, and counts and keeps nothing. The [Privacy page](https://usemagpie.ai/docs/privacy) lists everything magpie sends by itself, with an example and every switch; the [reference](docs/reference.md#counting-users) has the rules.+Your prompts, replies, keys and accounts go only to the providers you use, and with [privacy masking](#privacy-masking) on, the secrets in them don't go even there. Once a day a released magpie tells us it is in use: a random id, its version and system, and which agents, providers and models it is used with, by magpie's own ids (a provider you added yourself is only `custom`), and for each partner listed first in the add sheet, how many times a day it was shown, opened and added (counts only). No names, URLs, accounts, keys, prompts or usage. Turn part or all of it off in **Settings → Privacy**, or with `DO_NOT_TRACK=1`. A partner's website and key links go through `usemagpie.ai/go/…`, which counts the click, and usemagpie.ai counts fetches of the partner list; the server sees these whatever the settings, and keeps no id or address. Icons named by a plugin, an import link or the library are fetched through `usemagpie.ai/api/icon`, so their hosts see Cloudflare's address, not yours; the server only passes the picture on, and counts and keeps nothing. The [Privacy page](https://usemagpie.ai/docs/privacy) lists everything magpie sends by itself, with an example and every switch; the [reference](docs/reference.md#counting-users) has the rules.## Communitydiff --git a/README.zh-CN.md b/README.zh-CN.mdindex 04a610977..419739b84 100644--- a/README.zh-CN.md+++ b/README.zh-CN.md@@ -37,6 +37,7 @@- **任意 Agent 用任意模型**,在一张表里选。magpie 只改 Agent 配置里该改的那一个键。- **一个 provider 处处能用**:API key、本地模型,或者你登录着的 Claude、ChatGPT、Copilot、Gemini、Grok 订阅。- **额度用完也不断**:路由组自动切到下一个账号或模型,Agent 看不到报错。+- **密钥不出你的电脑**:提示词里的密钥、密码、邮箱,在请求离开电脑前就在本地脱敏,回复里再换回原值。如果你用不止一个 Agent、不止一个 provider 或不止一个账号,它就适合你。如果你只用一个 Agent、只用它自家的订阅,而且够用,那就不需要 magpie。@@ -122,6 +123,26 @@ export GOOGLE_GEMINI_BASE_URL=http://127.0.0.1:3425 GEMINI_API_KEY=magpie</tr></table>+### 隐私脱敏++Agent 会把读到的东西放进提示词:一个 `.env`、一份配置、一段带 token 的日志。打开脱敏后,请求离开电脑前,magpie 在本地把这些值换成占位符,回复里再换回来。Agent 和你的文件里始终是真值,厂商一个也看不到。++<picture>+ <source media="(prefers-color-scheme: dark)" srcset="site/public/img/masking-zh-dark.png">+ <img src="site/public/img/masking-zh-light.png" width="900" alt="观测 › 脱敏:7 天里没让厂商看到的 5,812 处,从 Claude Code 和 Codex 经 magpie 流向 OpenAI、Kimi 和 DeepSeek,以及每个请求遮掉的值">+</picture>++| | |+| :-- | :-- |+| **两种方式找** | 规则管确定的:API key、私钥、token、邮箱,以及校验位对得上的银行卡号和证件号;需要的话,再加一个在这台电脑上运行的模型,找规则找不到的人名、地址和密码(下载 1.6 GB,用 CPU 跑) |+| **处处换回** | 值变成 `{{API_KEY_k3v9x2mq}}` 这样的占位符,回复里的占位符都换回原值,流式文本和工具调用参数也算,所以 Agent 执行的命令里是真的 key |+| **什么都不坏** | 同一个值每次的占位符都一样,对话上下文、提示词缓存和 thinking 签名都不受影响。一个值遮过一次,以后出现在哪里都会遮 |+| **从不落盘** | 原值只在内存里。记录只留每个值的类型、长度和开头几个字符。脱敏打开却运行不了时,请求会被拦下(503),绝不按原样发出 |+| **看得见** | **观测 › 脱敏** 列出它改过的每个请求,厂商实际收到了什么,左右对照;设置里的 **试一试** 能看一段文字会变成什么 |+| **你说了算** | 机密和个人信息各自开关,更细的类型(护照、IBAN、MAC、公网 IP…),自己的词和规则,以及找到值后是 **脱敏**、只 **提醒**,还是 **拦截** |++代价:模型看到的是 `{{API_KEY_…}}` 而不是 key,所以针对值本身的任务(比如这个 token 为什么被拒)没法做,这类值可以加进 **从不脱敏**。规则偶尔会判错,在脱敏页一眼就能看到。在 **设置 → 隐私** 里打开。+### Provider选一个预设,粘贴 key。模型列表直接来自厂商,名称和推理档位从 [models.dev](https://models.dev) 补全,今天早上刚发布的模型,下次刷新就出现在你的选择器里。@@ -270,7 +291,7 @@ magpie plugin options model-map '{"mapping": {"fast": "deepseek/deepseek-chat"}}## 隐私-你的提示词、回复、密钥和账号只发给你用的供应商。正式版 magpie 每天告诉我们一次它在用:一个随机 ID、版本和系统,以及用了哪些 agent、供应商和模型,只用 magpie 自己的 ID(你自己添加的供应商只记作 `custom`),以及添加供应商页里排在最前的合作伙伴每天被展示、打开和添加的次数(只有次数)。不发送名称、URL、账号、密钥、提示词和用量。可以在 **设置 → 隐私** 里关掉一部分或全部,也可以设 `DO_NOT_TRACK=1`。合作伙伴的官网和获取 Key 链接经 `usemagpie.ai/go/…` 跳转并计一次点击,usemagpie.ai 也统计合作伙伴列表的拉取次数;这是服务器本身看到的,不受设置影响,不记录 ID 和 IP。插件、导入链接和库里的图标经 `usemagpie.ai/api/icon` 获取,图标所在的服务器只看到 Cloudflare 的地址,看不到你的 IP;这台服务器只转发图片,不计数也不记录。[隐私页](https://usemagpie.ai/docs/zh/privacy)列出了 magpie 自己发出的所有内容,附示例和每个开关;规则见[参考文档](docs/reference.md#counting-users)。+你的提示词、回复、密钥和账号只发给你用的供应商;打开[隐私脱敏](#隐私脱敏)后,其中的密钥连供应商也收不到。正式版 magpie 每天告诉我们一次它在用:一个随机 ID、版本和系统,以及用了哪些 agent、供应商和模型,只用 magpie 自己的 ID(你自己添加的供应商只记作 `custom`),以及添加供应商页里排在最前的合作伙伴每天被展示、打开和添加的次数(只有次数)。不发送名称、URL、账号、密钥、提示词和用量。可以在 **设置 → 隐私** 里关掉一部分或全部,也可以设 `DO_NOT_TRACK=1`。合作伙伴的官网和获取 Key 链接经 `usemagpie.ai/go/…` 跳转并计一次点击,usemagpie.ai 也统计合作伙伴列表的拉取次数;这是服务器本身看到的,不受设置影响,不记录 ID 和 IP。插件、导入链接和库里的图标经 `usemagpie.ai/api/icon` 获取,图标所在的服务器只看到 Cloudflare 的地址,看不到你的 IP;这台服务器只转发图片,不计数也不记录。[隐私页](https://usemagpie.ai/docs/zh/privacy)列出了 magpie 自己发出的所有内容,附示例和每个开关;规则见[参考文档](docs/reference.md#counting-users)。## 社区diff --git a/site/i18n.js b/site/i18n.jsindex d5c29dd4f..d4949f029 100644--- a/site/i18n.js+++ b/site/i18n.js@@ -135,6 +135,26 @@ const zh = {"plat.win": "10 及以上","foot.start": "快速上手","foot.feed": "更新源",++ "nav.masking": "脱敏",+ "alt.masking": "观测 › 脱敏:7 天里没让厂商看到的 5,812 处,从 Claude Code 和 Codex 经 magpie 流向 OpenAI、Kimi 和 DeepSeek",+ "img.masking.light": "/img/masking-zh-light.png",+ "img.masking.dark": "/img/masking-zh-dark.png",+ "msk.eyebrow": "隐私脱敏",+ "msk.h2": "你的密钥,厂商一个也看不到。",+ "msk.sub": "Agent 会把读到的东西放进提示词:一个 <code>.env</code>、一份配置、一段带 token 的日志。请求离开电脑前,magpie 在本地把这些值换成占位符,回复里再换回来。Agent 和你的文件里始终是真值,厂商一个也看不到。",+ "msk.find": "两种方式找",+ "msk.find.p": "规则管确定的:API key、私钥、token、邮箱,以及校验位对得上的银行卡号和证件号。需要的话,再加一个在这台电脑上运行的模型,找规则找不到的人名、地址和密码。",+ "msk.back": "处处换回",+ "msk.back.p": "值变成 <code>{{API_KEY_k3v9x2mq}}</code> 这样的占位符。回复里的占位符都换回原值,流式文本和工具调用也算,所以 Agent 执行的命令里是真的 key。",+ "msk.cache": "什么都不坏",+ "msk.cache.p": "同一个值每次的占位符都一样,对话上下文、提示词缓存和 thinking 签名都不受影响。",+ "msk.disk": "从不落盘",+ "msk.disk.p": "原值只在内存里,记录只留类型、长度和开头几个字符。脱敏运行不了时,请求会被拦下,绝不按原样发出。",+ "msk.see": "不是黑箱",+ "msk.see.p": "观测 › 脱敏 列出它改过的每个请求,厂商实际收到了什么,左右对照。",+ "msk.cost": "你说了算",+ "msk.cost.p": "模型只看到占位符,看不到值本身,所以针对某个值的任务要把它加进「从不脱敏」。遮哪些、加自己的词,或者改成只提醒、直接拦截,都由你定。",};const ja = {@@ -261,6 +281,26 @@ const ja = {"plat.win": "10 以降","foot.start": "はじめに","foot.feed": "更新フィード",++ "nav.masking": "マスク",+ "alt.masking": "観測 › マスク:7 日間でベンダーに渡さなかった 5,812 か所。Claude Code と Codex から magpie を経て OpenAI、Kimi、DeepSeek へ",+ "img.masking.light": "/img/masking-ja-light.png",+ "img.masking.dark": "/img/masking-ja-dark.png",+ "msk.eyebrow": "プライバシーマスク",+ "msk.h2": "あなたの秘密は、ベンダーに届かない。",+ "msk.sub": "エージェントは読んだものをプロンプトに入れます。<code>.env</code>、設定ファイル、トークン入りのログ。magpie はリクエストがコンピュータを出る前に、それらの値をこのコンピュータ上でプレースホルダーに置き換え、応答で元に戻します。エージェントとファイルには本物の値が残り、ベンダーには見えません。",+ "msk.find": "二つの方法で見つける",+ "msk.find.p": "確実なものはルールで:API キー、秘密鍵、トークン、メール、チェックサムの合うカード番号や ID 番号。必要なら、このコンピュータで動くモデルが、ルールでは見つからない名前、住所、パスワードを見つけます。",+ "msk.back": "どこでも元に戻す",+ "msk.back.p": "値は <code>{{API_KEY_k3v9x2mq}}</code> のようなプレースホルダーになり、応答の中のプレースホルダーはストリームやツール呼び出しも含めて元の値に戻ります。エージェントが実行するコマンドには本物のキーが入ります。",+ "msk.cache": "何も壊れない",+ "msk.cache.p": "同じ値はいつも同じプレースホルダーになるので、会話、プロンプトキャッシュ、thinking の署名はそのまま有効です。",+ "msk.disk": "ディスクに残さない",+ "msk.disk.p": "値はメモリにだけ置かれ、記録に残るのは種類、長さ、先頭の数文字だけ。マスクが動かないときは、リクエストをそのまま送らずに止めます。",+ "msk.see": "ブラックボックスではない",+ "msk.see.p": "観測 › マスク に、変更したリクエストごとに、ベンダーが実際に受け取ったものが並べて表示されます。",+ "msk.cost": "決めるのはあなた",+ "msk.cost.p": "モデルに見えるのはプレースホルダーだけなので、値そのものを扱う作業には「マスクしない」に入れてください。何をマスクするか、自分の語句、警告やブロックへの切り替えも選べます。",};const de = {@@ -387,6 +427,26 @@ const de = {"plat.win": "10 oder neuer","foot.start": "Erste Schritte","foot.feed": "Update-Feed",++ "nav.masking": "Maskierung",+ "alt.masking": "Einblick › Maskierung: 5.812 Werte in 7 Tagen vor Anbietern verborgen, von Claude Code und Codex über magpie zu OpenAI, Kimi und DeepSeek",+ "img.masking.light": "/img/masking-light.png",+ "img.masking.dark": "/img/masking-dark.png",+ "msk.eyebrow": "Datenschutz-Maskierung",+ "msk.h2": "Ihre Geheimnisse erreichen den Anbieter nie.",+ "msk.sub": "Agenten übernehmen, was sie lesen, in den Prompt: eine <code>.env</code>, eine Konfiguration, ein Log mit einem Token darin. magpie ersetzt diese Werte auf Ihrem Computer durch Platzhalter, bevor eine Anfrage ihn verlässt, und setzt sie in der Antwort wieder ein. Ihr Agent und Ihre Dateien behalten die echten Werte; der Anbieter sieht sie nie.",+ "msk.find": "Auf zwei Wegen gefunden",+ "msk.find.p": "Regeln für das Sichere: API-Schlüssel, private Schlüssel, Tokens, E-Mails, Karten- und Ausweisnummern mit stimmender Prüfsumme. Und auf Wunsch ein Modell auf diesem Computer für Namen, Adressen und Passwörter, die keine Regel findet.",+ "msk.back": "Überall zurückgesetzt",+ "msk.back.p": "Ein Wert wird zu einem Platzhalter wie <code>{{API_KEY_k3v9x2mq}}</code>. Jeder Platzhalter in der Antwort wird wieder zum Wert, auch in Streams und Tool-Aufrufen – der Befehl Ihres Agenten hat den echten Schlüssel.",+ "msk.cache": "Nichts geht kaputt",+ "msk.cache.p": "Ein Wert bekommt jedes Mal denselben Platzhalter, also bleiben Gespräch, Prompt-Cache und Thinking-Signaturen gültig.",+ "msk.disk": "Nie auf der Platte",+ "msk.disk.p": "Werte liegen nur im Speicher; der Verlauf behält Art, Länge und die ersten Zeichen. Kann die Maskierung nicht laufen, wird die Anfrage zurückgehalten, nie unverändert gesendet.",+ "msk.see": "Keine Blackbox",+ "msk.see.p": "Einblick › Maskierung zeigt jede geänderte Anfrage und daneben, was der Anbieter stattdessen bekam.",+ "msk.cost": "Ihre Entscheidung",+ "msk.cost.p": "Das Modell sieht den Platzhalter, nicht den Wert; für eine Aufgabe um den Wert selbst gehört er unter Nie maskieren. Wählen Sie, was maskiert wird, eigene Wörter, oder nur warnen oder blockieren.",};export const LANGS = {diff --git a/site/public/docs/ja/privacy.html b/site/public/docs/ja/privacy.htmlindex 01ced4c2d..2e35214b9 100644--- a/site/public/docs/ja/privacy.html+++ b/site/public/docs/ja/privacy.html@@ -77,6 +77,7 @@<a href="#site">usemagpie.ai に見えるもの</a><a href="#lists">magpie が取得する公開リスト</a><a href="#otel">OTLP エクスポート</a>+ <a href="#masking">プロバイダに送る内容のマスク</a><a href="#why">カウントが既定でオンの理由</a></aside>@@ -182,6 +183,21 @@<h2 id="otel"><a class="anchor" href="#otel">OTLP エクスポート</a></h2><p>magpie はゲートウェイの各リクエストを、あなたの OpenTelemetry コレクター(Langfuse など)へエクスポートできます。<b>既定ではオフ</b>で、送り先はあなたが設定したエンドポイントだけです。私たちには送りません。オンにすると、リクエストごとのスパン(エージェント、プロバイダー、モデル、トークン数、ステータス、時間、推定コスト)を送ります。別のスイッチで、メトリクス、ローカルのエージェント会話、リクエストと返答の本文(シークレットはマスク)を加えられます。<span class="ui">設定</span> → <span class="ui">オブザーバビリティ</span> でオンにするか、<code>magpie serve</code> では <code>MAGPIE_OTEL_ENABLED</code>、<code>MAGPIE_OTEL_ENDPOINT</code>、<code>MAGPIE_OTEL_HEADERS</code>、<code>MAGPIE_OTEL_METRICS</code>、<code>MAGPIE_OTEL_SESSIONS</code>、<code>MAGPIE_OTEL_BODIES</code>、<code>MAGPIE_OTEL_BODIES_WHOLE</code> を使います。エンドポイントだけではオンになりません。詳しくは<a href="https://github.com/yetone/magpie/blob/main/docs/reference.md#otlp-export">リファレンス</a>を。</p>+ <h2 id="masking"><a class="anchor" href="#masking">プロバイダに送る内容のマスク</a></h2>+ <p>ここまでの節は magpie が自分で送るものです。エージェントが送る内容は選んだプロバイダに届きますが、<b>プライバシーマスク</b>はその中の秘密をこのコンピュータに留めます。<b>既定ではオフ</b>で、<span class="ui">設定</span> → <span class="ui">プライバシー</span> でオンにします。</p>+ <figure class="figure">+ <img class="for-light" src="/img/masking-ja-light.png" width="1912" height="1038" loading="lazy" alt="観測 › マスク:7 日間でベンダーに渡さなかった値と、マスクしたリクエストごとの記録">+ <img class="for-dark" src="/img/masking-ja-dark.png" width="1912" height="1038" loading="lazy" alt="観測 › マスク:7 日間でベンダーに渡さなかった値と、マスクしたリクエストごとの記録">+ <figcaption>観測 › マスク:リクエストごとに、ベンダーに渡さなかったもの。</figcaption>+ </figure>+ <ul>+ <li>リクエストがこのコンピュータを出る前に、API キー、秘密鍵、トークン、メール、チェックサムの合うカード番号や ID 番号が <code>{{API_KEY_k3v9x2mq}}</code> のようなプレースホルダーになります。<span class="ui">ローカルモデルで検出</span> をオンにすると、このコンピュータで動くモデルが、ルールでは見つからない名前、住所、パスワードも見つけます(1.6 GB のダウンロード、CPU で動作)。</li>+ <li>応答の中のプレースホルダーは、ストリームやツール呼び出しの引数も含めて元の値に戻るので、エージェントとファイルには本物の値が残ります。</li>+ <li>同じ値はいつも同じプレースホルダーになるので、会話とプロンプトキャッシュはそのまま有効です。</li>+ <li>値はメモリにだけ置かれ、ディスク上の記録は種類、長さ、先頭の数文字だけ。マスクがオンなのに動かないときは、リクエストは 503 になり、何も送られません。</li>+ <li>モデルに見えるのはプレースホルダーで、値そのものではありません。そのまま使う必要のある値(チームのアドレス、テスト用のキー)は <span class="ui">マスクしない</span> に入れてください。</li>+ </ul>+<h2 id="why"><a class="anchor" href="#why">カウントが既定でオンの理由</a></h2><p>magpie は何十ものエージェントとプロバイダーに対応し、少人数で保守しています。毎日のカウントは、実際に使われているものを知り、それを優先して動くように保つための手段です。リリース版で既定オンなのは、自分でオンにする人の数だけでは少なすぎて、それがわからないからです。その代わり、送るものは小さく保っています。ランダムな ID、組み込みの ID、数だけです。スイッチ 1 つか <code>DO_NOT_TRACK=1</code> でオフにでき、ソースからのビルドは送らず、送るものはすべてこのページに挙げています。</p></article>diff --git a/site/public/docs/privacy.html b/site/public/docs/privacy.htmlindex 715c90a84..87623b3aa 100644--- a/site/public/docs/privacy.html+++ b/site/public/docs/privacy.html@@ -77,6 +77,7 @@<a href="#site">What usemagpie.ai sees</a><a href="#lists">Public lists magpie fetches</a><a href="#otel">OTLP export</a>+ <a href="#masking">Masking what goes to providers</a><a href="#why">Why the count is on</a></aside>@@ -182,6 +183,21 @@<h2 id="otel"><a class="anchor" href="#otel">OTLP export</a></h2><p>magpie can export each gateway request to an OpenTelemetry collector of yours (Langfuse, for example). It is <b>off by default</b>, and goes only to the endpoint you set, never to us. When on, it sends per-request spans: agent, provider, model, token counts, status, timing and estimated cost. Optional switches add metrics, local agent conversations, and the request and reply bodies (secrets masked). Turn it on in <span class="ui">Settings</span> → <span class="ui">Observability</span>, or for <code>magpie serve</code> with <code>MAGPIE_OTEL_ENABLED</code>, <code>MAGPIE_OTEL_ENDPOINT</code>, <code>MAGPIE_OTEL_HEADERS</code>, <code>MAGPIE_OTEL_METRICS</code>, <code>MAGPIE_OTEL_SESSIONS</code>, <code>MAGPIE_OTEL_BODIES</code> and <code>MAGPIE_OTEL_BODIES_WHOLE</code>. An endpoint alone doesn’t turn it on. The <a href="https://github.com/yetone/magpie/blob/main/docs/reference.md#otlp-export">reference</a> has the details.</p>+ <h2 id="masking"><a class="anchor" href="#masking">Masking what goes to providers</a></h2>+ <p>The sections above are what magpie sends by itself. What your agents send goes to the providers you chose, and <b>privacy masking</b> keeps the secrets in it on this computer. It is <b>off by default</b>; turn it on in <span class="ui">Settings</span> → <span class="ui">Privacy</span>.</p>+ <figure class="figure">+ <img class="for-light" src="/img/masking-light.png" width="1912" height="1084" loading="lazy" alt="Insights › Masking: values kept from vendors over 7 days, and each request masking changed">+ <img class="for-dark" src="/img/masking-dark.png" width="1912" height="1084" loading="lazy" alt="Insights › Masking: values kept from vendors over 7 days, and each request masking changed">+ <figcaption>Insights › Masking: what was kept from each vendor, request by request.</figcaption>+ </figure>+ <ul>+ <li>Before a request leaves this computer, API keys, private keys, tokens, emails, and card and ID numbers whose checksum adds up become placeholders such as <code>{{API_KEY_k3v9x2mq}}</code>. <span class="ui">Find with a local model</span> adds the names, addresses and passwords no rule can find, with a model that runs on this computer (a 1.6 GB download, on the CPU).</li>+ <li>Every placeholder in the reply, streamed text and tool-call arguments included, turns back into its value, so your agent and your files keep the real values.</li>+ <li>A value gets the same placeholder every time, so the conversation and the prompt cache stay valid.</li>+ <li>Values are held in memory only; the record on disk keeps each value’s kind, length and first characters. If masking is on and can’t run, the request gets a 503 and nothing is sent.</li>+ <li>The model sees the placeholder, not the value. A value a task needs as it is (a team address, a test key) goes under <span class="ui">Never mask</span>.</li>+ </ul>+<h2 id="why"><a class="anchor" href="#why">Why the count is on</a></h2><p>magpie works with dozens of agents and providers, and is maintained by a small team. The daily count is how we know which of them people actually use, so they are kept working first. It is on in releases because counts from those who turn it on would be too few to tell that. In exchange it is kept small: a random id, built-in ids, numbers; one switch or <code>DO_NOT_TRACK=1</code> turns it off, builds from source never send it, and this page lists everything that goes.</p></article>diff --git a/site/public/docs/zh/privacy.html b/site/public/docs/zh/privacy.htmlindex 0972b4b85..57d7c1b0d 100644--- a/site/public/docs/zh/privacy.html+++ b/site/public/docs/zh/privacy.html@@ -77,6 +77,7 @@<a href="#site">usemagpie.ai 能看到什么</a><a href="#lists">magpie 拉取的公开列表</a><a href="#otel">OTLP 导出</a>+ <a href="#masking">发给供应商的内容脱敏</a><a href="#why">为什么计数默认开启</a></aside>@@ -182,6 +183,21 @@<h2 id="otel"><a class="anchor" href="#otel">OTLP 导出</a></h2><p>magpie 可以把每个网关请求导出到你自己的 OpenTelemetry 收集器(比如 Langfuse)。它<b>默认关闭</b>,只发到你设置的地址,从不发给我们。开启后发送每个请求的 span:agent、供应商、模型、token 数、状态、耗时和估算费用。另有开关可以加上指标、本地 agent 对话,以及请求和回复正文(密钥已遮盖)。在 <span class="ui">设置</span> → <span class="ui">可观测性</span> 里开启,<code>magpie serve</code> 也可以用 <code>MAGPIE_OTEL_ENABLED</code>、<code>MAGPIE_OTEL_ENDPOINT</code>、<code>MAGPIE_OTEL_HEADERS</code>、<code>MAGPIE_OTEL_METRICS</code>、<code>MAGPIE_OTEL_SESSIONS</code>、<code>MAGPIE_OTEL_BODIES</code> 和 <code>MAGPIE_OTEL_BODIES_WHOLE</code>。只设地址不会开启导出。细节见<a href="https://github.com/yetone/magpie/blob/main/docs/reference.md#otlp-export">参考文档</a>。</p>+ <h2 id="masking"><a class="anchor" href="#masking">发给供应商的内容脱敏</a></h2>+ <p>上面几节讲的是 magpie 自己发出的东西。你的 Agent 发出的内容会去往你选的供应商,<b>隐私脱敏</b>让其中的密钥留在这台电脑上。它<b>默认关闭</b>,在 <span class="ui">设置</span> → <span class="ui">隐私</span> 里打开。</p>+ <figure class="figure">+ <img class="for-light" src="/img/masking-zh-light.png" width="1912" height="1038" loading="lazy" alt="观测 › 脱敏:7 天里没让厂商看到的值,以及每个被脱敏的请求">+ <img class="for-dark" src="/img/masking-zh-dark.png" width="1912" height="1038" loading="lazy" alt="观测 › 脱敏:7 天里没让厂商看到的值,以及每个被脱敏的请求">+ <figcaption>观测 › 脱敏:每个请求没让厂商看到什么。</figcaption>+ </figure>+ <ul>+ <li>请求离开这台电脑前,API key、私钥、token、邮箱,以及校验位对得上的银行卡号和证件号,会换成 <code>{{API_KEY_k3v9x2mq}}</code> 这样的占位符。打开 <span class="ui">用本地模型查找</span>,还会用一个在这台电脑上运行的模型找出规则找不到的人名、地址和密码(下载 1.6 GB,用 CPU 跑)。</li>+ <li>回复里的每个占位符,包括流式文本和工具调用参数里的,都会换回原值,所以 Agent 和你的文件里始终是真值。</li>+ <li>同一个值每次的占位符都一样,对话上下文和提示词缓存都不受影响。</li>+ <li>原值只在内存里;磁盘上的记录只留每个值的类型、长度和开头几个字符。脱敏打开却运行不了时,请求返回 503,什么都不发。</li>+ <li>模型看到的是占位符,不是值本身。任务需要原样使用的值(团队邮箱、测试用的 key)可以加进 <span class="ui">从不脱敏</span>。</li>+ </ul>+<h2 id="why"><a class="anchor" href="#why">为什么计数默认开启</a></h2><p>magpie 支持几十个 agent 和供应商,维护的人不多。每日计数让我们知道大家实际在用哪些,好先保证它们能用。正式版默认开启,是因为只靠主动开启的人,数量太少,看不出这些。作为交换,它尽量少:一个随机 ID、内置 ID 和数字;一个开关或 <code>DO_NOT_TRACK=1</code> 就能关掉,源码构建从不发送,发送的全部内容都列在这一页。</p></article>diff --git a/site/public/img/masking-dark.png b/site/public/img/masking-dark.pngnew file mode 100644index 000000000..37e534181Binary files /dev/null and b/site/public/img/masking-dark.png differdiff --git a/site/public/img/masking-ja-dark.png b/site/public/img/masking-ja-dark.pngnew file mode 100644index 000000000..343292538Binary files /dev/null and b/site/public/img/masking-ja-dark.png differdiff --git a/site/public/img/masking-ja-light.png b/site/public/img/masking-ja-light.pngnew file mode 100644index 000000000..96c3b80aaBinary files /dev/null and b/site/public/img/masking-ja-light.png differdiff --git a/site/public/img/masking-light.png b/site/public/img/masking-light.pngnew file mode 100644index 000000000..375db0e1eBinary files /dev/null and b/site/public/img/masking-light.png differdiff --git a/site/public/img/masking-zh-dark.png b/site/public/img/masking-zh-dark.pngnew file mode 100644index 000000000..990c71256Binary files /dev/null and b/site/public/img/masking-zh-dark.png differdiff --git a/site/public/img/masking-zh-light.png b/site/public/img/masking-zh-light.pngnew file mode 100644index 000000000..b5bc5d7a9Binary files /dev/null and b/site/public/img/masking-zh-light.png differdiff --git a/site/public/index.html b/site/public/index.htmlindex 364e5ebe6..a73aafd5d 100644--- a/site/public/index.html+++ b/site/public/index.html@@ -387,6 +387,7 @@ footer a:hover { color: var(--ink); }<a class="brand" href="/"><img class="bird" src="/img/magpie-small.svg" alt="">magpie</a><div class="links" id="links"><a class="hide" href="#how" data-i18n="nav.how">How it works</a>+ <a class="hide" href="#masking" data-i18n="nav.masking">Masking</a><a class="hide" href="#routing" data-i18n="nav.routing">Routing</a><a class="hide" href="#providers" data-i18n="nav.providers">Providers</a><a href="#cli">CLI</a>@@ -568,6 +569,24 @@ footer a:hover { color: var(--ink); }</div></section>+ <section id="masking">+ <p class="eyebrow" data-i18n="msk.eyebrow">Privacy masking</p>+ <h2 data-i18n="msk.h2">Your secrets never reach the vendor.</h2>+ <p class="sub" data-i18n="msk.sub">Agents put what they read into the prompt: an <code>.env</code>, a config file, a log with a token in it. magpie swaps those values for placeholders on your computer before a request leaves it, and swaps them back in the reply. Your agent and your files keep the real values; the vendor never sees them.</p>+ <div class="wide">+ <img class="for-light" loading="lazy" src="/img/masking-light.png" width="1912" height="1084" data-i18n-attr="src:img.masking.light,alt:alt.masking" alt="Insights › Masking: 5,812 values kept from vendors in 7 days, flowing from Claude Code and Codex through magpie to OpenAI, Kimi and DeepSeek">+ <img class="for-dark" loading="lazy" src="/img/masking-dark.png" width="1912" height="1084" data-i18n-attr="src:img.masking.dark,alt:alt.masking" alt="Insights › Masking: 5,812 values kept from vendors in 7 days, flowing from Claude Code and Codex through magpie to OpenAI, Kimi and DeepSeek">+ </div>+ <div class="grid" style="margin-top:32px">+ <div><h3 data-i18n="msk.find">Found two ways</h3><p data-i18n="msk.find.p">Rules for what is certain: API keys, private keys, tokens, emails, card and ID numbers whose checksum adds up. And, if you want it, a model that runs on this computer for the names, addresses and passwords no rule can find.</p></div>+ <div><h3 data-i18n="msk.back">Put back everywhere</h3><p data-i18n="msk.back.p">A value becomes a placeholder like <code>{{API_KEY_k3v9x2mq}}</code>. Every placeholder in the reply turns back into its value, in streamed text and tool calls too, so the command your agent runs has the real key.</p></div>+ <div><h3 data-i18n="msk.cache">Nothing breaks</h3><p data-i18n="msk.cache.p">A value gets the same placeholder every time, so the conversation, the prompt cache and thinking signatures stay valid.</p></div>+ <div><h3 data-i18n="msk.disk">Never on disk</h3><p data-i18n="msk.disk.p">Values are held in memory only; the record keeps a value’s kind, length and first characters. If masking can’t run, the request is held back, never sent as written.</p></div>+ <div><h3 data-i18n="msk.see">Not a black box</h3><p data-i18n="msk.see.p">Insights › Masking lists every request it changed, with what the vendor got instead, side by side.</p></div>+ <div><h3 data-i18n="msk.cost">Your call</h3><p data-i18n="msk.cost.p">The model sees the placeholder, not the value, so a task about a value itself needs it under Never mask. Pick what to mask, add your own words, or warn or block instead.</p></div>+ </div>+ </section>+<section id="subscriptions"><p class="eyebrow" data-i18n="subs.eyebrow">Subscriptions, shared</p><h2 data-i18n="subs.h2">The plans you pay for, in every agent.</h2>