Claude Code has been putting the signed in account email into User-Agent headers on outbound web requests, without asking first. Anthropic shipped a built in privacy mod in 2.1.317 and says a later release will stop putting the account email into model context. Until that lands, update past 2.1.317, leave cc-plugin-privacy enabled, and treat the mod as a courtesy: add your own hook, CLAUDE.md rule, or network sandbox if the address must stay off the wire.

The bug report that blew up on November 5 is anthropics/claude-code#107757. The Hacker News thread passed 1,200 points within a day. Anthropic engineers answered there and on the issue: the email was injected into context on purpose for authorship tags, the model sometimes reused it as a contact on sites that ask scripted clients to identify themselves, and the durable fix is to remove the address from context. This guide sticks to those primary sources plus the Claude Code changelog and the public privacy mod source.

What happened: email in the User Agent

Claude Code is Anthropic's coding agent (tool page). For signed in users it has been placing the account email into the model context so Claude can fill @author style fields without inventing a name. An earlier changelog note (still listed in the history) told the model to use that email only to identify you, and not to send it to unrelated services unless you ask. That instruction was not enough.

When a site or API asks scripted clients for a contact in the User Agent, the model often complied with the only address it had. Common shapes look like:

curl -A "my-session/1 you@example.com" https://example.com/data
curl -A "ResearchBot/1.0 (you@example.com)" https://example.com/api

Reporters saw this on research fetches, SEC EDGAR style APIs, Wikipedia style policies, game APIs, and ordinary curl calls written by subagents. The leak is model chosen header text, not a fixed networking layer that stamps every request. That still means any site the agent hits can log the address.

Lydia Hallie of the Claude Code team wrote on Hacker News that the team added the account email after users complained about hallucinated names in authorship tags, that the next release will remove it from context (aimed for early the week of November 9, 2026), and that until then 2.1.317 and later carry a built in mod that asks before a web or shell tool call sends the account email. Keep that date as a stated plan, not a guarantee, until the changelog records it.

Why sites ask for a contact in User Agent

Two policies show up again and again in these reports.

SEC EDGAR. The SEC asks automated clients to declare a User Agent with a company name and contact address, and it documents sample headers on its accessing EDGAR data page. On November 6 we hit data.sec.gov with three agents: bare curl got HTTP 403, a contact style User Agent got 200, and a plain Mozilla/5.0 User Agent also got 200. So the gate is real, but "any non empty client string" often works; an email is not strictly required for every path.

Wikimedia. The Wikimedia Foundation User Agent Policy asks scripted clients to identify themselves with a way to contact the operator (email, website, or wiki username) and says generic or empty agents can get HTTP 403.

HTTP itself has a related From header rule in RFC 9110: a user agent should not send contact identity without explicit user configuration. Claude Code's model behavior skipped that consent step.

None of this makes the leak "correct." A coding agent should ask you which contact (if any) to send, or use a generic client name and stop when the site refuses.

What Anthropic shipped in 2.1.317

The changelog for 2.1.317 includes: "Added a check that asks before a web or shell tool call sends your account email address to the network." Latest npm at the time we checked was 2.1.318.

The built in plugin id is cc-plugin-privacy@builtin. You can inspect it with:

claude --version
claude plugin details cc-plugin-privacy@builtin

On a fresh 2.1.318 install without a signed in session, plugin details showed the privacy plugin as built in, with a description that it asks before a shell or web tool runs with the signed in account email. Leave it enabled in /plugins. Do not disable it to "reduce friction."

What the published privacy mod actually checks

Anthropic published the mod under mods/privacy. The README is blunt: this is a courtesy, not a boundary, and it covers one shape.

It registers a tool.check hook on shell tools (Bash, PowerShell, Monitor). If the call text holds the account email (any case, or one pass of percent encoding) and looks like it names a User-Agent (User-Agent, --user-agent, curl -A, wget -U, and related PowerShell forms), the call is refused. The refusal text tells the model to retry without the address or to split the work into separate calls. A saved allow rule and auto mode do not clear that refusal, per the README.

What the same README says still passes:

  • The address with no User Agent word: a URL, a request body, curl -u, a From: header
  • WebFetch, WebSearch, and MCP tools (not checked)
  • Values built at run time ($(git config user.email)), variables, files, scripts that embed the address, clients not on the list, other encodings

Issue comments on #107757 also report machines on 2.1.317 or 2.1.318 where the mod was listed as loaded but simple echo or curl -A probes with the account email were not refused. Treat the mod as helpful when it fires, not as proof the address cannot leave.

How to stop Claude Code leaking your email today

Do these in order. The first two are cheap. The rest close the gaps the mod leaves open.

1. Update Claude Code past 2.1.317

claude update
# or
npm install -g @anthropic-ai/claude-code@latest
claude --version

Stable channel users were still on 2.1.311 when Lydia Hallie posted; move to 2.1.317 or newer on purpose. Confirm cc-plugin-privacy is enabled under /plugins.

2. Add a CLAUDE.md rule that forbids outbound identity

Project or user instructions still help when the model is choosing headers. A concrete rule many people are sharing looks like this:

## Outbound identity

- Never put my account email, git email, or real name in a User-Agent, From header, URL, query string, or request body unless I name the exact host and approve it in this turn.
- If a site asks for a contact, stop and ask me. Prefer a generic client name such as `claude-code-research/1.0` with no email.
- Do not read `git config user.email` or `~/.claude.json` to invent a contact.

This is guidance for the model, not a kernel. Pair it with a deterministic check.

3. Add your own PreToolUse or tool.check hook

If you already write Claude Code mods or hooks, put a hard deny on shell and web tools whose input contains your addresses. Community options reported in the #107757 thread include custom PreToolUse hooks and open source guards such as whoami-guard (Claude Code and Codex). Review any third party hook the same way you would review a mod: it runs with your user rights.

A minimal self written check only needs: your email list (account, git, aliases), a match on shell or web tool input, and a deny when a User Agent shaped flag or header is also present. Log the deny without logging the address.

4. Prefer a network sandbox for research heavy sessions

Claude Code's own shell sandbox does not cover every egress path. For jobs that browse or call APIs, run the agent inside a container or policy sandbox with an allow list. Our compares of E2B vs Daytona vs Modal and NVIDIA OpenShell cover hosted and local options. OpenShell's default policy is no outbound network until you approve it, which stops accidental contact headers cold.

5. Use a unique email for the Claude account

If the account email is an alias you never use elsewhere, a leak is still a leak, but the blast radius for spam and correlation drops. Do not assume aliasing replaces an update or a hook.

6. Audit recent transcripts if you care what already left

Session logs under ~/.claude/projects/ record tool calls. Searching those JSONL files for your address next to User-Agent, -A, or WebFetch shows where the model already sent it. Rotate anything tied to that address if a sensitive host appears in the list.

Privacy mod vs a real harness boundary

This incident is a harness lesson, not only a Claude Code footnote. An agent harness wraps a model with tools, context, and permissions. Putting durable identity into that context without an egress policy is how "be helpful on Wikipedia" becomes "introduce you to every log that asked for a contact."

ControlStops email in curl User Agent?Stops WebFetch or MCP?Notes
Model instruction in changelog or CLAUDE.mdSometimesSometimesSoft; fails under tool pressure
cc-plugin-privacy (2.1.317+)Aimed at shell User Agent shapesNo, per its READMECourtesy; reports of misses exist
Custom PreToolUse / tool.check hookYes, if you match your stringsYes, if you include those toolsYou maintain the allow list
Container or OpenShell style network policyYes (no route)Yes (no route)Strongest default deny
Remove email from model context (promised)Removes the easy sourceRemoves the easy sourcegit email and files can still teach it

Open source harnesses such as OpenCode and OpenAI Codex are not magically immune: if you put identity in context and allow network tools, the same pattern can appear. The fix pattern stays the same: keep PII out of context, and enforce egress outside the model.

How this differs from the Cursor extension compromise

In late October, tampered Claude Code extension builds in Cursor's marketplace planted an SSH backdoor. That was malware on a supply chain path. This November email issue is unwanted model behavior plus context design. Both matter for anyone running Claude Code with network tools, and both reward the same habit: assume the agent can reach anything your user can, then add deterministic gates. Our earlier guide covers the compromised extension cleanup.

FAQ

Does Claude Code still send my email in User Agent headers?

It can, on builds before 2.1.317, and it can still slip through gaps the privacy mod does not cover (WebFetch, WebSearch, MCP, scripts, runtime built addresses). Update, keep cc-plugin-privacy on, and add a hook or sandbox if the address must not leave.

What version fixed the Claude Code email User Agent leak?

There is no single complete fix yet. 2.1.317 added the privacy check. Anthropic says a following release will remove the account email from model context. Watch the changelog for that entry before you treat the issue as closed.

How do I turn on cc-plugin-privacy?

On 2.1.317 or later it is a built in plugin enabled by default. Open /plugins, find cc-plugin-privacy, and leave it on. You can also run claude plugin details cc-plugin-privacy@builtin. Turning it off is possible in user settings; do not do that for normal work.

Is this a GDPR breach?

We are not lawyers. Unauthorized disclosure of an email address to third party sites is the kind of event privacy teams review under GDPR and similar laws. If you operate in the EU or UK, talk to your counsel or DPO and preserve logs. This guide does not give legal advice.

Will removing the email from context fully solve it?

It removes the easy source. The model can still read git log, git config user.email, commit trailers, README contact lines, or secrets files if those tools are allowed. Keep outbound hooks or a network allow list if identity must stay private.

Should I stop using Claude Code until the context change ships?

That is a risk call. Many teams will keep working with 2.1.317+, the privacy mod, a CLAUDE.md rule, and a deny hook or sandboxed network. If your threat model forbids any accidental PII egress, pause network capable sessions or move them into a locked down sandbox until you verify the context change in the changelog.

What to watch next

  1. Changelog entry that removes account email from model context
  2. Whether cc-plugin-privacy gains WebFetch, WebSearch, and MCP coverage
  3. Follow ups on #107757 about hosts where the mod is loaded but does not refuse

For broader agent security habits, see Claude Code mods (built in mods and how to vet them), keeping secrets out of Claude Code settings.local.json (where Don't ask again approvals are saved), background agent permissions, and what an agent harness is.