privacy
로그인된 계정의 이메일 주소가 클라이언트 신원을 선언하는 단어 옆에 포함된 셸, 파일, 웹 가져오기 또는 MCP 호출을 거부하고, 사용자 계층 플러그인이 세션 신원을 읽는 것을 제한하는 Claude Code 내장 모드.
이 mod 소개
privacy 모드는 tool.check를 훅으로 사용하여 Bash, PowerShell, Monitor, Write, Edit, NotebookEdit, WebFetch 및 mcp__* 입력을 검사합니다. 세션의 이메일 주소가 User-Agent 단어, 신원 플래그(set_identity, --identity, mailto=, SEC EDGAR 사이트 단어) 또는 From 헤더와 같은 클라이언트 신원 표시와 함께 나타나면 호출을 거부하며, 명령줄에 지정된 스크립트의 텍스트도 검사합니다. 거부는 무조건적이며 허용 규칙과 분류기 승인을 무시하고, 모델에 일반 클라이언트 이름을 사용하거나 해당 사람에게 묻도록 지시합니다. 또한 session.identity 훅은 사용자 계층 플러그인이 신원 객체를 읽는 것을 거부하면서 내장 호출자는 허용하며, 이 모드는 /plugin disable, enabledPlugins, 서버 측 스위치 또는 우선순위가 더 높은 플러그인 훅을 통해 비활성화할 수 있습니다. 이는 명시적으로 예의상 보호 장치일 뿐 보안 경계가 아니며, 문서화된 오탐과 우회가 있습니다.
설치
먼저 작성자의 README에서 marketplace와 플러그인 이름을 확인하세요. 저장소 구조에 따라 명령어가 달라질 수 있습니다.
claude plugin marketplace add anthropics/claude-code claude plugin install privacy@claude-code-plugins
원문 / README
privacy
The context hands the model the signed-in account's address to identify the
user. This mod keeps that address from going out as a client's identity, and
says who reads it through $.session.identity(). Its
tool.check hook reads each tool as below. The address counts
in any case or percent-encoded.
- Bash, PowerShell, Monitor: the whole input, and the text of each script its
commandnames outside a git or gh command, are refused if they hold the address and a word that declares who is calling. A line that only touches files reads none. - Write, Edit, NotebookEdit: what is being written, by the same test. Not the
path. An Edit is refused only when
new_stringmeets the test andold_stringdoesn't, since carrying over a line the file already holds adds nothing. - WebFetch: the address in
urlis refused with no second word, since the URL is what goes out. mcp__*: the whole input, keys included, by the same test.
A word that declares who is calling is one of:
- A User-Agent:
USER_AGENT_WORD(User-Agent,user_agent,--user-agent,-UserAgent, a prefix of those flags,UA=) orCLIENT_FLAGS(curl -A,wget -U, and-Userfor PowerShell's web commands and Windows PowerShell'scurlandwgetaliases of them, with PowerShell's other dashes too, the en dash, em dash and horizontal bar). IDENTITY_WORD:set_identity,identity=(soEDGAR_IDENTITY=),--identity,mailto=, and site words that catch an address given by position, as inDownloader("Acme", address):sec_edgar,edgartools,browse-edgar,from edgar import,import edgarandsec.gov. A bareedgardoes not count, since a person's name or home folder can be one.- A
Fromheader:FROM_FLAG(-H "From: ..."), orFROM_KEY(a quoted"From"key) after the wordheaders, so a mail API's body passes.
COMPUTED_ADDRESS counts as the address beside any of these words on its own line:
git config user.email in its usual spellings, unless it is given a value to set,
$GIT_AUTHOR_EMAIL and $GIT_COMMITTER_EMAIL, and the names of the two variables
that can hold the address in a cloud session, however the line reads them:
CLAUDE_CODE_USER_EMAIL and CCR_SESSION_ACCOUNT_EMAIL. The address itself counts
with a word anywhere in the text.
Scripts are found by a word match, not a parser: relative names with a script's
extension, and ./name with no extension, up to MOST_SCRIPTS per line, one level
only. This closes a script made any way and then run. Only the line a shell tool
runs is searched, not a field such as description. A git command is taken out of
it first: from a first word git, after any VAR=value assignments, to the next
&, |, ; or newline, with whole quotes and a heredoc to its closing word. So
neither git add fetch.py nor a multi-line commit message that names it is refused
for what the script holds. A heredoc that isn't git's, such as bash <<EOF, stays
searched. Any other spelling of git is read like any other line: "git", (git,
env X=1 git, git.exe, NAME="Jo Smith" git add, and Tmux's send-keys git add fetch.py, which types keys rather than running a line. A gh command is taken out
the same way, so a pull request body may name a script. The hook runs before any
approval, so it follows no link that its walk sees: it walks each name's components
from the working directory with $.fs.list, and reads a plain file only if none is
a link. A link swapped in between by a process already writing the folder isn't
covered. A file that cannot be read (missing, over 4 MiB, a network path) holds nothing, and
the call goes on.
A line only touches files where every command starts with git or another of
TOUCH_WORDS (gh, cat, sed, mv, chmod, linters, formatters, test runners,
Get-Content), by git's own pattern, heredocs included, after plain VAR=value
assignments and one python -m, uv run, npx or bunx. A bare word only, so not
./cat. A line isn't exempt if it holds a backtick, $( other than $(cat <<, <(,
>(, @(, <<<, a separator on a heredoc's opening line, a quote or << in a
comment, or in PowerShell a backslash right before ;, |, &, " or a newline.
Any other line is read as above, so mv fetch.py g.py && python3 g.py is refused.
The refusal raises no prompt, whoever is there and whatever the permission mode.
REFUSAL tells the model to use a generic client name, and to ask the person if a
site needs a real contact. To send this address, the person sets it themselves in
an environment variable the script reads, or runs the command themselves with
!, which calls the shell tool with no permission check. A saved allow rule and
auto mode's classifier do not clear the refusal. A deny beneath keeps its own
reason.
The test is two word matches over the whole text. There is no parser, on purpose:
it keeps the test simple. So a call that sets a User-Agent and sends the address
elsewhere is refused, and so is one that only mentions a word beside the address
(git log --author=<address> --grep=sec.gov), one that touches a script holding
both on a line that isn't exempt (sudo rm fetch.py, python3 ok.py && cat fetch.py), a script with the address in an @author tag,
curl on one line and grep -A on another, or real curl's -user (-u ser). Those
false refusals are accepted for simplicity.
What passes
This is a courtesy against a well-meaning model, not a boundary. These pass, and leave the machine if the call sends them:
- The address with no word beside it: a URL, a request body or
curl -uon a shell line, an MCP field such as a calendar invite, or a file such as package metadata or an@authortag. - A positional address to a library with no identity word and no named site:
Client("Acme", address), or a site named only by a bareedgar. - A quoted
"From"key in a text that never saysheaders. - A value read while a script runs:
settings.json, or$(cat contact.txt). A hook sees only the text it is given. - A run-time read on one line and the word on another:
EMAIL=$(git config user.email), thencurl -A "$EMAIL". - An Edit that carries over a line the file already holds with the address and a word.
- A script reached by a link, by an absolute path or from outside the working directory, which goes unread. Write and Edit still catch the address and an identity word at write time.
- A script that a touch command runs: a test runner (
pytest fetch.py,bun test), a flag, variable or alias (rg --pre ./fetch.py,GH_PAGER=./fetch.py gh), zsh's=(...)or PowerShell'sGet-Content (python fetch.py). - A script named only in a git or gh command, even one it runs:
git bisect run ./fetch.py,git commit -m "$(python3 fetch.py)", orgh pr create --body "$(python3 fetch.py)". - A script that a git or touch command's stray quote or unclosed heredoc runs over,
since an ambiguous spelling goes unread (
git log --grep=don't,$'it\'s',<<EOF-1or a lone carriage return, then./fetch.py), or one on the opening line of git's or gh's heredoc. - A file reached through imports or
make, or a name that is not read against the session's directory, such as after acd, or written~/x.pyor$DIR/x.py, or one with a space or a non-ASCII letter. - A client not named here, or one that sets the header in another way, such as a
PowerShell hashtable splatted with a
Userkey. - Any encoding other than one pass of percent-encoding, and a non-ASCII address percent-encoded.
- The address only in a WebFetch
prompt. WebSearch, the browser tools and the local read tools are not checked.
The address is the one the context hands the model, read as contextEmail
from $.session.identity(). Where the context hands none, it is email.
Who reads the identity
The engine answers $.session.identity() alike for every caller. This mod's hook
on session.identity goes by the caller's tier:
user: refused. The call resolves withdeny.builtin: answered whole, this mod's own read included.- Any other: answered less
contextEmail, pin or no pin.email, the pinned account's, is left as it is.
The field is left off that caller's own answer. A hook above this one still sees it on a built-in's read.
Where the hook fails, its .catch refuses.
By design, without sec-default a person's hook sits above this one and can see
or answer the call, and with this mod off too a person's mod is answered. The
address already reaches it at prompt.context. Under a pin, what it sees
includes the organization's fields and the pinned email.
What turns it off
/plugin disable, or"cc-plugin-privacy@builtin": falseunderenabledPluginsin user,--settingsor managed settings. A repository's settings do not.- A server-side switch, read once per session.
- A hook of an installed plugin, which sits above this one: on
tool.checkit may overrule the refusal, and onsession.identityit may answer in this mod's place or, from a managed tier, continue past it. - A session where no hooks module loads, where
hooks/register.tsdoes not run.
배지 받기
내 프로젝트인가요? 이 배지를 README나 웹사이트에 넣으면 이 페이지로 연결됩니다.
