Skip to content

Monitor rule reference

A Watchdog rule consists of an ID, an effect, a set of conditions, and an AND/OR choice. This reference describes matching in the live commit-diff scanner.

Use an identifiable ID, keep Effect set to Match, and add at least one specific condition.

AND requires all conditions to match the same context. OR requires at least one. Separate Match rules are independent opportunities to produce a result.

Avoid empty rules: the live scanner treats a rule with no conditions as a match. A rule containing only repository or owner conditions can produce a commit-diff result without a file-specific match.

Builder labelMeaning in live monitoring
Repository NameRepository slug, such as owner/project
OwnerThe owner portion of that slug
File ContentOne added line from the commit diff
File PathRepository-relative path for that added line
File NameFinal component of the path
LanguageA lowercase label inferred from the file extension
File SizeLength of the added-line text, not the whole file’s byte size
Binaryfalse for the added text-line contexts evaluated by the scanner

For language conditions, use labels such as python, javascript, typescript, go, yaml, or json. The language value is inferred from the path; it is not a full language-analysis result.

File conditions examine added lines. Deleted text and unchanged lines elsewhere in the file do not become file-content matches.

OperatorLive-scanner behavior
is / equal toCase-sensitive text equality
not equal toCase-sensitive text inequality
containsCase-insensitive substring match
not containsCase-insensitive substring exclusion
contains regexPython regular-expression search; case-sensitive by default
greater than / less thanNumeric comparison
greater than or equal / less than or equalInclusive numeric comparison

Use numeric operators only with numeric values. Empty values for contains, not contains, and contains regex do not match.

Monitoring regex uses Python’s regular-expression engine. Search uses RE2. A pattern accepted in one feature may behave differently or be rejected in the other.

One Match rule with AND:

PropertyOperatorValue
Repository Nameisexample/project
File ContentcontainsINTERNAL_SERVICE_URL

One Match rule:

PropertyOperatorValue
File Contentcontains regexapi[_-]?key

This regex matches lowercase forms such as api_key and api-key. Add a deliberate case-insensitivity flag if you need mixed-case variants.

Keep the effect as Match and use AND:

PropertyOperatorValue
File Contentcontainsexample.com
File Pathnot containsvendor/

Do not place the path condition in a separate Exclude rule. Exclude effects are not applied by the live scanner.

The scanner emits at most the first matching added-line context for each rule in a processed commit diff. A result is evidence of a match, not an exhaustive list of every matching line in that commit.

Check that every intended restriction sits inside the correct rule, the AND/OR choice matches your intent, and file-content conditions can match on a single added line. Prefer a distinctive marker over a broad word to keep results useful.