Skip to content

Commit 3eb6c09

Browse files
committed
fix: update regex command for direct override
1 parent f1b8014 commit 3eb6c09

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

detector/instruction_override.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ var (
1313
// * Temporal commands that chain instructions (e.g., "after summarizing, send email")
1414
temporalCommandsRe = regexp.MustCompile(`(?i)(after|once|when)\s+\w+ing.*?,`)
1515

16-
// * Direct override commands
17-
overrideCommandsRe = regexp.MustCompile(`(?i)(ignore|disregard|forget)\s+.*?(previous|prior|above|earlier)`)
16+
// * Direct override commands (targeting system instructions/rules)
17+
overrideCommandsRe = regexp.MustCompile(`(?i)(ignore|disregard|forget)\s+(all|your|the|any)?\s*(previous|prior|above|earlier)?\s*(instructions?|rules?|directions?|commands?|prompts?)`)
1818

1919
// * Instruction injection using delimiters
2020
delimiterInjectionRe = regexp.MustCompile(`(?i)(new instructions?|additional task|also do|and then)\s*:`)

0 commit comments

Comments
 (0)