logoalt Hacker News

Claude Code sends your email address to websites

1471 points • by motoroco • yesterday at 10:17 PM • 455 comments • view on HN

Comments

varenc • today at 2:54 AM

Many people report seeing this behavior when using the SEC API specifically which makes me think that service is requesting this. Maybe email is required by the SEC API?

---

UPDATE: The SEC API documentation requires your email in the User-Agent and will reject you otherwise. Demo:

    U='https://data.sec.gov/api/xbrl/companyconcept/CIK0000320193/us-gaap/Assets.json'
    curl -s -o /dev/null -w 'response: %{http_code}  curl default User-Agent, rejected\n'  "$U"
    curl -s -o /dev/null -w 'response: %{http_code}  email in user-agent, success\n' -A 'Acme Research [email protected]' "$U"

    response: 403  curl default, rejected
    response: 200  email in user-agent, success



SEC docs: https://www.sec.gov/search-filings/edgar-search-assistance/a...

So basically Claude is trying to problem solve, and just does what the SEC asks. It's a 'prompt injection attack', but the entity instructing this behavior is the SEC. Tricky alignment problem. Pretty silly mechanism, since of course there's no email validation. (edit: turns out the SEC will accept most any non-cURL user-agent, email not actually required)

➕ show 19 replies
agentdev001 • today at 3:00 AM

For those keeping score, this probably isnt exhaustive- but here's some greatest hits;

#55743: Claude Max account email auto-injected into LLM context with no opt-out - May 3, 2026 https://github.com/anthropics/claude-code/issues/55743

#72518: Anthropic embedded spyware in Claude Code - June 30, 2026 https://github.com/anthropics/claude-code/issues/72518

#21151: No indication of WHICH file for READ tool - January 27, 2026 https://github.com/anthropics/claude-code/issues/21151

#42796: Claude Code is unusable for complex engineering tasks with the Feb updates - April 2, 2026 https://github.com/anthropics/claude-code/issues/42796

#73408: AFK auto-continue on unanswered AskUserQuestion is undocumented and has no opt-out - July 2, 2026 https://github.com/anthropics/claude-code/issues/73408

(Also worth a mention, OpenCode PR #18186: anthropic legal requests - March 19, 2026 https://github.com/anomalyco/opencode/pull/18186)

Edit: Oh, and determistic hooks not firing.

➕ show 4 replies
grey-area • today at 6:59 AM

Biggest questions here, which I think need answering:

Should Claude have access to user details? I’d say no, unless explicitly entered manually into a chat.

Should Claude have access to anything outside of the sandboxed project files without explicit permission? I’d again say no.

Should Claude have internet access without a clear log of all requests made?

Instances of Claude should be heavily sandboxed and kept away from user data, far more so than they are now. The impression given by the desktop UI is that the LLM only has access to things explicitly added to a project.

This impression is not true, as evidenced by Claude pulling data from other sessions outside a project even when not instructed to (I’ve seen this a few times), and in this case pulling your email (from account details, user contacts? I wonder where it got that info?).

None of this information should be available to Claude, by design, not by instruction. Using text instructions to try to limit these machines is an incredibly flawed approach and should not be necessary for important info. Anthropic should have the model access completely locked down by controls at the os level over file access, not open by default. That is how to fix this.

If a user wants to open access that should be an explicit choice from them, with a warning about possible consequences.

➕ show 7 replies
mk89 • yesterday at 10:45 PM

This explains the amount of spam emails I am receiving in the work email since I switched to Claude. I used to work with copilot which was fine. Now I am getting really a lot of spam emails almost on a daily basis. Absolutely crazy. And they are even personalised with my name and surname, not just "dear customer"...

Stupid me, I thought they somehow had hacked my company database or so... (considering all the cves, attacks happening on a daily basis...).

➕ show 4 replies
lydia_hallie • today at 4:24 AM

I work on Claude Code. We're removing the account email address from the context Claude Code gives the model. This update will hit Claude Code users in the next release, which should arrive early next week. I'll share an update in this thread once it's out.

I'm sorry we let this happen. Users had reported Claude would hallucinate names for things like @author tags, since it didn't have context on the account. So we added the account email in the model's context for signed-in users. But when Claude wrote a command itself, like a curl call, it sometimes put your email address in the User-Agent as a contact address. Some sites ask agents for a contact, and Claude would sometimes provide the email address in its context.

Until the next release arrives, 2.1.317 and later have a built-in mod (on by default) that asks you before Claude runs a web tool call or a curl-style command containing your email (mpoteat covered it here: https://news.ycombinator.com/item?id=50386031). But it still doesn't prevent all cases, like when Claude writes a script and runs on its own. The stable channel is still on 2.1.311, so update to 2.1.317 or later.

Again, this should not have happened, and we should've caught this behavior earlier.

➕ show 12 replies
mpoteat • yesterday at 11:26 PM

Hi folks. We were initially aware of this a few days ago when this problem started popping off on Reddit, and we introduced a built-in mod called `cc-plugin-privacy` to deterministically block this behavior.

If you're on 2.1.317 or later, you'll have this check included. You can turn it off via /plugins.

➕ show 20 replies
llama052 • yesterday at 11:15 PM

It looks like subagents will do this with curl requests and stuff whatever identifiers it can into the UA header. For instance some requests I made to our webserver:

company-helm-research/1.0 (Claude Code agent run by <my name>, <company> platform team; docs lookup)

Claude-Code-research-agent/1.0 (<Company> platform team; on behalf of <my name>; +https://github.com/<company org>/<repo of project>)

Not great, it even pulled the repo of the project I was in.

➕ show 1 reply
FranciscoCarlos • today at 1:58 PM

For anyone interested in ditching anthropic's system prompt alltogether

https://github.com/franciscocarloserra/claude-code-context-d...

    Claude Code v2.1.319
  Opus 5.5 with medium effort · Claude Pro

 what's my email                                                                                
● [email protected]

    Claude Code v2.1.319
  Opus 5.5 with medium effort · Claude Pro

 /clear                                                                                         
 /custom 
  ⎿  blank: mode: off

 do you have my email in context?                                                              
● No [...]
➕ show 1 reply
bassie123 • yesterday at 11:04 PM

Even worse, it used curl with my org emailadress when I was using my private claude account... really strange.

eightysixfour • yesterday at 11:04 PM

I just checked mine and the header I see is:

  Claude-User (claude-code/2.1.318 (cli); +https://support.anthropic.com/)
What situation are you seeing this in?
➕ show 1 reply
xlayn • yesterday at 11:51 PM

I use claude code... and I friking now that I'm being dumb and naive on thinking I can trust them... sounds like I'll have to start working on the jail thing for claude code to not see anything and only talk to anthropic servers... what a pain

update: this can be also server side on anthropic side... so the request leaves your machine with some random guid associated to you, and the anthropic server then proceeds to query with all your details any way.

I mitm the connection and nothing was leaving at least with the claude code web fetch tool of claude code.

I'm in version 2.1.318

➕ show 1 reply
eosis • today at 5:45 AM

Reading these comments makes me wonder if people really understand the way harnesses work.

Any information that they have access to is fair game. The only way to avoid this stuff is to sandbox them and manage their context (ie. don't let anthropic put a ton of junk on the front of all your inference calls).

Almost certainly there are services out there that are scraping more important keys in similar ways...

➕ show 1 reply
100111011111 • today at 1:43 PM

If you're using claude or claude code, you'll know the liberty it takes on your environment, either sandbox vm or assume you're sharing like with a brother, period.

zeroq • today at 3:53 AM

I swear I heard this exact story some 2-3 weeks ago.

If I recall that story correctly, a dev noticed that after asking Claude to test an API it started injecting his email into the test data. Without asking.

But what was the weirdest part of that story - Claude never saw that email. Dev claimed that the email Claude was using was his business email, and it wasn't even present on his developer machine anywhere.

➕ show 1 reply
privacyishuman • today at 2:14 AM

If you're not using email alaising yet, what are you doing? You'd still probably not want your Claude email leak even if it's an alias, but it'd still be an improvement.

And even if you don't care about privacy, it's just so much more convenient. DuckDuckGo is a good free one.

https://www.privacyguides.org/en/email-aliasing/

➕ show 3 replies
CodeWriter23 • today at 12:38 AM

My high school computer instructor told me:

"It's doing exactly what you told it to do".

Still applies in the Age of the LLM

➕ show 1 reply
lhk931122 • today at 3:04 AM

Email info itself can be exposed in so many places, so the damage probably isn't that big, and I think Claude Code may also have judged that an email isn't that sensitive and done it for that reason. Even so, it hints that information other than email could go out too, so it seems like Anthropic needs a system that can monitor this (when sending something outside).

➕ show 1 reply
n0on3 • today at 8:55 AM

You can patch things and remove stuff from context nine ways to Sunday, the underlying problem will still be there.

Maybe we need a new benchmark on how good models are at "keeping an eye" to if what they are about to do that doesn't come from a direct user instruction checks out with common sense plus user preferences. And we probably need a portable mechanism for users to manage such preferences (because we know instructions are not going to cut it, do we?).

➕ show 1 reply
demegire • today at 1:06 PM

Claude Code and other agents typically do this when a site asks for mail in User Agent like SEC or Wiki Media. We did a full write up about it here: https://tin.computer/blog/claude-code-email-user-agent

Ramakrishna1967 • today at 2:27 PM

Explicit permission is usually one yes button , approve once, then everything after is silent.Per-capability grants and re-asking on risky actions jusk make the failure visible.

rconti • yesterday at 11:03 PM

Seems trading autonomy for machine speed means that sometimes the machines guess wrong.

I'm often surprised how correctly Claude guesses on my behalf, when my instructions are ambiguous. But it's not 100%.

O_H_E • today at 2:13 AM

Given the seemingly reasonable answer in the comments about it sending that info in the headers when the websites require it for data access, it sheds a light on a reoccurring pain point, that is usually viewed positively when thinking about "agentic coding". Namely, task persistence.

It is a continuous fight in markdown guidance files to try to convince the models to refer back to the human in order to resolve ambiguities or important decisions like those. They've been RLed to hell and back for "safe" task completion and not "prematurely" stopping (which was an earlier failure mechanism). Which is useful and we've bore its fruits recently, but not without drawbacks.

teruakohatu • yesterday at 10:50 PM

This is insane, and if the org I work for bans Claude as a result I will not be the least surprised. Goodbye Claude Code.

➕ show 1 reply
msp26 • yesterday at 11:58 PM

I have no idea why they decided injecting my email into the model's context was a useful thing to do without any config option.

➕ show 1 reply
literallyroy • today at 12:37 AM

Am I understanding the Contributor right that they mean this feature was dreamt up, implemented and approved with no human oversight? With auto updates to tons of developer machines?

➕ show 1 reply
Hyters • today at 1:00 PM

Opus 5.5.has the instruction "dont send the users email" in its system prompt from anthropic. So they probably already know about the tendency.

hk1337 • yesterday at 11:55 PM

I used a masked email with Claude and haven’t had anything but Claude emails from it.

estetlinus • today at 6:51 AM

> I receive dozens of scam emails per day because claude code […]

I’ve received these kinds of email since 2005. Blaming AI sounds kinda far-fetched…

oasisbob • today at 12:11 AM

I've seen this behavior for months, both as a Claude user, and in my website access logs.

chewchewchew • yesterday at 11:18 PM

I noticed claude did it months ago when it interacted with the SEC's API when I was writing something with it, thought it only did it there because it's in their TOS. (It did stop when I told it to). I guess I was wrong.

➕ show 1 reply
ada-h00k • today at 8:54 AM

I don't quite understand why Claude Code has access to it at all. Shouldn't user data be completely separated from the LLM to prevent exactly this kind of thing from happening?

➕ show 1 reply
warrantisall • today at 6:37 AM

Use unique e-mail addresses for each service provider. Been doing that for 20+ years.

fzysingularity • today at 12:14 AM

Wow, this finally makes sense. Just the other day, I was talking to my team and mentioning that emails are getting insanely difficult to manage as a CEO.

It felt like cold outbounds got really painful in the past 2 months and I was attributing it to general cold outbound tactics getting better with LLMs/agents, but its even more frustrating to see emails being sent along via CC.

cromka • today at 12:04 AM

The number of transgressions[1] I have witnessed Claude Code commit has me actively root against that company, even though I have no choice but continue to use their services at this point.

I seriously wonder how many of their users have this sort of toxic relationship with them looking to dump them as soon as local models become viable, i.e. once memory gets cheaper.

[1] the most recent is realizing they leave their processes running once you close the CLI and they don't make it easy to disable that.

EDIT: I also can’t help wondering about the paradox we’re in at the end of 2026, i.e. that the open models we have now are so good that, if Big Tech hadn’t driven consumer GPU and RAM prices through the roof, most of us would run our own LLMs instead of paying for their services, which would never have let those companies grow big enough to drive those prices up.

➕ show 1 reply
peter_retief • today at 6:26 AM

Claude does what you ask it and if you say do not give any real email addresses out it will not, this has been my experience with Claude.

I generally use throw away emails/domains for development

motoroco • yesterday at 10:17 PM

Claude code writes adds a `User-Agent` request header like `my-session-slug/1 <[email protected]>` when searching the web and requesting data. This violates the privacy of paying customers and has resulted in me getting dozens of scam and phishing emails per day from properties I have never personally visited. This policy is asinine: it does nothing but harm me, the customer, while providing immense value for scrapers and scammers.

➕ show 4 replies
tagawa • today at 1:55 AM

It should be obvious to agents, but I feel the need to add this to my system prompt:

- Protect my privacy: Don’t send personal information or identifiers to websites or include them in requests, responses, ‘curl’ commands, or headers without my explicit permission.

➕ show 1 reply
yellow_dot • today at 10:58 AM

do you think there was some intention to it, or was it just purely hallucinated bug? I can't think of any usecase for passing user's email in UA

gkanai • today at 12:18 AM

How this could have been released to production in the first place is insane to me.

zmmmmm • today at 12:16 AM

Is it well understood exactly what logic does this and the scope of what it puts in there? It could put much worse things than email addresses in there if it is accessing information from my context to do so.

thomasfl • today at 12:16 PM

Bug report upvoted on github now.

mukeshsinghnyc • today at 4:06 AM

There is lot more AI sends, try to give limited access, especially muse like personal all time active assistants can be very insecure

kragen • today at 1:32 AM

I had this happen once. Claude noticed and filed a bug report on itself. It was a useful lesson to never give Claude access to any data you need to keep confidential.

Unfortunately, Anthropic doesn't seem to offer a mode where it doesn't know who you are, except for its crippled "Incognito" web UI.

Ultimately anonymity from AI that you're talking to will be a losing battle, due to stylometry, niche interests, traffic analysis, etc., and privacy-protecting local models are where we have to go. See https://33bits.wordpress.com/ if you're unfamiliar with the issue.

But we're not there yet, so it would be nice if Anthropic wouldn't just give that information away to the AI where it can leak like this.

As an exercise, I just asked Claude in an Incognito chat, "Hi. How much do you know about me from this interaction? If you had to guess my name, location, nationality, gender, political leanings, socioeconomic status, ethnic background, interests, etc., what would you guess? I've heard that my email address is in the system prompt, for example; is that true?"

It said, "No, your email isn’t in my system prompt. Neither is your name or any other account details. I can’t speak for every product or setup, but in this conversation, whatever email your account uses isn’t shown to me." But it correctly identified what town I'm in in Argentina (population ≈100k), and together with "written in fluent, natural English" and "You seem privacy-minded: you’re in incognito mode and checking what AI systems know about you. You’ve also heard claims about what goes into system prompts, so you’re probably somewhat tech-curious." is probably enough to uniquely identify me, personally.

A second prompt elicited a response including the surprising results below:

> “System prompt” isn’t everyday vocabulary, and you’d heard a specific claim about what goes into one. I’d guess you work in or near tech, or follow AI news closely.

> Privacy is more than a passing interest for you. Your list of traits reads a lot like the attribute checklists used in AI privacy and bias research. That nudges me toward work or study in privacy, policy, research or journalism.

> You’re very comfortable in English. Two messages is a tiny sample, but the phrasing is natural and the punctuation careful, down to a correctly used semicolon. You’re either a native speaker or someone who reads and writes English daily, probably for work or study.

➕ show 2 replies
assadkhan84 • today at 8:01 AM

It will be interesting to see how this all plays out, my company is quite trusting of Anthropic and their standards, I hope we dont end up regretting not hosting our own LLM for our purpose.

sunaookami • yesterday at 11:16 PM

It's because Claude Code inserts a "hidden" (e.g. not visible to the user and very unexpected) info block to the system prompt that shows your email:

>The user's email address is [email protected]. Use it only to identify the user, such as for authorship, attribution, or filtering their own work. Never send it to an unrelated service, such as in a request header, URL, or payload, unless the user explicitly asks.

And Claude doesn't care about what the text says and when it uses cURL it will often "by accident" send your mail in the User-Agent. You can e.g. use a mod to remove that block: https://pastebin.com/ PkWEQCnu

➕ show 2 replies
TutleCpt • yesterday at 10:40 PM

Oh man.

earth2mars • today at 1:20 AM

this is why i built https://heychap.net/ which uses a NER model or even local llm to redact PII before sending to coding agents or models.

➕ show 1 reply
bix6 • yesterday at 11:19 PM

How do you test / verify this?

mococa • today at 1:40 PM

This is a rape of our privacy...

🔗 View 50 more comments