{
  "$format": "thethinkloop.template/v1",
  "slug": "spam-detection",
  "title": "Spam detection",
  "decides": "Whether an inbound message is spam rather than a real customer contact.",
  "question": {
    "name": "decision",
    "type": "predicate",
    "instructions": "Is this inbound message spam?"
  },
  "evidenceChecks": [
    {
      "name": "factor_1",
      "label": "Promotional content",
      "type": "predicate",
      "instructions": "The message is unsolicited promotional content."
    },
    {
      "name": "factor_2",
      "label": "References an account",
      "type": "predicate",
      "instructions": "The sender refers to a specific account, order, or ticket."
    }
  ],
  "inputs": [
    {
      "name": "message",
      "type": "string",
      "required": true,
      "description": "The customer's message, verbatim. Include the subject line if there is one."
    },
    {
      "name": "sender_domain",
      "type": "string",
      "required": false,
      "description": "The sender's email domain. Known customer domains are strong evidence against spam."
    }
  ],
  "expectedOutput": "A probability from 0 to 1 that the message is spam, plus one probability per evidence check.",
  "examples": [
    {
      "title": "Unsolicited SEO pitch",
      "input": "Dear Sir, we offer guaranteed ranking on Google with our SEO services package. 500 backlinks for $99!!! Click here: http://seo-boost.example http://rank-fast.example",
      "expected": "Yes"
    },
    {
      "title": "A real customer who can't log in",
      "input": "I can't log in to my account since this morning. The reset link never arrives. Ticket #5512 was closed without a fix.",
      "expected": "No"
    }
  ],
  "startingPolicy": {
    "automateAt": 0.95,
    "abstainBelow": 0.7,
    "note": "A starting point for exploration, not a recommendation. Calibrate against your own labeled examples."
  }
}
