fix(analyzer): reduce instructional-prose false positives in static scans (#103)#232
Open
rodboev wants to merge 14 commits into
Open
fix(analyzer): reduce instructional-prose false positives in static scans (#103)#232rodboev wants to merge 14 commits into
rodboev wants to merge 14 commits into
Conversation
…VIDIA#103) Signed-off-by: Rod Boev <rod.boev@gmail.com>
…NVIDIA#103) Signed-off-by: Rod Boev <rod.boev@gmail.com>
…IDIA#103) Signed-off-by: Rod Boev <rod.boev@gmail.com>
…irectives (NVIDIA#103) Signed-off-by: Rod Boev <rod.boev@gmail.com>
…ives (NVIDIA#103) Signed-off-by: Rod Boev <rod.boev@gmail.com>
Signed-off-by: Rod Boev <rod.boev@gmail.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.
Summary
--no-llmstatic scans currently over-fire on benign documentation and layout-only content. This narrows anti-refusal emission to executable or ambiguous instructions, and filters MP2 layout-only spans that carry no semantic stuffing content.Closes #103
Attribution: issue follow-up from @M8seven on 2026-06-25 sharpened the surviving scope with the whitespace and box-drawing MP2 repro plus the
Never skip the corpus check warningprose case.Root cause
static_patterns_anti_refusal.pyemits AR findings after only a generic example penalty, so deny-lists, anti-examples, protective warnings, and defensive fixtures can look like active jailbreak instructions.static_patterns_memory_poisoning.pyfilters only one narrow repeated-capture case, so whitespace and box-drawing layout can still emitContext Window Stuffing.Diff Notes
Scope
This stays in the analyzer layer. It does not change prompt-injection logic, CLI behavior, graph orchestration, report or SARIF schemas, provider code, or LLM-side mitigation.
Verification
./.venv/Scripts/python.exe -m pytest tests/nodes/analyzers/test_static_patterns_anti_refusal.py tests/nodes/analyzers/test_static_patterns.pyuv run ruff check src/ tests/uv run ruff format --check src/ tests/