Claude Code Put Your Account Email in User-Agent? How to Upgrade the 2.1.317+ Privacy Mod, Self-Check, and Read Logs

Per GitHub #107757 and HN reports, Claude Code sometimes wrote the signed-in account email into User-Agent on curl-style calls. 2.1.317+ ships cc-plugin-privacy; this guide covers upgrade, plugin confirm, log self-check, coverage limits, and a local version-check timing.

5 分钟阅读
Claude Code Put Your Account Email in User-Agent? How to Upgrade the 2.1.317+ Privacy Mod, Self-Check, and Read Logs

Per GitHub anthropics/claude-code#107757 and user reports, Claude Code sometimes put the signed-in account email into the User-Agent of networked or shell tool calls. Reporter taylor-edwards (macOS, about 2.1.318) said phishing and scam mail followed. On Hacker News, a Claude Code engineer explained the email was added to model context to reduce @author-style hallucinations; when the model wrote curl, it sometimes used that address as a contact.

Takeaways:

  • Upgrade to 2.1.317 or newer now. Per the HN staff reply, the stable channel may still sit on an older build (for example 2.1.311) without the built-in privacy mod.
  • Confirm cc-plugin-privacy is enabled. Per a GitHub contributor, the built-in mod is on by default and can be toggled in /plugins.
  • Per the official README: the mod only blocks one shape—Bash / PowerShell / Monitor input that holds the account email and names a User-Agent. It does not check WebFetch, WebSearch, or MCP; URL/body/From:/curl -u without a UA word also pass.
  • Self-check logs: search session transcripts and proxy logs for your email plus User-Agent / curl -A / wget -U.
  • If already exposed: rotate related credentials, watch the inbox, and give the agent a public role mailbox instead of a personal address.
  • Codex, Cursor, and peers share the same context-hygiene lesson; this post focuses on Claude Code upgrade and self-check without pushing one client.

Create API Key →

What happened (per public reports)

SourceGist
GitHub #107757Users reported email in User-Agent during web-related requests, then scam mail
Hacker NewsEngineer: email will leave model context; until then use 2.1.317+ built-in mod
Official mods/privacy READMEcc-plugin-privacy: a courtesy, not a boundary; one shell shape
DEV write-upThird-party summary: stable may lag the guarded build—upgrade deliberately

Per HN: some sites (Wikimedia, SEC EDGAR, and similar) ask scripted clients for a contact in User-Agent; if the only contact in context is your account email, the model may fill it in. Not framed as an intentional leak feature—same outcome for third parties.

Related checks: Claude Code Auto Mode Gateway 403/422, Postman plugin self-check, VS Code extension backdoor check.

Upgrade to 2.1.317+

Check the local build first:

bash
claude --version
# need >= 2.1.317; upgrade if lower

Local version check took about 1 second here (example output: 2.1.316 (Claude Code)—below the floor, so upgrade).

Common upgrade paths (pick your install channel):

bash
# latest channel: pull newest
claude update

# native install pinned version (example)
curl -fsSL https://claude.ai/install.sh | bash -s 2.1.317

# Homebrew: the claude-code cask often tracks stable; switch to latest when you need the guard
brew uninstall --cask claude-code
brew install --cask claude-code@latest

Per HN / third-party notes: claude update may not move a Homebrew install; apt/dnf/apk pinned to stable can lag too. You can set a floor in settings.json (per docs, auto-update / claude update refuse builds below it):

json
{
  "autoUpdatesChannel": "stable",
  "minimumVersion": "2.1.317"
}

Run claude --version again and confirm ≥ 2.1.317.

Create API Key →

Confirm the privacy plugin cc-plugin-privacy

Per the GitHub contributor: 2.1.317+ ships a built-in mod named cc-plugin-privacy, on by default, switchable via /plugins.

In a Claude Code session:

  1. Open /plugins
  2. Find cc-plugin-privacy under Installed / builtin
  3. Confirm it is enabled (do not turn it off by mistake)

Per the official README, these turn it off or bypass it:

  • /plugin disable, or "cc-plugin-privacy@builtin": false under enabledPlugins in user / --settings / managed settings (repo settings cannot)
  • A server-side switch read once per session
  • Another installed plugin’s tool.check hook sitting above and overruling the refusal
  • Sessions where the hooks module never loads / hooks/register.ts does not run

Per official README: what it blocks and what it misses

One line from the README: this is a courtesy, not a boundary, and it covers one shape.

Refused (no prompt): a Bash, PowerShell, or Monitor call whose input holds the session account email and names a User-Agent. Naming includes USER_AGENT_WORD (for example User-Agent, user_agent, --user-agent, -UserAgent, UA=) and CLIENT_FLAGS (for example curl -A, wget -U, plus PowerShell-related -User). Refusal raises no confirm dialog; saved allow rules and auto-mode classifiers do not clear it.

Still passes (per official README):

  • The address with no User-Agent named: URL, request body, curl -u, From: header
  • WebFetch, WebSearch, and MCP tools are not checked
  • Runtime-computed addresses (for example expanding git config user.email), variables, scripts sent by filename, unnamed clients, other encodings

So: upgrade + plugin is damage control, not “email never leaves.” The lasting fix, per the HN engineer, is removing the account email from model context in a later release.

Log / self-check steps

  1. Version: claude --version ≥ 2.1.317
  2. Plugin: /plugins shows cc-plugin-privacy enabled
  3. Transcripts: search ~/.claude/projects/**/*.jsonl (path may vary) for your email, User-Agent, curl -A, wget -U
  4. Proxy / egress: filter the same keywords on local HTTPS proxy or company egress logs for recent Claude Code traffic
  5. Already exposed: rotate tokens/sessions that may be abused; tighten inbox filters; put a public role contact in project instructions so personal mail stays out of outbound context

Per user reports: even when the plugin shows loaded, some environments still let through a documented local echo test—treat the official README boundary as ground truth, keep watching the GitHub thread, and do not rely on a single UI checkbox.

How to read this next to other clients

Privacy tracks what sits in context, not a brand name:

  • Claude Code: upgrade to 2.1.317+, confirm cc-plugin-privacy, self-check logs as above
  • Codex / Cursor: keep personal email and secrets out of instructions that can trigger network tools; prefer a role mailbox or redacted contact

If you need a third-party Key across clients, register here and follow each client’s docs (Claude Code / Codex / Cursor all work).

Create API Key →

FAQ

Still on an old build after upgrading stable?

Per HN: stable can lag by about a week. Switch to latest, pin via the install script, or set minimumVersion, then re-check claude --version.

Changelog says “asks,” README says refuse?

Per the official README source: matching shell calls are refused with no prompt. When changelog wording disagrees with the README, follow the public README / source.

Can I just disable the plugin?

No. Turning off cc-plugin-privacy removes this deterministic layer. Upgrade, keep it on, and wait for the context-removal release.

Can WebSearch still carry the email?

Per the official README: WebFetch / WebSearch / MCP are outside this mod. Do not assume upgrade alone ends outbound email; keep self-checking and minimize personal email in context.

Wrap-up

Per GitHub, HN, and the official privacy README: Claude Code put the login email into model context, and the model sometimes wrote it into User-Agent. Upgrade to 2.1.317+, confirm cc-plugin-privacy in /plugins, learn the README coverage limits, and search transcripts/proxy logs. Local claude --version took about 1 second here. If the email already hit third parties, rotate credentials and switch to a public contact address.

Create API Key →

Related: Claude Code Auto Mode 403/422 · Postman plugin check · VS Code extension backdoor check

相关文章

What is the UI SDK, and how do you use it? Vercel and shadcn's behavior library for agents, installed and tested in Claude Code / Codex / Cursor (0.1.0-beta.1)

What is the UI SDK, and how do you use it? Vercel and shadcn's behavior library for agents, installed and tested in Claude Code / Codex / Cursor (0.1.0-beta.1)

The UI SDK is Vercel's behavior library for agents, released on 12 November 2026 as 0.1.0-beta.1. Behaviors live in the framework-free @ui-sdk/core package and are rendered by adapters for React, Vue, Svelte, Solid, and Web Components. This guide follows the official docs on what it is, how to install it, and how to add the skill for Claude Code, Codex, and Cursor, and it records the commands, timings, and output from our test machine.

What Is AWS Emulator and How Do You Install It? Test AWS Apps Locally with Claude Code and Codex (Tested on 1.0.322)

What Is AWS Emulator and How Do You Install It? Test AWS Apps Locally with Claude Code and Codex (Tested on 1.0.322)

AWS Emulator is AWS's official local emulator of its service APIs, generally available since November 11, 2026 (US time). It has no additional service fee, its source is open, it needs no AWS account, and it covers more than 200 services. We tested version 1.0.322 on Debian 13. This guide covers the install commands, pointing the AWS CLI at the local endpoint to create an S3 bucket and a DynamoDB table, the errors we hit, and how to let Claude Code, Codex and Cursor write and test code against the emulator.

What Is T3 Code and How Do You Install It? Connect Claude Code and Codex, Use a Third-Party API Key, Fix Common Errors (Tested on 0.1.9)

What Is T3 Code and How Do You Install It? Connect Claude Code and Codex, Use a Third-Party API Key, Fix Common Errors (Tested on 0.1.9)

T3 Code is pingdotgg's open-source control surface for coding agents. It ships no model of its own; it drives the Claude Code, Codex, Cursor and other CLIs already on your machine. We tested T3 Code 0.1.9 on Linux. This guide covers the install commands, how to point Claude Code and Codex at an AICodeWith API Key so T3 Code can drive them, a full run of both agents with the t3 thread command, and the errors we hit along the way with their fixes.