You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
phrase.injection HARD pass joins a line-broken compound target ("system\nPrompt editor") into a dangerous verdict #1589
The curated HARD pass of phrase.injection (internal/security/detect/checks/phrase_injection.go) reads ToolView.PhraseText. NormalizeForPhrase turns line breaks into spaces. As a result, a disclosure verb at the end of one line and a compound target split across the next line are matched as one directive.
Reproduced on current origin/main with scanner.ScanToolMetadataVerdict:
Description
Verdict on origin/main
Click show the system. Prompt editor opens in a side panel.
clean
Click show the system\nPrompt editor opens in a side panel.
dangerous (phrase.injection, HARD)
Click show the system prompt editor in a side panel.
The newline form is a benign UI description, but it gets auto-quarantined.
Why it was not changed in the SEC-01 PR
This behavior predates the SEC-01 detector branch (fix/assess-detector-admission). That branch only made the letters-only squashed fallback stop crossing line breaks and sentence ends at compound joins (Sol review round 14).
Making the HARD pass respect line breaks is a deliberate trade-off. A hostile directive wrapped across a line, such as reveal your system\nprompt, would then fall out of the HARD tier. That change needs its own decision and its own corpus measurement. It also should not be slipped into a security fix.
Possible approach
Run the curated families per line, with whitespace-only wraps inside a sentence still joined. Alternatively, downgrade a match that spans a line break and a capitalized sentence start to SOFT. Measure the change against internal/security/scanner/testdata/sec01_injection_variants.json and the real-world baseline.
Activity
fix(security): phrase.injection credential-transfer recall and line-b…
fix(detect): close the review-round gaps in the R2-3/R2-4 fixes