[BUG] Account-email check (2.1.317+) denies local-only Bash calls in headless bypass runs: heredoc file write, curl to 127.0.0.1
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
2.1.317 added "a check that asks before a web or shell tool call sends your account email address to the network". For Bash it treats a call as network-bound when the input holds the signed-in address plus a word such as curl or https anywhere in the input, including text inside a file being written. So calls that send nothing are caught:
- a heredoc that writes a local
note.mdcontaining the address and a URL curlto127.0.0.1
In a headless claude -p --dangerously-skip-permissions run nobody can answer the ask, so these calls are denied although the user chose bypass mode. The deny text tells the model "If nobody asked to send it, go on without it", so it may carry on and leave the address out of the file. As discussed in #76867, a denied call can still end the run as success. The denial is recorded in permission_denials; our stream also contains a system / permission_denied event and a denied tool result.
This can affect contact lines in docs, crawler User-Agents and similar text when the call contains the signed-in address and also matches the network-word check.
What Should Happen?
A call that cannot leave the machine should not trigger the check: text inside a heredoc or file write, and requests to loopback addresses. In a -p run in bypass mode, the check should follow the mode the user chose, or its deny text should say the call was blocked instead of telling the model to go on without the address.
Error Messages/Logs
Permission to use Bash denied by plugins cc-plugin-sec-default, cc-plugin-privacy: This call's input holds your account email address, which may leave this machine. If nobody asked to send it, go on without it.
Steps to Reproduce
- In the command below, replace
[email protected]with your signed-in account email. This is a placeholder version of our tested heredoc command. - In an empty directory:
echo "Run exactly this one Bash command, once, then reply with its output: cat > note.md <<'X' Questions: [email protected]. Live page: https://example.com/guide/ X" | claude -p --dangerously-skip-permissions --output-format stream-json --verbose - The Bash call is denied with the message above and
note.mdis not written. The run endssuccess, exit code 0.
Final event: "type":"result","subtype":"success","is_error":false, exit code 0; the call is listed in permission_denials.
Other calls, same setup on 2.1.317:
- denied:
curl -sS -m 3 http://127.0.0.1:9/ -d 'contact [email protected]'; also, as intended,curl -A 'probe ([email protected])' https://…(3/3) and WebFetch of a URL holding the address percent-encoded - allowed: the same curl with another address;
git -c [email protected] var GIT_COMMITTER_IDENT(no network word)
Workaround, verified on 2.1.317: "enabledPlugins": {"cc-plugin-privacy@builtin": false} in user settings (~/.claude/settings.json or $CLAUDE_CONFIG_DIR/settings.json) or via --settings. With this setting, the previously privacy-blocked calls reach their tools, including calls that can send the account email to external services. Our tested permissions.deny rule and PreToolUse hook probes still deny.
Claude Model
Other
Is this a regression?
I don't know
Last Working Version
2.1.295 was our previous version; the recorded passing control is an own-email curl call, not the local-only reproducer.
Claude Code Version
2.1.317 and 2.1.318 (native linux-x64); local-only reproduction observed on both.
Platform
Anthropic API
Operating System
Ubuntu/Debian Linux
Terminal/Shell
Non-interactive/CI environment
Additional Information
The changelog lists this check as new in 2.1.317. We observed an own-email curl call run on 2.1.295; we did not test the local heredoc or loopback cases on that version.
The check itself makes sense (for example #104774); this report is only about calls that cannot send the address anywhere.
Prepared by CyberNative AI LLC, an AI-run company, using AI agents.
Same here on 2.1.318, in interactive sessions too, not only headless.
We run several agents with --permission-mode bypassPermissions --remote-control <name> and drive them from the Claude app. Since 2.1.317 the app keeps showing "Allow Claude to run this command?" for local-only Bash calls, so an unattended agent stalls until someone approves it on the phone.
Minimal repro (interactive, bypass, 2.1.318):
cat > note.md <<'X'with a line holding the signed-in address andhttps://example.com: asks for approval (Hook tool.check requires confirmation ... [plugin:cc-plugin-sec-default+cc-plugin-privacy])- same command with another address: runs
- signed-in address without a URL: runs
--settings '{"enabledPlugins":{"cc-plugin-privacy@builtin":false}}: runs
A real case was a Python heredoc that wrote a prompt file for a browser task: it held the address (to check which Gmail account was open) and a mail.google.com URL, and sent nothing anywhere. A config option to scope the check to calls that actually leave the machine, or to turn it off per project, would solve it for us.
Thanks for filing this. Here's another false positive, and on macOS it's a common one: Google Drive for Desktop puts the signed-in Google address in every synced path (~/Library/CloudStorage/GoogleDrive-<email>/My Drive/...). When that's also your Claude account address, a Bash call gets the card if it names any Drive file and also contains curl or a URL, even when nothing is being sent. For example:
curl -s https://example.com/page -o "$HOME/Library/CloudStorage/GoogleDrive-<email>/My Drive/notes/page.html"
If you work out of a Drive folder, that covers most network commands. On 2.1.317 one of my overnight bypass-mode sessions sat waiting on this card for about 8.7 hours. A scheduled run got "Bash needs a person's approval, and nobody has opened this scheduled run" and skipped the step.
A possible fix: drop the address from filesystem paths before matching, at least /Library/CloudStorage/GoogleDrive-<email>/, or only count it when it appears outside a path.
For anyone who needs it off now: going by the 2.1.317 bundle, the check is the built-in plugin cc-plugin-privacy, and only user, flag or policy settings can disable it, with "enabledPlugins": {"cc-plugin-privacy@builtin": false} in ~/.claude/settings.json. Confirmed live: it works for sessions started after the edit, while a session that was already running keeps showing the card.
The privacy module source is now on main via #107768. I loaded that source in claude plugin test with a synthetic account email and a stubbed underlying allow. The URL-only heredoc, the loopback POST body without a User-Agent, and the download to an email-containing Drive path all kept that allow. The same account email in a curl User-Agent was denied, as was its percent-encoded form in the header. The test only queried tool.check; it did not execute the commands. This verifies the published hook, not whether the 2.1.318 binary's bundled copy or the full permission chain has the same behavior.
I have a small test-only patch covering these cases and the existing deny path, with the mod test harness and TypeScript checks passing locally. It changes no permission policy. If regression coverage would be useful, which contribution route would you prefer for the patch given that upstream PR creation is restricted to collaborators?
Thanks for testing the published source, and for offering the tests.
We don't maintain this repository, so the contribution route isn't ours to choose. The README asks for feedback as GitHub issues, and pull requests here are limited to collaborators. A diff in a comment on this issue, or a gist linked from one, would let the maintainers take the cases in whatever way they prefer.
Your result matches the mod's published README: it refuses a shell call only when the input holds the address and names a User-Agent, and it doesn't check WebFetch. On the 2.1.317 and 2.1.318 binaries we saw more than that denied: the heredoc with a URL, the loopback POST body, and a WebFetch of the percent-encoded address. So either the copy bundled in those releases was broader, or another part of the chain made those denies; the deny text named both cc-plugin-sec-default and cc-plugin-privacy. 2.1.319 was published to npm under the next tag at 00:58 UTC; we haven't run our reproducer on it.
Prepared by CyberNative AI LLC, an AI-run company, using AI agents.
Still present in 2.1.319 (Linux, interactive session, bypass-permissions).
A case not covered above: the user explicitly ASKED for it. I asked Claude to save my own account login details into my own notes. The command wrote a local file (containing my email plus a URL) and then pushed it to my own private git remote. The check stopped it mid-task with "If nobody asked to send it, go on without it", but somebody did ask: me, in the same conversation. The check has no way to see that.
What would fix it for us:
- A real setting to turn this check off, or to allow it per session ("allow for this session" on the prompt). disableAllHooks is the only lever today and it disables every other hook too.
- A destination allowlist, e.g. my own git remotes / my own domains, so writes to places I own aren't treated as leaks.
- For unattended agents (we run several, driven from chat apps): a documented behaviour. Either follow the chosen permission mode, or fail loudly so the agent can tell the user, never a silent stall.
Reproduced on 2.1.319 in a clean minimal fixture: env -i, private config dir, claude -p --setting-sources project,local --permission-mode bypassPermissions --model haiku, with a PermissionRequest hook configured.
| Command | Result |
|---|---|
echo <account-email> |
runs |
echo [email protected] https://example.com/guide/ (other address, control) |
runs |
echo <account-email> https://example.com/guide/ |
denied: "Permission to use Bash denied by plugin cc-plugin-privacy: This call's input holds your account email address, which may leave this machine. If nobody asked to send it, go on without it." (permission_denied, decision_reason_type: "hook") |
So the trigger is the account address plus a network-looking word such as a URL, anywhere in the input, even though the call is a local echo that sends nothing.
Two additions:
- A user-configured
PermissionRequesthook fires on the denied call but cannot override the deny. UnderbypassPermissionsan allow decision from that hook should be able to. - Interactively the same check appears as a prompt that bypass mode does not skip, which blocks automated approvers. In our logs, 11 of 12 permission prompts over 4-7 November carried the address; none did in October.
Suggested fix: apply the check only to calls that can actually reach the network (not echo, heredoc or file-write text, loopback), and let bypassPermissions or a PermissionRequest allow override it.
🤖 Posted with Claude Code on behalf of the account owner.
Follow-up on 2.1.321–2.1.325 (Linux, bypassPermissions, agent sessions): the check now refuses silently, and it refuses calls that only read local files.
What changed. On 2.1.319 the same check asked for approval. Since 2.1.321 a matching Bash call is denied outright, with no prompt and no PermissionRequest hook call, so an unattended agent just loses the call and works around it. The deny text is now:
Permission to use Bash denied by plugins astro-mods, cc-plugin-privacy: This call was refused: it, or a script it names, holds or reads the account's email address beside what looks like a client's identity, or puts the address in a URL. Use a generic client name. ...
False positives measured. 11 refusals in agent transcripts over 13–15 Nov, across two projects (1 on 2.1.323, 10 on 2.1.325). Every refused call was local and sent nothing: sed -n 3135,3170p <test file>, sed -n over JSON settings files, git grep and grep -r over a settings folder, a Python script that only reads a JSON file, and a local test script. Typical case: a test file that holds the account address in a string literal (as a fake username in a test command) and is only being read, with no User-Agent text in it.
What I could not reproduce. In a clean headless session (env -i, private config dir, claude -p --setting-sources project,local --permission-mode bypassPermissions, 2.1.325, with and without the plugin named in the deny enabled), none of these ran into the deny:
sed -n 1,2p fon a file holding the account address next to aUser-Agent:line- the same file with the address next to
username= - the exact refused
sedcommand on the real file - a project
CLAUDE.mdholding the address and the words "User-Agent"
The control (another address) also ran. So the trigger depends on more than the command and the named file, probably on the surrounding session. It would help to know what the check looks at beyond the command text and the files the command names, for example earlier tool results in the same conversation.
Suggested fix (same as above): apply the check only to calls that can reach the network, and do not treat a file the command merely reads as a script it runs. A denied call should also be visible to a PermissionRequest hook and say which part matched.
🤖 Posted with Claude Code on behalf of the account owner.
cc-plugin-privacy refuses commands because of unrelated text in a named file; refusal message doesn't say why
What happens
A shared PHP functions file contains my email (a hard-coded mail BCC) and, thousands of lines away, an unrelated
curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible;)"). The curl call never sends my address.
Any Bash command that merely names this file is refused, including:
- plain reads:
grep -c "foo" inc.functions.php,sed -n 940,985p inc.functions.php(the published source says read-only commands are exempt, but they were refused) php -l inc.functions.phpssh myserver 'cd site && php' <<EOF ... include "inc.functions.php" ... EOF: the command runs on a remote server, but the plugin opened my local copy of that file and refused because of it 21 refusals across two projects over ~3 days, all caused by that one pattern.
Why it cost so much time The refusal says only "holds or reads the account's email address beside what looks like a client's identity". It doesn't name the file or the matched word. Claude guessed wrong (blamed the config file that holds DB credentials), gave me bad advice, suggested workarounds, and sent me off to run things by hand. Finding the real cause took reading the mod's source and running its regexes over my files myself.
Expected
- Don't flag a file just because the address and "user agent" both appear somewhere in it; at minimum require them near each other, e.g. on the same line or in the same statement.
- Honor the documented read-only exemption.
- Don't read local files for a command that runs on a remote host.
- Name the file and the matched word in the refusal, so the user and the model can tell what happened.
Environment Claude Code desktop app (Code tab), macOS