security(meta_analyzer): preserve high-severity static findings from LLM suppression#54
Open
AbhiramDwivedi wants to merge 1 commit into
Open
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>
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