fix(security): harden spoofed system marker handling

This commit is contained in:
Peter Steinberger
2026-03-02 06:18:52 +00:00
parent 7c9d2c1d48
commit 5b8f492a48
11 changed files with 158 additions and 34 deletions

View File

@@ -27,6 +27,8 @@ const SUSPICIOUS_PATTERNS = [
/delete\s+all\s+(emails?|files?|data)/i,
/<\/?system>/i,
/\]\s*\n\s*\[?(system|assistant|user)\]?:/i,
/\[\s*(System\s*Message|System|Assistant|Internal)\s*\]/i,
/^\s*System:\s+/im,
];
/**