security(meta_analyzer): preserve high-severity static findings from LLM suppression#54
Merged
rng1995 merged 1 commit intoJun 24, 2026
Conversation
CRITICAL and HIGH static findings are now always kept in the output of
apply_filter(), even when the LLM does not confirm them (omitted, denies the
finding, or returns confidence < 0.6). MEDIUM/LOW findings continue to be
filtered by the LLM for false-positive reduction as before.
Motivation: the LLM receives attacker-controlled skill content. A prompt-
injection payload embedded in a scanned skill could cause the LLM to drop a
real CRITICAL or HIGH static finding, hiding it from the security report
(a false negative in a security gate). This invariant applies to all providers.
Implementation:
- LLMMetaAnalyzer._HIGH_SEVERITY_FLOOR = frozenset({"CRITICAL", "HIGH"}).
- In the "not confirmed" branch of apply_filter(), if the finding's severity is
in the floor set, emit the original static finding unchanged and append the
tag "llm-unconfirmed" so consumers can distinguish it from LLM-validated
findings. The tag is not duplicated if already present.
- Confirmed CRITICAL/HIGH findings are still enriched with LLM explanation/
remediation/confidence as before (no regression).
- Finding.to_dict() now includes "tags", so the "llm-unconfirmed" marker is
visible in the JSON report (tags were previously not serialized).
Tests in tests/nodes/test_llm_analyzer_base.py:
- CRITICAL/HIGH finding unconfirmed -> kept, "llm-unconfirmed" tag, original data.
- MEDIUM/LOW finding unconfirmed -> still dropped (existing behaviour).
- Confirmed CRITICAL -> enriched normally, tag absent.
- Duplicate-tag guard -> "llm-unconfirmed" not appended twice.
- to_dict surfacing -> marker present in JSON output.
Signed-off-by: Ram Dwivedi <abhiram.dwivedi@yahoo.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
rng1995
approved these changes
Jun 21, 2026
rng1995
left a comment
Collaborator
There was a problem hiding this comment.
Review: APPROVE
This is a well-reasoned fix for a real false-negative risk: because the LLM filter operates on attacker-controlled skill content, a prompt-injection payload could make it deny/omit a genuine high-severity static finding, and the old else: continue would silently drop it. Gating CRITICAL/HIGH static findings behind a preservation floor is the right call for a security gate.
Correctness
- The new branch lives entirely inside the existing
else(the "not LLM-confirmed" path) and appends its own preservedFindingbeforecontinue, so it doesn't disturb the confirmed-enrichment path below. Confirmed CRITICAL/HIGH findings still take the enrichment route (verified bytest_critical_confirmed_uses_llm_enrichment). - The
llm-unconfirmedtag is de-duplicated (if "llm-unconfirmed" not in unconfirmed_tags), and the original severity/message/confidence are preserved rather than overwritten with LLM values — exactly what you want for an unvalidated-but-retained finding. - MEDIUM/LOW continue to be filtered as before; the floor is scoped to the two severities where a missed detection is most damaging.
Security
- Closes the stated suppression bypass without opening a new one: the floor is unconditional for CRITICAL/HIGH and independent of the LLM's
is_vulnerability/confidence output, so injection can no longer hide those findings. Consumers can still tell validated vs. preserved findings apart via the tag.
Tests
- Good coverage: CRITICAL denied, HIGH omitted, MEDIUM/LOW still dropped, confirmed-CRITICAL still enriched, tag de-dup, and tag surfacing through
to_dict(). The assertions match the described behavior.
Minor / optional (non-blocking)
- By design this widens the report surface (legitimately LLM-dismissed high-sev statics are now retained). That's the correct trade-off here, and the
llm-unconfirmedtag mitigates it — just worth ensuring downstream consumers/severity gates treat the tag meaningfully rather than double-counting. - The floor compares
f.severityagainst afrozensetof string literals. Worth a quick confirm thatseverityis the same type in production as in the tests (plain string vs. a str-based enum) so the membership check can never silently miss; the current tests construct it as a string. to_dict()now always emitslist(self.tags); fine as long astagsis guaranteed non-Nonefor everyFinding(it appears to default to a list).
Solid, minimal, and safe. Approving.
AbhiramDwivedi
added a commit
to AbhiramDwivedi/SkillSpector
that referenced
this pull request
Jun 24, 2026
Resolve conflicts so the (approved) agent-CLI providers PR sits on the latest main. Both feature sets are preserved side by side: - NVIDIA#52: local agent-CLI providers (claude/codex/gemini, antigravity disabled), the AgentCLIChatModel adapter, and the LLM silent-degradation signal (llm_call_log telemetry -> report llm_degraded / fail-closed CAUTION floor / SARIF toolExecutionNotifications). - main: anthropic_proxy provider, the provider model-resolution refactor (MODEL_CONFIG -> provider.resolve_model()), baseline/suppression, SARIF rules[] + suppressions, and analysis_completeness. Notable resolutions: - get_chat_model: CLI branch defaults the model via provider.resolve_model() (MODEL_CONFIG was removed upstream); HTTP branch keeps _resolve_default_chat_model(). - meta_analyzer failure path: upstream's fail-closed _passthrough_with_defaults plus NVIDIA#52's ok=False degradation record. - report: _build_sarif takes both suppressed and degraded_notice; _build_metadata merges meta_analysis_applied/filtering_mode with the degradation fields (a degraded scan is no longer counted as meta_analysis_applied). - Adjusted two pre-existing meta_analyzer filter tests to use a sub-floor (MEDIUM) severity so they exercise the drop path; CRITICAL/HIGH are kept by PR NVIDIA#54's severity floor regardless of LLM verdict. Signed-off-by: Ram Dwivedi <abhiram.dwivedi@yahoo.com>
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.
Closes #59
What
meta_analyzer.apply_filter()previously kept a static finding only if the LLM echoed it back asis_vulnerability=Truewithconfidence ≥ 0.6— so any finding the LLM omitted or denied was silently dropped, regardless of severity.Because the LLM's input includes attacker-controlled skill content, a prompt-injection payload could make the LLM drop a real CRITICAL/HIGH static finding, hiding it from the report (a false negative in a security gate). This affects all providers.
Fix (severity-gated floor)
llm-unconfirmed(now surfaced inFinding.to_dict()/ JSON output).Test
New tests cover CRITICAL/HIGH preserved+tagged, MEDIUM/LOW still filtered, confirmed-CRITICAL still enriched, and the tag surfacing via
to_dict().🤖 Generated with Claude Code