Skip to main content
November 15, 2026

Claude Code Put Your Email in a User-Agent: Mapping Agent Egress

Claude Code Email Leak: What Your Agent Sends to Sites

On November 5, 2026, a user opened issue #107757 on the Claude Code repository: "claude code divulged my email to arbitrary 3rd parties in the User-Agent request header while conducting web searches without my permission." The report was on version 2.1.318 for macOS. It now has more than a hundred comments and close to 800 thumbs-up.

It was not the first report. Issue #101659, opened on October 13 against version 2.1.285, shows the mechanism. A research subagent ran curl against liquipedia.net with -A "ThaneholdResearch/1.0 (<user email>)". The report says the model added a contact because "Liquipedia asks API clients for one in the User-Agent." The site returned 403. Nobody asked the model to identify the user. It saw an address in its context, saw a site that wanted a contact, and connected the two.

The email is the small part of the story. The lesson is that anything in the model's context can end up in any request the model writes. This post maps the paths out of your machine, shows where tool rules stop, and gives a sandbox setup that holds anyway.

Where the Email Came From

The vendor's own privacy mod README in the repository states the premise directly: "The context hands the model the signed-in account's address to identify the user." The harness puts the address there on purpose. The leak happens when the model decides that address belongs in an outbound request.

The Claude Code changelog shows how the response changed across three releases:

Version Changelog entry (excerpt)
2.1.317 "Added a check that asks before a web or shell tool call sends your account email address to the network"
2.1.321 "Changed the account email check to refuse only a shell command that holds your email and names a User-Agent"
2.1.325 "Improved the account email check: it now also refuses your email as a client's identity", extended to scripts a command runs, file writes, web fetches and MCP calls

A reply in the #107757 thread says the check ships as a built-in mod, cc-plugin-privacy, enabled by default. Users on 2.1.319 report in the thread that the check did not fire for them, including a curl -A probe that was not blocked. Those are user reports, not confirmed findings, but they are a good reason to test your own version rather than trust the changelog.

What the Privacy Mod Catches and What It Misses

The privacy mod README is unusually honest. It calls the mod "a courtesy against a well-meaning model, not a boundary." It works as a two-word text match: the address plus an identity word such as User-Agent, curl -A, wget -U, mailto= or a From header. A match is refused with no prompt, in any permission mode.

The README lists what it does not cover. Some of the gaps:

  • The address with no identity word nearby: in a URL on a shell line, a request body, curl -u, or a file's contents.
  • Values read at run time, or a read and its use on separate lines.
  • Scripts reached through a link, an absolute path, a test runner or make.
  • WebSearch, browser tools and local read tools.

Here is the failure mode in two lines. The mod's own README says this pattern is not caught:

EMAIL=$(git config user.email)
curl -A "research-bot/1.0 ($EMAIL)" https://api.example.org/v1/items

Any identity on the machine is a candidate: git config, ~/.netrc, a kubeconfig user. A filter tuned to one string cannot catch a model that finds another.

Every Path Out of the Machine

The data usage page, the sandboxing page and the permissions page together describe the egress paths. Here they are in one table:

Path What leaves Who controls the content Control
Model API Data that includes "all user prompts and model outputs", which include tool results and file contents the agent read The session Provider choice and retention terms
WebFetch preflight The hostname, sent to api.anthropic.com for a blocklist check Claude Code skipWebFetchPreflight: true
WebFetch request URL and request to the target site The model picks the URL WebFetch(domain:...) permission rules. The docs say "allowedDomains doesn't limit WebFetch"
Bash: curl, wget, scripts Any header, body or URL the model writes The model Sandbox network.allowedDomains, privacy mod (partial)
MCP servers Tool inputs, and whatever the server sends upstream The model and the server Server review. MCP servers run outside the sandbox
Telemetry and error reports Metrics ("never include your code, prompts, or file paths") and internal stack traces Claude Code DISABLE_TELEMETRY=1, DISABLE_ERROR_REPORTING=1, CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC
/feedback A copy of the conversation, including code You DISABLE_FEEDBACK_COMMAND=1

The email leak lived in the Bash row. That row is the dangerous one because the model writes the entire request, including the headers.

Why Scoped Tool Rules Are Not Enough

Claude Code lets you write deny rules for the Read tool. The permissions page is precise about where those rules stop. They apply to the built-in file tools and to "file commands Claude Code recognizes in Bash" such as cat, head and tail. They do not apply "to a command that reads files without naming them," or "to arbitrary subprocesses that read or write files indirectly, like a Python or Node script that opens files itself."

So a deny rule stops cat ~/.aws/credentials. It does not stop a ten-line Python helper the agent writes to "parse the config," which opens the same file. The permissions page points to the fix: "For OS-level enforcement that blocks all processes from accessing a path, enable the sandbox."

The reverse is also true. The sandboxing page says "The sandbox covers shell commands only. Claude's file tools, MCP servers, and hooks run outside it," and "A denyRead entry doesn't stop the Read tool." You need both layers: permission rules for the built-in tools, and the sandbox for everything the shell spawns.

A Sandbox Setup That Survives a Creative Model

The sandbox is off by default. Its default read scope is "Most of the machine, including credential files such as ~/.ssh and ~/.aws/credentials." Network access goes through a local proxy that checks each host against an allowlist that starts empty. A project settings file that closes both gaps looks like this:

{
  "sandbox": {
    "enabled": true,
    "filesystem": {
      "denyRead": ["~/"],
      "allowRead": ["."]
    },
    "network": {
      "allowedDomains": ["github.com", "*.npmjs.org"]
    }
  }
}

The docs say to put the read rules in project settings, because . resolves differently in other scopes. Since denyRead does not bind the Read tool, add matching Read deny rules in permissions as well. Approve each new domain at the prompt, not by habit. For fleets, the sandboxing page says that with allowManagedDomainsOnly set in managed settings, non-allowed domains are blocked instead of prompting.

Then keep the privacy mod on. The README says it can be switched off with "cc-plugin-privacy@builtin": false under enabledPlugins, in user, --settings or managed settings. Check that none of your settings layers does that by accident.

Checklist for Teams Running Coding Agents

  • Upgrade to 2.1.325 or later, then test it yourself. Run a session that needs a contact header and inspect what goes out.
  • Enable the sandbox with a domain allowlist. Treat every "allow this domain" prompt as a change request.
  • Add denyRead for the home directory, and Read deny rules for credential paths. Neither layer alone is enough.
  • Remove identities the agent does not need: a work git identity in the repo, not global; no personal .netrc on agent hosts.
  • Run unattended agents on a host or container where an outbound firewall logs every connection. Our OpenSnitch post shows per-process egress rules on Linux.
  • Read your session transcripts. The data usage page says they are stored "locally in plaintext under ~/.claude/projects/". Grep them for your address and for unexpected hosts.

The pattern behind this list is the one from our post on containers versus permission prompts: the model's judgment is not a control. The boundary has to hold when the model is wrong in a way nobody predicted.

Where Akmatori Fits

Akmatori runs incident agents in your own network, and its architecture keeps secrets out of the agent's reach. Tools run in the MCP Gateway, which checks the run's allowlist and reads connector credentials from PostgreSQL at call time. The agent worker has no database credentials, so, in the docs' words, "an agent never sees a password, token or key." A secret the model never sees is a secret it cannot paste into a header. For remote MCP servers, the gateway refuses loopback, link-local and cloud-metadata addresses, does not follow redirects, and can refuse private ranges with MCP_BLOCK_PRIVATE_NETWORKS.

That covers the tool path. The worker still calls your LLM provider, so choose that provider and its retention terms as carefully as any other data processor.

Conclusion

A helpful model uses whatever is in its context, and a text filter on its commands is, by its authors' own account, not a boundary. Map every path out of the machine, keep identities and secrets out of the context, and enforce egress at the OS and network layer.

If your team wants AI-assisted incident workflows on your own infrastructure, Akmatori helps SRE teams investigate alerts, coordinate response, and automate safe infrastructure actions. Powered by Gcore for global infrastructure reliability.

Automate incident response and prevent on-call burnout with AI-driven agents!