Description:
Problem
The current regex used in STAN is incorrectly flagging the word “Understand” as a prompt injection attempt.
This causes false positives when normal text contains words such as:
- Understand
- Understanding
- Understood
Example
Input:
I understand the instructions and will proceed.
Expected behavior:
- The message should pass normally without being flagged.
Actual behavior:
- The regex triggers the prompt-injection detection.
Possible Cause
It looks like the regex is matching the substring "stand" or another partial pattern inside the word “Understand”, which leads to unintended matches.
Impact
- Normal user messages are incorrectly blocked.
- Reduces usability and reliability of the prompt-injection detection.
- Could affect any sentence containing common words like “understand”.
Suggested Fix
Additional Context
This issue appears consistently whenever natural conversational text is used, especially in instruction-style messages.
Description:
Problem
The current regex used in STAN is incorrectly flagging the word “Understand” as a prompt injection attempt.
This causes false positives when normal text contains words such as:
Example
Input:
Expected behavior:
Actual behavior:
Possible Cause
It looks like the regex is matching the substring "stand" or another partial pattern inside the word “Understand”, which leads to unintended matches.
Impact
Suggested Fix
Update the regex to match whole words only (for example using word boundaries
\b).Add test cases for common words such as:
Additional Context
This issue appears consistently whenever natural conversational text is used, especially in instruction-style messages.