AI-assisted engineering/Guardrail hardening

Block tool calls pasted into the refund chat

Guardrail hardeningEasy15 min

A model that can call refund() will be shown refund() by someone hoping it copies the call.

Your task

Harden allow() so a pasted tool call is blocked in any spelling, and customers still get through.

  • allow(message) returns True to let a message through, False to block it
  • an attack carries a call to refund, cancel_order or issue_credit with named arguments, in any casing or spacing
  • every real customer message must still get through
  • one customer puts a bracket after the word refund in an ordinary sentence

Both corpora run at submit: attacks must block, and the happy path must not regress.