Command Palette

Search for a command to run...

Hectal
Phase 10: Safety and Security (Defensive)
LLM Engineering · Exercise 5 of 5 Previous
Advanced

Run a red-team suite

Write run_suite(app, cases). app is a function from a message to a reply. Each case is a tuple (name, message, forbidden).

Return the list of case names, in order, whose reply contains the forbidden text, ignoring upper and lower case. Return an empty list when every case passes. An empty forbidden text means the case cannot fail.

What Check tests

  1. A failing case is reported
  2. A passing suite returns an empty list
  3. The comparison ignores case
  4. Names come back in order
  5. An empty forbidden text cannot fail

Stuck? One hint at a time

The solution unlocks after your first Check. Try first: that is where the learning happens.

main.py
Sign in to run your code.

Output

Press Run to see what your program prints.