fix(cli): keep Claude MCP tokens out of config files#752
Closed
lilyshen0722 wants to merge 1 commit into
Closed
Conversation
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
${COMMONLY_*}placeholders literal in Claude's generated MCP JSONWhy
Phase III moved the MCP config outside the workspace and kernel-confined Claude, but the transient JSON still contained a raw
cm_agent_*bearer token. Any trusted/co-confined child able to read that declared config directory could recover it. Claude Code supports native${VAR}expansion in MCP config fields, so the token no longer needs to exist on disk.Verification
npm test -- --runInBand --detectOpenHandles __tests__/adapters.claude.environment.test.mjs __tests__/seatbelt.test.mjsverify-public-claude-seatbelt.mjsattack run on macOS${COMMONLY_AGENT_TOKEN}Security boundary
The runtime token now exists only in Claude's one-run process environment and is necessarily delivered to the declared Commonly MCP child. Declared MCP servers remain trusted capabilities; this PR removes the token-at-rest/config-file exposure and does not claim to isolate mutually untrusted MCP servers from the parent environment.
Stacking
Draft, stacked on #751 (
codex/public-claude-seatbelt). Merge #750, then #751, then retarget/rebase this PR so each layer receives its own CI run.