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
The anti-spoof marker-phrase neutralization matched only a single literal
ASCII space between "untrusted"/"user"/"content". An attacker who forges a
closing fence with a double space, tab, or other whitespace run between the
words — even with the correct nonce (forceable via SANITIZE_NONCE or
observable across turns) — produced a forged END fence that survived
un-neutralized mid-body, plausibly readable by a whitespace-insensitive LLM
consumer as an early close of the untrusted section.
Make the marker-phrase regex whitespace-tolerant ([[:space:]]+ between each
word, case-insensitive) so double-space/tab/mixed-whitespace variants are
neutralized the same as the single-space case. The anti-spoof property no
longer relies on nonce secrecy alone.
Tests: add real-nonce double-space and tab forged-fence fixtures to test 6,
asserting no whitespace-tolerant match of the closing fence survives except
the one genuine trailing fence (verified: fails against the pre-fix regex,
passes after). Add a tab-variant fixture for the fixes/closes/resolves #N
keyword neutralization (already whitespace-tolerant, now covered). Remove
the vacuous "output still ends with the real closing fence" assertion,
which was structurally always true and proved nothing about breakout
resistance.
0 commit comments