Skip to main content

Custom Threat Rules (Enterprise)

Custom threat rules let enterprise admins define organisation-specific logic that overrides PhishNet's AI scan score before an email is classified as clean, suspicious, or phishing. Rules run after all scoring (deterministic checks and LLM analysis) is complete, so they can act on the final computed score as well as the email's content.


How rules work​

Each rule has:

  • One or more conditions — criteria that are tested against the email (sender domain, subject, phish score, etc.)
  • Match logic — whether all conditions must match (AND) or any one is enough (OR)
  • An action — what to do when the rule matches
  • A priority — lower number = evaluated first. The first matching rule wins; subsequent rules are not evaluated.

Actions​

ActionEffect on the score
AllowSets the score to 0, so the email is classified as clean regardless of what the AI scored it. Use this for trusted senders that occasionally trip heuristics.
FlagRaises the score to at least 40, so the email is at least suspicious even if the AI thought it was clean. A higher score is left as it is.
QuarantineSets the score to 100, so the email is classified as phishing. It's moved to quarantine automatically if the organisation's Auto-quarantine high-risk emails policy or the member's own auto-quarantine setting is on (see Policies & Preferences).

Managing rules​

Go to Enterprise → Threat Rules in the admin dashboard. The bar at the top shows where rules sit in a scan: AI score → Your rules (first match wins) → Final verdict.

Creating a rule​

  1. Click + New rule.
  2. Enter a Name (required) and an optional Description, which is shown in the rules list.
  3. Set the Priority: a whole number, default 100. Lower numbers run first.
  4. Under When, choose whether all or any of the conditions must match.
  5. Add conditions. Each one is a field, an operator and a value. Click + Add condition for more; rows left blank are ignored.
  6. Under Then, choose Allow, Flag or Quarantine. Each option shows its effect on the score.
  7. Check the Preview line, which describes the rule in plain English, then click Create rule.

The editor only offers operators that fit the field. A phish score must be a whole number from 0 to 100, and a regular expression is checked when you save; if it's invalid, the editor shows why.

Editing a rule​

Click Edit on any rule, make your changes and click Save rule. Changes apply to the next email scanned.

Pausing a rule​

Use the toggle on a rule to pause it without deleting it. Paused rules are dimmed, marked Paused and skipped during scanning. Turn the toggle back on to resume.

Reordering rules​

Rules are listed in the order they run. Use the ▲ and ▼ arrows beside a rule's priority number to move it up or down. Moving a rule swaps its priority with its neighbour's. If rules share a priority, the whole list is renumbered in steps of 10 (10, 20, 30…) so the new order sticks.

Deleting a rule​

Click Delete on a rule, then Delete again to confirm. This can't be undone; pause the rule instead if you might need it later.

Rule priority​

Rules run in ascending priority order (1 before 2, 10 before 100), and the first rule that matches wins. When two rules have the same priority, the older rule runs first.

If you have many rules, keep your most specific or highest-confidence rules at low priority numbers so they are evaluated first.

If a rule can't be evaluated, for example one saved before the editor's current checks existed, it's skipped and the rules after it still run.


Conditions​

Each condition targets one field of the email and applies an operator and a value.

Available fields​

FieldWhat it matches
Sender emailThe full from-address (e.g. phishing@evil.com)
Sender domainThe domain portion of the from-address (e.g. evil.com)
Display nameThe sender's display name as shown in the inbox (e.g. IT Support)
SubjectThe email subject line
Body textThe first portion of the email body
Phish scoreThe numeric threat score (0–100) computed by PhishNet before rules run
Any URLTrue if any URL in the email matches the condition
Any attachmentTrue if any attachment filename matches the condition

Available operators​

Text fields (every field except Phish score). All of these ignore case except matches regex:

OperatorMatches when…
equalsField exactly equals the value
not equalsField does not equal the value
containsField contains the value as a substring
starts withField begins with the value
ends withField ends with the value
matches regexField matches the regular expression. Case-sensitive; start the pattern with (?i) to ignore case. Uses RE2 syntax, so lookarounds and backreferences aren't supported.

Phish score (a whole number from 0 to 100):

OperatorMatches when…
equalsScore is exactly the value
not equalsScore is not the value
≥Score is greater than or equal to the value
≤Score is less than or equal to the value

Example rules​

Block a specific domain​

Quarantine all email from a known-bad sender domain, regardless of what the AI scored.

FieldOperatorValue
Sender domainequalsevil-lookalike.com

Action: Quarantine · Logic: All · Priority: 10


Protect against display-name spoofing​

Flag any email claiming to be from "IT Support" or "Help Desk" that doesn't come from your internal domain.

Condition 1:

FieldOperatorValue
Display namematches regex(?i)it support|help desk

Condition 2:

FieldOperatorValue
Sender domainnot equalsacme.com

Action: Flag · Logic: All · Priority: 20


Suppress false positives for a trusted partner​

A supplier's invoicing system sends automated emails that occasionally trip the AI's urgency heuristics. Allow them unconditionally.

FieldOperatorValue
Sender domainequalsinvoices.trustedsupplier.com

Action: Allow · Logic: All · Priority: 50


Escalate high-score emails from outside your organisation​

Emails scoring 70 or more are already classified as phishing, but auto-quarantine only starts at 80. This rule pushes every external email scoring 70 or more to 100, so auto-quarantine catches the 70–79 band too.

Condition 1:

FieldOperatorValue
Phish score≥70

Condition 2:

FieldOperatorValue
Sender domainnot equalsacme.com

Action: Quarantine · Logic: All · Priority: 30


How rules interact with policies​

Custom threat rules run after all org policies (trusted-sender allowlist, domain blocklist) and before the final classify step. The processing order is:

  1. Deterministic checks (SPF, DKIM, URL heuristics)
  2. LLM analysis (PhishNet's models, or your organisation's own provider)
  3. Trusted-sender allowlist
  4. Block known phishing domains (org policy)
  5. Custom threat rules ← runs here
  6. Final classification (clean / suspicious / phishing)

If a trusted-sender allowlist entry already set the score to 0, a custom rule can still raise it. Rules operate on whatever score exists at the time they run.

When a rule matches, the email's details on the Threats page include a note such as Custom rule "Block spoofed domains" applied: quarantine, so admins can see exactly which rule fired and what it did.


Requirements​

  • PhishNet Enterprise plan
  • Admin or Owner role in the PhishNet admin dashboard