promptdojo_

The escalation boundary — where money, law, and anger stay human — step 7 of 8

Write the router: triggers_hit(t) and route(t), then run the five tickets through it.

triggers_hit(t) returns the list of trigger names that fire, checked in this order:

  1. emotional"emotional language"
  2. legal"legal or chargeback threat"
  3. amount over REFUND_LINE (strictly greater) → "over the refund line"
  4. contacts of 3 or more (default 1) → "third contact"
  5. regulator"regulator or media mention"

route(t) applies the three lists: any trigger → "human-only"; otherwise a refund ask → "draft+approver"; otherwise "ai-may-draft".

Use .get() with defaults everywhere — real tickets arrive with fields missing, and a KeyError in the router takes the whole queue down with it.

Expected output:

T-21: draft+approver
T-22: human-only
T-23: ai-may-draft
T-24: human-only
T-25: human-only

full-screen editor opens — close anytime to keep reading.