[#1r] Secret-in-args warning badge #1
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
commit 6dee318implemented env/header value masking, Show-secrets toggle, Add-dialog password echo, andredact_argsin diagnostics. The one remaining piece: a non-blocking warning badge when a value that looks like a raw secret is sitting inargsinstead ofenv.This matters because some servers (e.g. Postgres MCP) do not support env vars and force credentials into
args, where they are visible in process listings and more likely to be pasted into bug reports or chats.Proposed fix
bcc_core.py, add a function (e.g.args_secret_warning(data: dict) -> str | None) that inspectsdata["args"]using the already-existingis_secret_key/_is_secret_value/redact_argsheuristics and returns a warning string when a secret-shaped value is found positionally (not via a--key=valpair, where it is already partially self-documenting).bcc.pyServerEditor, call this function on every field change (alongsidecheck_dependency) and display the result as a non-blocking badge/warning label near the Args field — similar style to the existing dependency-status badge.Acceptance criteria
args: ["--connection", "postgres://user:pass@host/db"]shows a visible non-blocking warning in the editor.env: {"DATABASE_URL": "postgres://..."}does not trigger the warning.tests/test_core.pycover the detection function.Relevant code
bcc_core.pylines 598–674:is_secret_key,_is_secret_value,redact_args,_TOKEN_PREFIXESbcc.pyServerEditorclass,_refresh_dep_statusmethodSupervisor scoping note before this gets picked up:
main,MASKis ~L735). Grep for the function names, not the line numbers — anchors:is_secret_key,_is_secret_value,redact_args,_TOKEN_PREFIXES,MASK.args_secret_warning()must reuse the existing detection heuristics — do not fork a second copy. This is the same discipline that kept masking consistent across the restore diff (#3) and stale-file diff (#4); keep it here._is_secret_value, or apostgres://user:pass@host/dbstyle URL with inline creds. Do not warn on--key=valuepairs (already self-documenting, handled byredact_args).Full scoping is in
HANDOFF-next-COWORK.md.