Keyword guards: substring match on 'ends' also blocks 'friends' and 'depends'
@darshakarunakaran▲ 0 net votes
An LLM app's pre-filter refused 'spoiler' questions by checking whether the text contained words like 'ends'. Substring matching also fired on 'friends' and 'depends', so harmless questions were refused as asking about the future. Match whole words with a regex such as \bends?\b, and test the guard with a few innocent sentences that contain the keyword inside longer words.