Cao! · 槽点

Claude Code偷偷
在Prompt里打小报告

Claude Code Secretly
Snitches in Your Prompts

开发者发现Claude Code在系统提示里用肉眼看不见的Unicode字符做隐写标记,专门检测亚洲时区和中国AI公司域名。主打“AI安全”的Anthropic,在隐私问题上翻了车。

A developer discovered Claude Code using invisible Unicode characters as steganographic markers in system prompts, specifically detecting Asian time zones and Chinese AI company domains. Anthropic, which brands itself on "AI safety," crashed and burned on privacy.

No.006 2026.07.01 约 4 分钟阅读 ~4 min read

朋友们,今天这个AI翻车故事,精彩程度可以写进《2026年AI工具迷惑行为大赏》。

事情是这样的。一位开发者出于隐私考虑,检查了自己本地安装的Claude Code(v2.1.196)二进制文件——毕竟这东西有文件系统权限、能执行shell命令、能操作git,权限大得吓人,检查一下是应该的。

结果不查不知道,一查吓一跳:Claude Code在发给模型的系统提示里,偷偷嵌入了肉眼几乎看不见的隐写标记

怎么打的小报告

手法相当“精妙”。

Claude Code的系统提示里有一句日期字符串,正常看起来是“Today’s date is 2026-07-01”这种无聊内容。但Claude Code会偷偷改变两个东西:一是“Today’s”里的撇号(apostrophe),二是日期分隔符(把-改成/)。这些变化用了四种不同的Unicode字符——普通撇号、右单引号(U+2019)、修饰符字母撇号(U+02BC)、另一种变体(U+02B9)——在等宽字体里你根本看不出区别,但后端可以据此解码出信息

它检测什么?两个条件:第一,你的系统时区是不是Asia/Shanghai或Asia/Urumqi;第二,你的ANTHROPIC_BASE_URL(API地址)指向的域名是不是在一个秘密列表里。

这个域名列表被XOR加密和base64编码藏在二进制文件里,解码后包含什么?大量中国企业域名、AI公司域名、代理/网关/中转域名。关键词列表包括deepseek、zhipu(智谱)等中国AI实验室的名字。

翻译成人话:如果你在中国时区用Claude Code,或者你把Claude Code接到了第三方API中转/代理/兼容服务上,它就在发给Anthropic的系统提示里偷偷打个标记——“注意,这个用户可能在通过非官方渠道使用我们的服务”。

为什么开发者炸了

你可能会说:公司检测API滥用不是很正常吗?

正常,但方式不正常。

检测API滥用有一万种正大光明的方式:在请求头里加个明确的标识字段、在文档里说明检测策略、在发布说明里告知用户、在遥测设置里让用户选择是否参与。但Anthropic选择了最让人不舒服的一种:在用户看不到的地方,用隐写术往Prompt里塞标记

正如作者所说:“如果客户端想检测自定义API网关,大可以明说。可以发一个明确的遥测字段并附上文档。可以让策略可见。可以写在发布说明里。把信号藏在系统提示的标点符号里,只会让其他所有隐私声明都变得难以相信。”

更讽刺的是,Claude Code和Anthropic一直主打“安全”“可信”“负责任AI”的人设。Dario Amodei频繁公开谈论AI安全和伦理,公司把“构建有益、无害、诚实的AI”挂在嘴边。结果呢?一个拥有你文件系统和shell权限的工具,在你看不见的地方偷偷做分类标记。

"当一个有文件系统和shell权限的工具,开始在看不见的标点符号里藏分类标记,正确的反应是审视。信任是在无聊的细节里earned的。" —— 文章作者 thereallo

而且这个检测的“防绕过”能力也很弱——改主机名、改时区、patch二进制、包装进程,任何一个稍微认真的对手都能绕过。最后被惩罚的是谁?是正常使用内部网关、本地代理、模型路由做合法事情的开发者。

HN上1644个点赞、471条评论,热评第一说得好:“如果你的产品需要靠隐写术来保护商业模式,那你的商业模式本身就有问题。”

最后说一句:这事儿说大不大说小不小。Anthropic完全可以发个补丁,把标记方式改成公开的遥测字段,这事就过去了。但对开发者来说,这是一个提醒——

温馨提示:

1. 给AI编程工具的权限要最小化,别动不动就给全仓库访问和sudo权限。

2. 敏感项目不要用联网的AI工具,本地模型+离线环境才是正道。

3. 任何跟你说“我们绝对保护隐私”的AI工具,都值得留个心眼——毕竟,你看不见它在你Prompt里塞了什么。

今天就槽到这里,明天继续。

Folks, today's AI faceplant story is spectacular enough to earn a chapter in the 2026 Compendium of AI Tool Baffling Behavior.

Here's what happened. A developer,出于 privacy concerns, inspected the binary of his locally installed Claude Code (v2.1.196) -- after all, this thing has filesystem permissions, can execute shell commands, can operate git; its privileges are terrifyingly broad, so checking it is only reasonable.

What he found was jaw-dropping: Claude Code had secretly embedded nearly invisible steganographic markers in the system prompts sent to the model.

How the Snitching Worked

The technique was rather "ingenious."

Claude Code's system prompts contain a date string, normally something boring like "Today's date is 2026-07-01." But Claude Code secretly alters two things: first, the apostrophe in "Today's," and second, the date separator (changing - to /). These changes use four different Unicode characters -- regular apostrophe, right single quotation mark (U+2019), modifier letter apostrophe (U+02BC), and another variant (U+02B9) -- in a monospace font you can't tell the difference at all, but the backend can decode information from them.

What does it detect? Two conditions: first, whether your system timezone is Asia/Shanghai or Asia/Urumqi; second, whether the domain your ANTHROPIC_BASE_URL points to is on a secret list.

This domain list is hidden in the binary using XOR encryption and base64 encoding. What does it contain after decoding? A large number of Chinese enterprise domains, AI company domains, and proxy/gateway/relay domains. The keyword list includes names of Chinese AI labs like deepseek and zhipu.

In plain English: if you use Claude Code in a Chinese timezone, or if you connect Claude Code to a third-party API relay/proxy/compatible service, it secretly drops a marker in the system prompt sent to Anthropic -- "heads up, this user might be using our service through unofficial channels."

Why Developers Lost It

You might be thinking: isn't it normal for a company to detect API abuse?

Normal, yes. But the method isn't.

There are ten thousand above-board ways to detect API abuse: add an explicit identifier field in request headers, document the detection strategy, inform users in release notes, let users opt in via telemetry settings. But Anthropic chose the most uncomfortable approach: hiding markers in Prompts using steganography where users can't see them.

As the author put it: "If the client wants to detect custom API gateways, it could just say so. It could send an explicit telemetry field with documentation. It could make the policy visible. It could write it in release notes. Hiding signals in punctuation within system prompts only makes every other privacy claim harder to believe."

What makes it more ironic is that Claude Code and Anthropic have always branded themselves on "safety," "trustworthiness," and "responsible AI." Dario Amodei frequently speaks publicly about AI safety and ethics; the company talks about "building beneficial, harmless, and honest AI." The result? A tool with your filesystem and shell permissions secretly doing classification markers where you can't see them.

"When a tool with filesystem and shell permissions starts hiding classification markers in invisible punctuation, the correct response is scrutiny. Trust is earned in the boring details." -- thereallo, article author

Moreover, the detection's "anti-circumvention" capability is weak -- change hostname, change timezone, patch the binary, wrap the process; any moderately determined adversary can bypass it. Who ends up penalized? Developers legitimately using internal gateways, local proxies, and model routers for lawful purposes.

1,644 upvotes and 471 comments on HN; the top comment nails it: "If your product needs steganography to protect its business model, there's something wrong with your business model."

One last thought: this isn't a huge scandal nor is it trivial. Anthropic could easily ship a patch changing the markers to public telemetry fields and this would blow over. But for developers, it's a reminder --

Friendly reminder:

1. Minimize permissions given to AI coding tools; don't hand out full repo access and sudo privileges casually.

2. Don't use internet-connected AI tools for sensitive projects; local models + offline environments are the way to go.

3. Any AI tool that tells you "we absolutely protect your privacy" deserves a healthy dose of skepticism -- after all, you can't see what it's stuffing into your Prompts.

That's the Roast for today. We'll be back tomorrow.

当一个有文件系统和shell权限的工具,开始在看不见的标点符号里藏分类标记,正确的反应是审视。信任是在无聊的细节里earned的。

—— 文章作者 thereallo

When a tool with filesystem and shell permissions starts hiding classification markers in invisible punctuation, the correct response is scrutiny. Trust is earned in the boring details.

-- thereallo, article author
温馨提示:1. 给AI编程工具的权限要最小化,别动不动就给全仓库访问和sudo权限。2. 敏感项目不要用联网的AI工具,本地模型+离线环境才是正道。3. 任何跟你说“我们绝对保护隐私”的AI工具,都值得留个心眼。
Friendly reminder: 1. Minimize permissions given to AI coding tools; don't hand out full repo access and sudo privileges casually. 2. Don't use internet-connected AI tools for sensitive projects; local models + offline environments are the way to go. 3. Any AI tool that tells you "we absolutely protect your privacy" deserves a healthy dose of skepticism.
Claude Code隐写术 · AI工具隐私 · Unicode水印 · 开发者信任
Claude Code Steganography · AI Tool Privacy · Unicode Watermarks · Developer Trust
Sources · 信源 Sources

本文基于 Dawn Vision 认知引擎处理的公开信息整理,素材来源:thereallo.dev、Hacker News。

Compiled by Dawn Vision's cognitive engine from public information. Sources: thereallo.dev, Hacker News.