Detection rules
Author stopword, regex, blacklist, combo, and AI rules that tag scans, and recheck existing scans against new rules.
Custom rules let you tag scans for things specific to your business — a competitor's brand, a prohibited phrase, a risky redirect pattern.
Rule types
- Stopword — match literal terms, either in the page content
(
stopword_content) or in a URL in the chain (stopword_url). - Regex — match a regular expression against page content
(
regexp_content), main-frame URLs in the redirect chain (regexp_url), every captured network and subresource request URL (regexp_request_url), or the contents of the sub-resources the page loaded (regexp_request_body). Request-URL and request-body rules choose a target like content rules do: the landing page, the creative, or both. - Blacklist domain — flag when the redirect chain touches a domain on your list.
- Combo — combine conditions on other tags (e.g. a keyword and a redirect to a given domain), counted either across the whole scan or within a single link. See combo rules.
- AI — describe in natural language what to flag; the AI applies it.
Authoring
Open Rules -> New Rule, pick the type, define the condition, and
choose which tag it assigns and which target it inspects —
page (the landing), the creative, or both. The available targets
depend on the rule type. Save to activate.
On an ad-tag scan the creative loads sub-resources of its own, inside
its own frame — they appear on no landing page's request list. A rule
aimed at page therefore cannot see them, which matters most for the
thing they are usually hiding: a payload whose filename rotates every
few hours. Aim the rule at the creative, or at both surfaces to reuse
one pattern; a match reports which surface it came from either way.
The creative's own request tree is shown under Creative
sub-requests on the scan report. The page an HTML tag is rendered on
— the scan's referrer, when it has one — is not among those requests:
the creative never asked for it, so a rule aimed at the creative does
not match it.
Network-request and request-body regex rules accept a non-empty
pattern of at most 4,096 characters and optional flags. Omit
flags or use an empty string for case-sensitive matching; i enables
case-insensitive matching. Other flags and config keys are rejected
before the rule is saved or tested.
To check a rule before saving it, test it against scans you already have. Through the API you can test up to 20 draft rules against up to 50 scans in one call; see the Rule testing API.
Matching sub-resource contents
regexp_request_body matches the bytes a page's sub-resources
served, not their addresses. Use it when the thing you want to catch
keeps the same code but changes its filename on every visit — the
pattern that defeats a regexp_request_url rule.
What the pattern is run against, per scan:
- The scripts and
fetch/XHRresponses the page loaded, plus the documents inside its iframes. The landing document itself is covered byregexp_content, and images, video, fonts and stylesheets are never captured. - Up to 400 sub-resources, each up to 1 MB, and up to 8 MB in total. A resource above those limits is recorded by URL but its content is not searched.
Captured contents are kept for one day. A rule test against a scan older than that finds nothing to match — which reads exactly like a non-match, so test new body rules against a recent scan.
System and shared rules
Your list holds your own rules only. The System rules the platform
maintains and the rules other organizations shared keep working on your
scans, but they are not listed, they do not open, and they cannot be
switched per organization:
GET /api/v1/custom-rules/{id} answers 404 for them. To stop a tag the
platform or another organization sets, switch the tag off for your
organization in Tags.
Switching single tags of an AI rule
An AI rule can hold several tags. Each tag of your own AI rule has an Active / Inactive switch next to Remove tag. A tag you switch off is no longer checked on your new scans; the other tags of the rule work as before. Its description is kept, so switching it back on needs no setup. Tags already set on scans stay until you recheck the scan: a recheck runs the scan against the tags that are on now and removes the ones you switched off.
The rule list shows how many tags are on, for example «3 of 5 tags active». With every tag off the rule shows as Inactive; its own switch is not changed.
If a tag is read by an active combo rule of your own, you see the list of those rules before you switch the tag off. A tag of high severity also shows the warning that disabling it may let malicious ads go undetected.
Through the API, PUT /api/v1/custom-rules/{id}/disabled-tags with
{"slugs": [...]} sets the tags that are off ([] turns all on). A slug
that is not a tag of the rule answers 422 checking.unknown_rule_tag;
a rule that is not yours answers 404. Responses carry disabled_tags,
tag_disable_impact and security_tags (the high-severity tags that are
on). The MCP tool set_custom_rule_disabled_tags does the same. Each
change is recorded in the audit log.
With every tag off, is_active in a response reads false while the
rule's own switch is unchanged. Do not send that false back in an
update: the rule would stay Inactive after you switch its tags on again.
Send is_active only to switch the rule itself.
Rechecking
After saving a rule, switching one of its tags on, or switching your own rule from Inactive to Active, you can recheck existing scans so historical results pick up the new tag — handy when you add a rule in response to an incident and want to find everything it already touched.
A recheck removes the tags you switched off in your own AI rules from the rechecked scans, and it is the way to clean past reports of them. A platform tag you switched off in Tags is hidden from every scan at once and needs no recheck. The dialog says so.
Fresh scans provide request-URL rules with up to 5,000 captured network URLs. Rule tests and rechecks of an existing scan reconstruct URLs from its persisted initiator tree, which currently stores the main-frame hops and up to 200 subrequests and omits selected resource types. Historical request-URL results are therefore best-effort; the ordinary redirect-chain fields and their existing rule semantics are unchanged.