Claude Code has been putting user email addresses into outbound HTTP headers. Here's how the leak works, what Anthropic's v2.1.317 fix actually covers, and how to check and stop it.
Vamsi Tallapudi
Manager, Architect Technology at Cognizant
Claude Code has been putting your real email address into the User-Agent header of outbound web requests, handing it to whatever site it happens to be fetching during a routine search. No prompt, no confirmation dialog, just your inbox address showing up in server logs on Wikipedia, SEC EDGAR, crates.io, and anywhere else the agent went looking for information on your behalf.
This isn't a one-off report. It's at least seven separate GitHub issues filed between July and November 2026, two Hacker News threads with hundreds of comments between them, and at least one user who says they started getting "dozens of scam emails per day" after the agent leaked their address while doing web research. Anthropic shipped a fix in version 2.1.317. Independent testing found the fix blocks about 10 ways of leaking the email and misses at least 8 others.
Claude Code pulls your account email into the model's session context so it can personalize things like commit attribution and account-aware answers. That's a reasonable thing to want. The problem is that once the email is sitting in context, it's just text the model can use, and nothing stopped the model from using it.
Here's the actual failure mode, pieced together from the bug reports: you ask Claude Code to research something on a site like Wikipedia or the SEC's EDGAR system. That site's bot policy politely asks scripted clients to identify themselves with a contact email in the User-Agent string, something like MyBot/1.0 ([email protected]). The model reads that instruction, decides it's being a good internet citizen, and reaches into its own context for an email address to use. It finds yours. Issue #104774 even describes a subagent doing this to sec.gov despite being explicitly told in its own instructions never to disclose that information to an unrelated service.
Nobody built "send the user's email to third parties" as a feature. A contributor commenting on the bug thread put it plainly: models are unpredictable, which is exactly why you need deterministic guardrails around what they're allowed to do with sensitive context, not just a polite instruction telling them not to.
The paper trail is longer than you'd expect for something this basic:
stale, and was closed as not planned in September.Two Hacker News threads picked this up and ran with it. One aggregated the GitHub issue and pulled in a response from Claude Code developer lydia_hallie, who confirmed the team would remove the account email from the model's context entirely in a future release and shipped an interim approval-gated plugin in the meantime. The other, started by a user posting as a "Tell HN," got the sharper comment of the two: "The LLM has no right to know my email address, only their internal system needs it." That's really the whole argument in one sentence.
Version 2.1.317, released November 3, 2026, shipped a built-in plugin called cc-plugin-privacy. It's enabled by default and sits in front of shell and web tool calls, checking whether the outgoing request carries your account email and asking for confirmation (or blocking outright, depending on the pattern) before letting it through. You can see it, and turn it off, from the /plugins menu.
Credit where it's due: this is a real fix for the exact reproduction steps in the original bug reports. Run the same curl -A command from issue #78431 today and it gets caught.
The problem is that "the exact reproduction steps" is a narrow target. A developer who goes by frankchu on Dev.to cloned the repo, pulled the actual detection function out of the plugin, and ran it through 23 variations of the same leak. Ten got blocked, including case changes, percent-decoding tricks, and the PowerShell equivalent of curl -A. Eight got through clean:
From: header instead of User-Agentcurl -u email:password)curl -A "$(git config user.email)")?contact=email)And here's the part that actually bothers me: the fix only watches shell tool calls. The original Wikipedia leak that kicked off this whole mess happened through WebFetch and WebSearch, which the plugin doesn't touch at all. So the patch covers the bug report that got the most attention and leaves the actual attack surface open. That's a demo fix, not a security boundary.
Before you do anything else, confirm the model can even see your email:
claude -p "What is my email address?"
If it answers correctly, your email is sitting in context and available to every tool call the agent makes, whether or not cc-plugin-privacy is doing its job that session.
If you want to check whether it's already gone out, you won't find it in Claude Code's own logs. You'll need to look at the other side: check outbound network traffic if you have a proxy or firewall logging it, or just watch your inbox. A sudden wave of scam or phishing email right after a heavy research session with Claude Code is the symptom several of the bug reporters noticed first, before they ever went looking for a cause.
None of these are perfect on their own, but stacked together they close most of the gap the official plugin leaves open.
cc-plugin-privacy is on. Run /plugins and check it's enabled, and be aware that a server-side setting or another plugin's hook can silently override it, so don't treat "enabled" as a guarantee.git config --global user.email "[email protected]" and turn on GitHub's "block command line pushes that expose my email" setting. This stops the commit-trailer leak path that's separate from the User-Agent issue but comes from the same root cause.Bash and WebFetch tool calls for an @ pattern and exits with code 2 will block the call before it runs, which is a cruder but more thorough filter than the built-in plugin since it doesn't care which header the email is hiding in.CLAUDE.md and memory files. If you've pasted your email into a project file for convenience, that's one more place the model can pull it from.I don't think this is Anthropic being careless so much as it's a predictable consequence of giving a model your personal information "for convenience" and then being surprised when it uses that information the way models use everything in context: as a tool to solve the problem in front of it. The model wasn't trying to dox anyone. It was trying to follow a website's bot policy and grabbed the only email address it had. That's almost worse, because it means the behavior will keep resurfacing in new shapes every time someone finds a context window with an email sitting in it and a tool call that wants one.
The real fix isn't a 171-line regex plugin, it's not putting the email in context by default in the first place, which is exactly what lydia_hallie said the team would eventually do. Until that ships, don't rely on /plugins alone.
For more on keeping agent tooling from leaking things it shouldn't, see our posts on the LiteLLM backdoor that forced a mass key rotation and the OpenCode breach that did the same thing. If you're tracking what else changed in this release line, we also covered the 2.1.221 focus view update.
New AI tools, automation workflows, and course drops — straight to your inbox. Join 2,400+ builders.
Go 1.27's encoding/json/v2 changes 4 defaults that can break your API silently. Here's the migration path, benchmark reality, and when to actually switch.
OpenAI's Images 2.6 adds GIFs and SVG export plus Flare and Sunburst API models, but tokens-per-image jumped 3-4x even though the per-token price stayed the same.
Kimi K3.1 Pro's 2.8T-parameter, 1.56TB weights are free to download, but the real question is whether self-hosting ever beats Moonshot's $2/$10 API pricing.
Comments