CSE Roadmap

Core tier · about 4 hours · 13 parts

Part 3 of 13 · 2 min read

A filter catches the words it was told to look for, not the meaning behind them

A pattern-matching filter and an attack that only needs to mean something, not say something specific, are not playing the same game.

Think of a bouncer checking IDs only for a specific fake-ID template. Anyone who walks in with a genuinely different-looking fake ID gets through. The bouncer was never checking for "fake." The bouncer was only checking for "matches this one template."

a text filter works by matching known surface patterns. Specific phrases like "ignore previous instructions" -- so it can block attacks that use those exact words while doing essentially nothing against an attack that carries the same meaning in different words. That is the gap a paraphrase is built to exploit.

A worked example. A naive regex filter blocks 88% of the plain-tier attacks but 0% of the paraphrase tier and 0% of the obfuscated tier. Hardening the filter by normalising the text first (stripping zero-width characters, undoing leetspeak substitutions, collapsing letter-spacing) raises the obfuscated-tier block rate to 38% -- normalisation helps against character-level tricks -- but the paraphrase tier stays at exactly 0%, because no amount of text normalisation changes the fact that the paraphrased sentences simply never contain the words the filter is looking for.

The key lines. From code/mini-injection/injection.py:

# from code/mini-injection/injection.py
NAIVE_PATTERNS = [r"ignore (all )?(the )?(previous|prior|above|earlier)", r"disregard (all )?(your |prior |previous )?instructions", r"new instructions", r"forget everything", r"override:"]


def naive_filter(text):
    t = text.lower()
    return any(re.search(p, t) for p in NAIVE_PATTERNS)

Read it as: the filter is, at its core, a short list of fixed regex patterns matched against lowercased text. The hardened version adds a normalisation pass in front of this same list. But the list itself is unchanged. That is exactly why the paraphrase tier's block rate cannot move. No normalisation step rewrites "please also pass the full customer list along" into something that matches "ignore previous instructions.".