Skip to content

fix(claude): scrub credentials from CLI and Claude-mode error text - #548

Draft
FelipeRamos-neuro wants to merge 3 commits into
plmbr:mainfrom
FelipeRamos-neuro:fix/scrub-credentials-from-errors
Draft

FelipeRamos-neuro wants to merge 3 commits into
plmbr:mainfrom
FelipeRamos-neuro:fix/scrub-credentials-from-errors

Conversation

@FelipeRamos-neuro

@FelipeRamos-neuro FelipeRamos-neuro commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Stacked on #546 and #547. Until they merge, this diff includes their commits; review the last commit only.

Summary

run_claude_cli(tail, secret_args=...)
  on failure: raise ValueError(scrub(stderr))
scrub
  env_overrides values
  secret_args values (env/header values from `claude mcp add`, plus the token after a `Bearer ` scheme)
  redact_env_secrets

ClaudeMCPManager.add_server -> passes secret_args
claude.py stream errors / bail-out string / log lines -> redact_env_secrets
  • claude mcp add still passes values as flags, so they remain visible in the process list while the CLI runs. The admin guide's new paragraph says so and suggests a ${VAR} reference on shared machines.

Evidence

  • Before: CLI stderr that quotes the command line, or an SDK error that echoes a rejected key, reaches the browser and the log intact.
  • After: tests feed both through the code path and assert the token is gone while the rest of the message survives.

pytest tests/ 2535 passed, i18n check and Prettier clean.

Merge Danger

Door: two-way

Blast Radius: error text for Claude mode and the Claude MCP form

A value that matches a credential is replaced wherever it appears in that text.

Closes #544

A key stored in config.json was sent to the browser in clear text and
filled a plain input. The capabilities response now carries a mask in
its place (model lists, stored chat_model and inline_completion_model
entries, claude_settings and acp_settings), ConfigHandler maps a posted
mask back to the stored key, and the key inputs are password fields.
LLMProviderProperty gains an opt-in `secret` flag.

Closes plmbr#542
…files

The Claude-mode server list masks every env and headers value. The NBI
MCP editor masks credential-named values in the temp copy it writes to
the workspace and restores them on save; a mask with nothing stored
behind it is refused with a 400.

Closes plmbr#543
run_claude_cli scrubs the env and argv values it was given, then runs
the shared redactor. Claude-mode stream errors, the bail-out message and
the related log lines are redacted too.

Closes plmbr#544

This branch has not been deployed

No deployments
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.

Claude CLI and Claude-mode error text can echo credentials

1 participant