Skip to content

fix: ignore structural markdown comments in static engine#49

Open
Rachitrajvaishkiyar wants to merge 1 commit into
NVIDIA:mainfrom
Rachitrajvaishkiyar:fix/issue-37-static-false-positives
Open

fix: ignore structural markdown comments in static engine#49
Rachitrajvaishkiyar wants to merge 1 commit into
NVIDIA:mainfrom
Rachitrajvaishkiyar:fix/issue-37-static-false-positives

Conversation

@Rachitrajvaishkiyar

Copy link
Copy Markdown

Description

Addresses the false positives reported in #37 where the static P2 prompt injection analyzer flags benign structural elements inside Markdown files.

Changes Introduced

  • Added an exemption gate inside the P2 regex match loop to ignore harmless structural markdown headers, templates, and machine metadata stamps (template:, theme:, coalmine:, revalidate).
  • Implemented a check to safely bypass standard HTML/Markdown comment blocks (``) unless they explicitly contain active adversarial or override instructions (e.g., ignore previous, `system prompt`, `override instructions`).

This ensures the scanner remains highly effective against actual prompt injections while eliminating noisy flags on purely structural text layout elements.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant