Skip to content

Triggers

A trigger says what a policy's score sets off, a flag or a review, for the whole template or for one field. One of your own replaces the default.

Every policy a template enables returns a score from 0 to 1. A trigger says what that score sets off once it reaches a threshold: mark the content FLAGGED, or ask for a person to look at it. You set triggers per policy, for the whole template or for one field, so the same words can flag in a description and not in a title.

The listing template below has one trigger for profanity: on the description field, with the flag effect. Test a sentence against that field.

curl https://api.useinfrared.com/v1/templates/listing/test \
  -H "Authorization: Bearer $INFRARED_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "type": "text",
    "field": "description",
    "input": "Honest sale, no bullshit: the frame is solid and it rides great."
  }'
200 OK, trimmedJSON
{
  "object": "moderation",
  "id": null,
  "template": { "slug": "listing", "version": 1 },
  "type": "text",
  "field": "description",
  "status": "completed",
  "flagged": true,
  "recommendation": "review",
  "severity": "medium",
  "policies": {
    "profanity": 0.83,
    "toxicity": 0 // the other policies of the template are trimmed
  },
  "triggered": ["profanity"],
  "rule": null,
  "reasons": ["trigger:profanity@description:flag", "triage:review"],
  "test": true
}

The same sentence, sent three ways, scores 0.83 for profanity each time. Only what the score sets off differs.

Sent asflaggedrecommendationreasons
"field": "description"truereviewtrigger:profanity@description:flag, triage:review
"field": "title"falsereviewtriage:review
No fieldtruereviewtrigger:profanity:flag, triage:review

In title the policy has no trigger, so nothing flags. The score still counts for severity, which is why the text goes to review all the same. Without field the text could be any field, so the trigger of description applies to it.

What a score sets off
A score at or over the threshold
Trigger, flagMode Trigger, effect Flag
Trigger, reviewMode Trigger, effect Review
ObserveMode Observe
Scored and returned under policies
Yes
Yes
Yes
Listed in triggered
Yes
Yes
No
Sets flagged to true
YesFlagged
No
No
Turns an allow into a review
No
Yes
No
Counts for severity
Yes
Yes
No

One policy, two triggerstoxicity

In the listing template it has a trigger for the whole template and one for description. Both flag from 0.70.

toxicity scores 0.94
Template-leveltriggersCompares the highest score across the submission.
Field-levelfields[].triggersCompares the score in description.
in description
YesFires, trigger:toxicity:flag
YesFires, trigger:toxicity@description:flag
in title
YesFires, trigger:toxicity:flag
NoDoes not fire

A policy with only a field trigger fires in that field and nowhere else.

What a policy's mode and a trigger's effect lead to, and a template-level trigger beside a field-level one.

Mode and effect

Two settings of a policy decide whether it can set anything off. Both are on the policy's row in the Policies tab, and Policy options and instructions covers them with the other settings.

ModeEffectWhen the score reaches the threshold
TriggerFlagflagged becomes true: the content is FLAGGED.
TriggerReviewflagged is left alone. If severity triage would allow the content, the recommendation becomes review.
ObservenoneNothing. The policy is scored and returned under policies, fires no trigger and does not count for severity.

A trigger that fires adds its policy to triggered, whatever its effect. A review effect never overrides a content rule and never softens a reject.

Observe keeps a policy out of triggers and severity, not out of your content rules: a rule can still test the score of a policy you only observe.

A trigger of your own

A trigger names a policy and an effect, and may carry its own threshold. This is how GET /v1/templates/{slug} returns one:

A trigger with its own thresholdJSON
{ "effect": "review", "policy": "made_with_ai", "threshold": 0.9 }
  • policy is a policy the template enables, a guideline or a wordlist included.
  • effect is flag or review.
  • threshold is optional. Without it the trigger uses the policy's threshold in this template, and without that the catalog's: 0.70 for most policies. The trigger fires when the score is at or above it.

Policies that match a pattern have no use for a threshold. links_contact, personal_data, lookalike_characters, duplicate and every wordlist fire on any match and never without one. The editor shows a Threshold input for them all the same, and it changes nothing.

For the template or for one field

Template-levelField-level
In the responsetriggersfields[].triggers
ComparesThe policy's highest score across the whole submission.The policy's score on that field.
In reasonstrigger:toxicity:flagtrigger:toxicity@description:flag

A policy can have both, and field triggers on several fields. Each one is checked on its own, so both can appear in reasons for one submission.

In a whole form, the result of each field under fields is decided with that field's triggers and the template-level ones.

The default trigger and what replaces it

A policy in Trigger mode that has no trigger of its own anywhere gets one for the whole template, from its own Effect and Threshold. That is why turning a policy on is enough for it to flag. The AI instructions get the same default: they flag from 0.70.

A trigger that names a policy in Observe mode is accepted and never fires.

An object sent without a field

A single object that does not say which field it is could be any of them. Every field trigger of the template then applies to it as if it were template-level: the last row of the table at the top. When a policy has a template trigger at 0.70 and a field trigger at 0.80, such an object is held to both, so 0.70 decides.

Name the field and the object is held to that field's triggers and the template-level ones only. Moderate text shows what else naming the field changes.

Flagged and recommendation are separate answers

Triggers with the flag effect set flagged, and nothing else does. The recommendation comes from your content rules and, when none matches, from severity triage, which reads every score whether or not a trigger fired. So content can be SAFE and sent to review, or FLAGGED and allowed.

Each row below is the listing template of the example, with one score in the description field unless the row says otherwise.

What happenedflaggedrecommendationreasons
No score reaches a thresholdfalseallowtriage:allow
toxicity 0.55, under its triggerfalsereviewtriage:review
profanity 0.83 in title, where it has no triggerfalsereviewtriage:review
profanity 0.83 in descriptiontruereviewtrigger:profanity@description:flag, triage:review
toxicity 0.94truerejecttrigger:toxicity:flag, trigger:toxicity@description:flag, triage:reject
gibberish 0.75, a review effect on a policy with a low weightfalsereviewtrigger:gibberish:review, triage:allow, review_trigger
toxicity 0.75 from an author at trust level regulartrueallowtrigger:toxicity:flag, trigger:toxicity@description:flag, rule:r5

In the last row a content rule of the template, Allow established authors, decided before triage. The flag stays: a rule changes the recommendation, not the verdict. How a decision is made follows the whole order.

Set triggers in the editor

Open a template in Templates. Triggers are set in two tabs.

Policies, for the whole template. Open a policy's row. Under its settings a small switch reads "Fires on the whole submission (implicit) unless a field trigger names it". Switch it on to give the policy a template-level trigger. The switch then reads "Fires on the whole submission with its own threshold and effect", with both to set beside it.

The Policies tab of a template with the Toxicity policy open: its mode, threshold, effect and weight, the switch for its template-level trigger, and its instructions.
Dashboard, TemplatesA policy row open on the Policies tab, with the switch for its template-level trigger.

The switch is not offered for guidelines and wordlists. Once one of them has a field trigger, it fires through field triggers only.

Fields, for one field. The Triggers column shows one badge per field trigger, and a text or image field with none reads "Template triggers". In the field's form, Add trigger adds a row: a policy, a threshold (leave it empty for the default) and an effect, Flag or Review.

A field trigger on the AI instructions or on a guideline fires only when the finding names that field, which is not always the case. Leave those two without field triggers.

Changes apply once you choose Save draft and then Publish version. The Test tab runs a sample against the draft first: see Versions, testing and diff.

Next

Something missing or unclear on this page? Write to support@useinfrared.com.