Skip to content

Explain and the MCP check tool mask credential values (#134) - #139

Merged
paureis merged 5 commits into
mainfrom
fix/134-explain-masking
Nov 2, 2026
Merged

paureis merged 5 commits into
mainfrom
fix/134-explain-masking

Conversation

@paureis

@paureis paureis commented Oct 23, 2026

Copy link
Copy Markdown
Owner

Closes #134. Draft until the v1.2.0 tag; the CHANGELOG and ROADMAP lines get added then.

cloudpin explain (text and --json) and the MCP cloudpin_check tool repeated the command's words unmasked, tokens included. The word-level masking from displayCommand is now maskArgv in src/format.ts. It keeps the same length and positions and still has a single list of secret flags. explain() builds each call's argv with it, after guard() has read the real words, so all three outputs are masked and verdicts don't change.

  • In this repo, only the explain text formatter and test/explain.test.ts read argv. paureis/cloudpin-action doesn't read it.

Checks

  • test/explain-secrets.test.ts (new, 103 tests) covers 12 credential forms (Vercel through vercel and vc, kubectl --token/--password, helm --kube-token).
    • Each form runs with an allowed and a blocked token, and each run checks three outputs: text, --json and MCP.
    • Controls: the verdict still comes from the real token, and seven non-credential commands stay exactly as typed.
  • Before the fix: 72 failed and the 31 controls passed. After it: 103 of 103.
  • Mutation checks: removing the mask fails 72 tests; giving the guard the masked words fails 24.
  • npm run typecheck: exit 0. npm test: 1370 passed, 8 skipped.

🤖 Generated with Claude Code

paureis and others added 2 commits October 23, 2026 19:23
Every credential form block messages already hide (--token, --password,
--kube-token, Vercel's -t VALUE, -t=VALUE, -tVALUE and -dt VALUE) is
checked in explain's text output, its --json and the MCP cloudpin_check
result. Controls: other words stay as typed, the --json argv keeps its
length and positions, and the verdict still comes from the real token.

Fails until explain masks the words it repeats.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
cloudpin explain (text and --json) and the MCP cloudpin_check tool repeated
a command's words unmasked, so a --token value reached the terminal or the
agent transcript. The word-level masking behind block and confirmation
messages (#123) is now maskArgv in src/format.ts, and explain uses it when
it builds each call, after the guard has decided on the real words. The
--json argv array keeps its length and positions; only the values change
to ***.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@paureis paureis added this to the 1.3.0 milestone Oct 23, 2026
paureis and others added 3 commits November 2, 2026 13:12
cloudpin_doctor (#138) made ToolContext.doctor required; this test
builds the tools without it, which typecheck rejects.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@paureis
paureis marked this pull request as ready for review November 2, 2026 18:13
@paureis
paureis merged commit b85dd81 into main Nov 2, 2026
5 checks passed
@paureis
paureis deleted the fix/134-explain-masking branch November 2, 2026 18:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

cloudpin explain and the MCP explain tool repeat tokens in the command

1 participant