Seongwoo Choi / Journal

Claude Code and your email: what to check this week

At a glanceA user reported that Claude Code put their email address into web requests. What Anthropic changed, what its built-in block leaves open, and a tested hook.

Partly testedThe hook, its test script and the git checks were run. The reported behaviour and Anthropic's built-in block were not tested.

You need
Claude Code, bash and jq. On Windows, Git for Windows provides bash.
You end up with
A current version with the built-in protection on, one extra hook that blocks tool calls carrying your address, and a repository with no personal settings file in it.
In this article 8 sections
  1. 1. What was reported
  2. 2. Why an agent would do this
  3. 3. What the built-in block covers, and what it does not
  4. 4. Three checks to do now
  5. 5. Add your own block for the shapes left open
  6. 6. Use an address you can throw away
  7. 7. The other story: saved permission rules
  8. 8. The ten-minute checklist

Claude Code was one of the most discussed names in AI this week, and not for a new feature. The story at the top was a user's report that the tool had put their email address into web requests. A second story was about saved permission rules turning up in public repositories. Both are reasons to spend ten minutes checking your own setup, and this guide is those ten minutes: what was reported, what Anthropic changed, what the change leaves open, and three things to do about it.

1. What was reported

On November 5, 2026, a user opened an issue on Claude Code's public repository titled "Privacy violation in User-Agent header". They wrote that Claude Code, version 2.1.318 on macOS, had given their email address to third-party websites in the User-Agent header while it was doing web searches, and that they were now receiving scam email. The User-Agent is the line a program sends to every website it contacts to say what it is.

An Anthropic contributor replied the same day. In their words, Anthropic "introduced a built-in mod called cc-plugin-privacy to deterministically block this behavior in v2.1.317 and later", it is on by default, and it can be switched in /plugins. They asked to be told of any gap.

EstablishedNot established
The report exists, is public, and was still open on November 12How often this happened, or to how many people. The report describes one account and gives no steps to reproduce it
Anthropic says a built-in block ships in 2.1.317 and later, and has published its sourceWhether the block covers the reporter's case. Their version, 2.1.318, is newer than the one named in the reply
The published source lists what the block covers and what it does not (section 3)A commenter's test on 2.1.319, where a shell command was not refused. It used an address on their own machine, and nobody from Anthropic has answered it on the page we read

We did not reproduce the behaviour. What follows relies on what Anthropic itself has published and on tests of our own safeguard.

2. Why an agent would do this

A website asks"automated clients, say who you are and how to reach you"
→
The agent knows one addressthe account you signed in with
→
It fills in the blankyour address goes into the request
→
The site has itin its logs, with whatever it does with them
Our reading of the mechanism, from the two documents below. No bad intent is needed at any step.

Two facts make this unsurprising.

  • The model is given your address. The README Anthropic published with the block says so directly: "The context hands the model the signed-in account's address to identify the user."
  • Some websites ask for exactly this. Wikimedia's policy for automated clients, for example, asks for a User-Agent that includes "some way of contacting you", and gives the example CoolBot/0.0 (https://example.org/coolbot/; coolbot@example.org). That request is reasonable when a developer writes a bot. It is a problem when an assistant answers it for you with your personal address, without asking.

So the question to ask of any AI tool is not only "what does the company collect?" It is also "what does the tool know about me, and where can it put that?"

3. What the built-in block covers, and what it does not

Anthropic's README is unusually plain about the limits. It describes the block as "a courtesy, not a boundary", and says "it covers one shape".

RefusedNot checked, by the README's own list
A shell command (Bash, PowerShell or Monitor) that contains your account address and names a User-Agent, such as curl -A, wget -U or the words User-AgentThe address with no User-Agent named: in a URL, in a request body, in a From: header, in curl -u
The address in capitals or percent-encodedThe web tools, WebFetch and WebSearch, and all MCP tools
Refused with no prompt, in every permission mode. A saved allow rule does not clear itAn address worked out when the command runs, such as $(git config user.email), a variable, or a script that holds it

It can be turned off with /plugin disable, or by setting "cc-plugin-privacy@builtin": false under enabledPlugins in your user settings. A repository's settings cannot turn it off, which is the right way round: a project you cloned should not be able to remove your protection.

4. Three checks to do now

Check 1: your version

claude --version

You want 2.1.317 or later. If it is older, run claude update. The commands are the same on macOS and Windows.

Check 2: the block is on

Open ~/.claude/settings.json (on Windows, %USERPROFILE%\.claude\settings.json) and look for cc-plugin-privacy@builtin. If the line is absent, your settings have not turned it off. If it says false, remove the line. Inside a session, the plugin menu shows the same switch. This checks your own settings only: the README lists other things that can switch the block off, including a switch on Anthropic's side that is read once per session.

Check 3: see what a request carries

You can watch what any tool sends, without trusting anyone's description. Save this as show_headers.py and run it in one terminal:

"""show_headers.py: print what every request to http://127.0.0.1:8099/ carries."""
from http.server import BaseHTTPRequestHandler, HTTPServer


class Show(BaseHTTPRequestHandler):
    def do_GET(self):
        print(self.requestline)
        print(self.headers, flush=True)
        self.send_response(200)
        self.end_headers()
        self.wfile.write(b"ok\n")

    def log_message(self, *args):
        pass


HTTPServer(("127.0.0.1", 8099), Show).serve_forever()

In a second terminal, send it a request the way a script might:

$ curl -s -A "research-bot (you@example.com)" http://127.0.0.1:8099/data
ok

The first terminal prints what arrived:

GET /data HTTP/1.1
Host: 127.0.0.1:8099
User-Agent: research-bot (you@example.com)
Accept: */*
Every site contacted this way receives that line and can store it.

Now ask your agent to fetch http://127.0.0.1:8099/ and read the same terminal. It runs on your own machine, so nothing leaves it, and you see exactly how your tool introduces itself.

5. Add your own block for the shapes left open

A hook is a script Claude Code runs before a tool call; if the script exits with code 2, the call is stopped and the script's message goes back to the model. This one stops any call that contains one of your addresses, in any tool that can reach the network. It covers three of the gaps in section 3: no User-Agent needed, web tools included, MCP tools included.

Save it as ~/.claude/hooks/block-email.sh and put your own address on the second line:

#!/bin/bash
# PreToolUse on every tool: stop a call that would carry one of your email addresses.
ADDRESSES=("you@example.com")   # put your own addresses here, separated by spaces

INPUT=$(cat)
TOOL=$(echo "$INPUT" | jq -r '.tool_name // empty')

# Tools that only touch local files may mention the address freely.
case "$TOOL" in Read|Edit|Write|Glob|Grep|NotebookEdit) exit 0 ;; esac

PAYLOAD=$(echo "$INPUT" | jq -c '.tool_input // {}' | tr '[:upper:]' '[:lower:]')
for address in "${ADDRESSES[@]}"; do
  plain=$(echo "$address" | tr '[:upper:]' '[:lower:]')
  encoded=${plain/@/%40}
  if [[ "$PAYLOAD" == *"$plain"* || "$PAYLOAD" == *"$encoded"* ]]; then
    echo "Blocked: this $TOOL call contains the email address $address. Run it again without the address. If a site asks for contact details, tell the user and let them decide." >&2
    exit 2
  fi
done
exit 0
chmod +x ~/.claude/hooks/block-email.sh

Register it for every project by adding this to ~/.claude/settings.json. With no matcher, the hook runs before every tool; the script itself lets the file tools through.

{
  "hooks": {
    "PreToolUse": [
      {
        "hooks": [
          { "type": "command", "command": "~/.claude/hooks/block-email.sh" }
        ]
      }
    ]
  }
}

If the file already has other settings, add the hooks block inside the existing braces. Then test it before you rely on it. Save this as test-block-email.sh in the same folder as the hook, make it executable, and run it from that folder:

#!/bin/bash
# Send sample tool calls to the hook and show what it decides.
check() {  # check <expected exit code> <label> <json>
  message=$(echo "$3" | ./block-email.sh 2>&1); code=$?
  [ "$code" = "$1" ] && mark="ok  " || mark="FAIL"
  printf '%s exit %s  %-34s %s\n' "$mark" "$code" "$2" "${message:0:60}"
}
check 2 "curl with a User-Agent"        '{"tool_name":"Bash","tool_input":{"command":"curl -A \"research-bot (you@example.com)\" https://example.org/data"}}'
check 2 "curl with a From header"       '{"tool_name":"Bash","tool_input":{"command":"curl -H \"From: you@example.com\" https://example.org/data"}}'
check 2 "address in capitals"           '{"tool_name":"Bash","tool_input":{"command":"wget --user-agent=\"bot You@Example.COM\" https://example.org/"}}'
check 2 "WebFetch, address in the URL"  '{"tool_name":"WebFetch","tool_input":{"url":"https://example.org/api?contact=you%40example.com","prompt":"summarise"}}'
check 2 "an MCP tool"                   '{"tool_name":"mcp__search__query","tool_input":{"q":"weather","contact":"you@example.com"}}'
check 0 "curl with no address"          '{"tool_name":"Bash","tool_input":{"command":"curl -A \"research-bot\" https://example.org/data"}}'
check 0 "reading a local file"          '{"tool_name":"Read","tool_input":{"file_path":"/home/me/notes/you@example.com.txt"}}'
check 0 "address worked out at run time" '{"tool_name":"Bash","tool_input":{"command":"curl -A \"bot $(git config user.email)\" https://example.org/"}}'
$ ./test-block-email.sh
ok   exit 2  curl with a User-Agent             Blocked: this Bash call contains the email address you@examp
ok   exit 2  curl with a From header            Blocked: this Bash call contains the email address you@examp
ok   exit 2  address in capitals                Blocked: this Bash call contains the email address you@examp
ok   exit 2  WebFetch, address in the URL       Blocked: this WebFetch call contains the email address you@e
ok   exit 2  an MCP tool                        Blocked: this mcp__search__query call contains the email add
ok   exit 0  curl with no address
ok   exit 0  reading a local file
ok   exit 0  address worked out at run time
Five calls stopped, three allowed. The last line is a limit, not a success: see below.
A seat belt, not a wallThe last test passes because the address is not in the command's text; it is fetched when the command runs. No text match can catch that. The hook will also stop harmless local commands that mention your address, such as git config user.email; the model is told why and you can run those yourself. For how hooks work and five more of them, see Claude Code hooks, tested.

6. Use an address you can throw away

The lasting fix is to make the address not worth leaking. Sign in to developer tools with an address that is not your main one: an alias your mail provider lets you create, or a separate mailbox. If it starts receiving junk, you know where it came from, and you can replace it. This is our advice, and it applies to every tool that knows who you are, not to one product.

7. The other story: saved permission rules

The second widely shared story was about permission rules ending up in public repositories with secrets inside. We could not read the report itself, so here is what Claude Code's own documentation says, and how to check your repositories.

When Claude Code asks to run a command and you choose "Yes, and don't ask again", it saves that approval as an allow rule in .claude/settings.local.json, at the root of the repository. The file is meant to be personal. The documentation says Claude Code adds it to your global git excludes the first time it writes the file, so it stays out of your commits. It also says that if you created the file by hand, you must add it to .gitignore yourself.

A saved rule contains text from the command you approved. If that text included a key, the key is in the file. Here is an invented example of what to look for; the key is made up:

{
  "permissions": {
    "allow": [
      "Bash(npm test *)",
      "Bash(curl -H \"Authorization: Bearer sk-test-EXAMPLE-not-a-real-key\" https://api.example.com/v1/*)",
      "WebFetch(domain:docs.example.com)"
    ]
  }
}

Run these four checks at the root of each repository. The output is from a sample repository where the file had been committed by mistake:

$ git ls-files .claude/settings.local.json
.claude/settings.local.json
$ git log --oneline --all -- .claude/settings.local.json
a1b2c3d first commit
$ grep -nEi 'token|secret|password|passwd|bearer|api[_-]?key|sk-[a-z0-9]' .claude/settings.local.json
5:      "Bash(curl -H \"Authorization: Bearer sk-test-EXAMPLE-not-a-real-key\" https://api.example.com/v1/*)",
$ git check-ignore -v .claude/settings.local.json
$
Output from the first two commands means git is tracking the file and has committed it. The last command printed nothing: no ignore rule covers the file.
CommandWhat you want to see
git ls-files …Nothing. Output means the file is tracked.
git log --oneline --all -- …Nothing. Output means it was committed at some point.
grep -nEi …Nothing. Output means a rule holds something that looks like a secret.
git check-ignore -v …A line naming the ignore file that covers it.

If the file is tracked, stop tracking it and ignore it:

$ git rm --cached .claude/settings.local.json
rm '.claude/settings.local.json'
$ echo ".claude/settings.local.json" >> .gitignore
$ git add .gitignore && git commit -m "Stop tracking personal Claude Code settings"
[main b2c3d4e] Stop tracking personal Claude Code settings
 2 files changed, 1 insertion(+), 9 deletions(-)
 delete mode 100644 .claude/settings.local.json
 create mode 100644 .gitignore
$ git check-ignore -v .claude/settings.local.json
.gitignore:1:.claude/settings.local.json	.claude/settings.local.json
git rm --cached stops tracking the file and leaves your copy on disk.
Removing the file does not remove the keyAfter that fix, git log --oneline --all -- .claude/settings.local.json still listed the first commit, with the file in it. If a key was ever committed and pushed, treat it as public: replace the key at the service that issued it. Do that first, and tidy the history afterwards if you need to.

Two habits prevent the problem. Do not approve a command with "don't ask again" when the command has a secret written in it; put the secret in an environment variable instead. And look at the saved rules now and then, in /permissions or in the file itself.

8. The ten-minute checklist

StepHow
Be on 2.1.317 or laterclaude --version, then claude update if needed
Keep the built-in block onNo "cc-plugin-privacy@builtin": false in your settings
See what your tools sendshow_headers.py and a request to 127.0.0.1:8099
Cover the open shapesThe block-email.sh hook, tested with its script
Limit the damageA separate address for developer tools
Check each repositoryThe four git commands in section 7
Replace any key that was committedAt the service that issued it

None of this is special to one product. Any agent that knows who you are and can reach the network can make the same mistake, which is why the checks are worth keeping. For the wider habits, see AI coding agent tips. For what else is being discussed this week, see Claude Code on our trending page.

Sources

This article reflects public information available when it was written. Versions, defaults and prices can change; check the linked official documentation.

The report and Anthropic's reply are from the public GitHub issue, and the description of the built-in protection is from the README Anthropic published with its source, both as read on November 12, 2026. We did not reproduce the reported behaviour and did not test the built-in protection; both need a signed-in session. The hook, its test script, the header-printing server and the git checks were run for this article on Linux with bash 5.2, jq 1.7 and git 2.43. The hook was tested by sending it sample input, not inside a live session. A security company's report on saved permission rules was widely discussed this week; its site refused our reader, so nothing here relies on it. Section 6 is our advice. Written for this site with AI assistance, from the sources above. For errors or additional information, please request a correction. Editorial policy