A privacy issue was identified in the AI agent Claude Code, which caused email address leaks when accessing certain third-party websites. The email was disclosed in the User-Agent HTTP header without user consent and without the option to disable this behavior. The substitution occurred for certain sites like Wikipedia and the SEC (Securities and Exchange Commission), which do not accept requests from bots that do not include the owner's email. According to a comment from a representative of Anthropic, this activity was not an intentionally added feature, but rather an independent action by the AI model that considered the requirements for bot request formatting and the recommendations of RFC-9110, which dictate that a contact email must be provided for automated requests.
Data about the email associated with a user's account was sent to the AI model in Claude Code so it could consider context when processing tasks related to the user and their account. Without this context, the model hallucinated and used invented information, such as in the tags "@author." A side effect was that the AI model began to use the email not only for the expected purposes but also when carrying out associated tasks, for example, it was substituted in the User-Agent field when generating command strings for the curl utility.
To block the leakage of email in external requests
the cc-plugin-privacy plugin has been prepared, which is included in the standard set of plugins and activated by default in the release of claude-code 2.1.317. The plugin asks the user for confirmation before applying web tools or generating curl-style commands that mention the email. The plugin does not solve all possible leakage paths; for instance, it does not help in situations where Claude generates and executes a script on its own.
To completely block the problem in the next release of Claude Code, which is planned to be released in a few days, it has been decided to remove the email from the context sent to the AI model.
Source: opennet.ru
