From 8d29ecd02f2afe93b53f2494b6e472290db2de39 Mon Sep 17 00:00:00 2001 From: Jeremy McSpadden Date: Sat, 4 Apr 2026 14:50:04 -0500 Subject: [PATCH] fix: add missing 'act as' injection pattern to prompt guard hook (#1697) Fixes #1696 The gsd-prompt-guard.js hook was missing the 'act as a/an/the' prompt injection pattern that security.cjs includes. Adds the pattern with the same (?!plan|phase|wave) negative lookahead exception to allow legitimate GSD workflow references. --- hooks/gsd-prompt-guard.js | 1 + 1 file changed, 1 insertion(+) diff --git a/hooks/gsd-prompt-guard.js b/hooks/gsd-prompt-guard.js index 61ce81a64..966e98955 100644 --- a/hooks/gsd-prompt-guard.js +++ b/hooks/gsd-prompt-guard.js @@ -22,6 +22,7 @@ const INJECTION_PATTERNS = [ /forget\s+(all\s+)?(your\s+)?instructions/i, /override\s+(system|previous)\s+(prompt|instructions)/i, /you\s+are\s+now\s+(?:a|an|the)\s+/i, + /act\s+as\s+(?:a|an|the)\s+(?!plan|phase|wave)/i, /pretend\s+(?:you(?:'re| are)\s+|to\s+be\s+)/i, /from\s+now\s+on,?\s+you\s+(?:are|will|should|must)/i, /(?:print|output|reveal|show|display|repeat)\s+(?:your\s+)?(?:system\s+)?(?:prompt|instructions)/i,