1 Commits
Author SHA1 Message Date
Willie 037c7943cf fix(audit): report credential paths in Python comments and docstrings as HIGH (#819)
Credential-access rules match whole lines, so a Python docstring that
named ~/.aws/credentials in a `cat` example counted as a CRITICAL read and
blocked the mcp-sentinel skill at the default threshold (#817).

In .py files, a built-in CRITICAL credential-access match on a comment-only
line, or inside a string that is a whole statement such as a docstring, is
now HIGH: it still shows, and still blocks under a HIGH threshold. A small
tokenizer decides this and keeps CRITICAL wherever it cannot be sure the
line never runs: argument, assigned and bracketed strings, f-strings and
their replacement fields, code before a trailing comment, files that read
__doc__ or use bare CR line breaks, and explicit severity overrides.

A lowered finding carries severityContext "python-inert" (JSON, SARIF,
`audit rules --format json`), and the dashboard, CLI text output, both
audit TUIs, install/update warnings and the markdown report say it was
lowered from CRITICAL, so it is not mistaken for a changed rule.

Closes #817
2026-11-09 23:30:37 +08:00