The input lists are bounded by the number of phrase patterns (5+5),
so the sorted-scan optimization added complexity for no practical
benefit.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sort all match positions and scan linearly instead of checking every
a-b pair. Early-exits on overlap (gap=0) or once the gap drops below
the threshold.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Token detection is already handled by the token_patterns detector
running separately — calling it again from scan_naive_injection was
redundant. New logic:
- Warn on any disclosure phrase
- Warn on any jailbreak phrase
- Block when both appear within 500 chars of each other
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>