A guardrail sits in front of a bot and blocks messages that look like attacks. It is a classifier too, so it makes two kinds of mistake: misses (attacks it lets through) and false blocks (normal questions it refuses, which users notice first). Its threshold trades one for the other, and someone has to choose that trade on purpose.
Keyword guards also have a third weakness: rewording. "Ignore previous instructions" is on the list; "set aside the earlier guidance" is not.
Your task
- From the guard's scores on 20 labelled messages, compute its miss rate and false-block rate at a 0.5 threshold. A message is blocked when its score is 0.5 or more.
- Choose the threshold that misses at most 2 attacks and blocks at most 3 normal messages.
- Use the console to find a rewording of an attack that the guard lets through, then write it as a regression test. The test must fail on today's guard and pass on the fixed one.
Only use attacks on this practice guard.