Cortex Platform Correlation Author
ASecurityAuthor Cortex XSIAM correlation rules. Turns a described detection -- what to look for, over which dataset -- into a complete correlation YAML with a defensible query, a suppression key that mutes repeats without muting findings, resolved alert fields and its provenance recorded inside the rule. Use whenever writing or fixing a correlation rule, choosing or auditing a suppression key, setting a threshold or a search window, deciding whether a rule ships enabled, or working out why a correlati...
- 7 stars
- 0 votes
- 0 copies
- 2 views
- Added November 28, 2026
Security analysis
100/100Pro scans all 16 files and shows the line behind each finding
npx -y skills add gocortexio/skills --skill cortex-platform-correlation-author --agent claude-codeAre you the author of Cortex Platform Correlation Author?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/gocortexio-cortex-platform-correlation-author)---
name: cortex-platform-correlation-author
description: Author Cortex XSIAM correlation rules. Turns a described detection -- what to look for, over which dataset -- into a complete correlation YAML with a defensible query, a suppression key that mutes repeats without muting findings, resolved alert fields and its provenance recorded inside the rule. Use whenever writing or fixing a correlation rule, choosing or auditing a suppression key, setting a threshold or a search window, deciding whether a rule ships enabled, or working out why a correlation returns nothing.
version: 0.12.2
license: AGPL-3.0-or-later
---
<!--
SPDX-FileCopyrightText: GoCortexIO
SPDX-License-Identifier: AGPL-3.0-or-later
-->
# Authoring a Cortex XSIAM correlation rule
The current version is 0.12.2; the per-version change history lives in [CHANGELOG.md](CHANGELOG.md).
A correlation rule is a query, usually a schedule, and a suppression key. The query is the easy
part. Almost every way a correlation fails in production is one of the other two, and none of them
raises an alert: a rule that never fires looks exactly like a quiet estate, and a rule whose
suppression key is wrong looks exactly like a rule that has already alerted.
**This skill owns the SUBJECT: the rule's format, its fields, its query and what makes each
defensible.** It does not own the SEQUENCE. When a correlation gets designed, what has to be
measured on the tenant first, and how the result is verified after it ships belong to whoever
calls it. Invoked standalone, ask the caller for the dataset, the modelled fields available on it,
and what the detection is meant to catch.
## Announcing, and stopping loudly
Print a STAGE banner on entering every stage of this skill's own workflow, and NEVER ask the
caller a question outside a `!` or `?` banner. A question in a paragraph is how a run sits idle
while everyone waits for the other one; a stage nobody announced is a stage nobody can see you
are in.
COPY the templates from [references/console-output.md](references/console-output.md), at the
boundary, and never render one from memory -- a typed banner loses the squirrel first, then the
rules, then the named sections. That page, identical in every instrument bundle in this project,
carries the three fills, the art and the rules for each. The banner is the FIRST thing in the
reply that enters a stage, and the LAST thing in a reply that stops.
## What this skill needs to be given
| Give it | Why it cannot be guessed |
| --- | --- |
| The dataset name, and whether it is modelled | An unmodelled dataset has no `xdm.*` vocabulary, which changes every field decision in the rule |
| The fields the modelling rule actually assigns, and the constant values of any field it only ever sets to constants | A filter on a field the model never sets, or on a value it never produces, returns nothing for ever, and nothing reports it |
| What the model writes for each field the query reads when the vendor sent nothing: null, an empty string, a zero or a sentinel | A null test, a `coalesce` and a suppression key are each decided by that write, and it differs by model and by version |
| For a snapshot dataset, which values the model sets only while an object is new | Without it a rule over a snapshot cannot be told from a standing-condition report |
| What the detection is meant to catch, in words | The archetype follows from this, and the archetype decides the suppression key |
| A real measurement of the data, if a number is wanted | A threshold with no measured gap behind it is invented, and this skill will say so |
A caller that builds packs may send these with the request, the modelled map built from the
pack's files and the absent-value writes carried from cortex-platform-xdm-author. Otherwise, ask
for them. Either way, **read the dataset's modelling rule** before trusting a null
test, a `coalesce` or a key on one of its fields: what a field is assigned FROM, and what it is
assigned when the vendor sent nothing, are decided there, and the rule is right about its own
dataset whatever any page says. XDM field semantics -- what a field means, its schema type,
whether it is an array, which side of an event it sits on, the absent-value conventions -- are
cortex-platform-xdm-author's, and its page on reading a dataset it modelled indexes them; this
bundle does not restate them. What a CORRELATION may do with an `xdm.*` field is this bundle's
([references/editor-rules.md](references/editor-rules.md)), because the correlation editor
refuses things the engine runs.
## The linter
`scripts/lint_correlation.py` holds every predicate that judges one correlation from its own
text: the suppression key, the thresholds, the provenance claims, the alert-field map, the alert
text, the constructs the correlation editor rejects, the prose checks. Run it on a file:
```bash
python3 scripts/lint_correlation.py <rule.yml> # readable
python3 scripts/lint_correlation.py <rule.yml> --format json
python3 scripts/lint_correlation.py <rule.yml> --modelled <map.json>
```
It reads a DOCUMENT and never a repository. Where a caller can supply a
`dataset -> assigned xdm.* fields` map it judges more precisely; where that map also says what
each field can carry -- the constants every branch of the modelling rule can assign -- it can tell
a field the model only pads from one it fills, and a filter literal the model never produces from
one it does; without them only the field-level half runs. Where it has no map it says so rather
than guessing -- a dataset nothing models, read raw, has no `xdm.*` vocabulary, and the suppression key's entity law
cannot be evaluated against a vocabulary that does not exist; a `datamodel` read is the platform's model.
Every predicate that needs the query's structure (its columns, groups, datasets and pinned
filters) reads it through one model of the pipeline, which knows the columns after each stage,
which hold arrays, and which source fields each one's value comes from. Where the walk fails, or
the text reads two ways, the model abstains, and each reader answers as it did before the model,
save one: a `coalesce()` alias stays not unique either way.
It reports at three severities. A PROBLEM refuses. A WARNING names a defect, or the risk of one,
that does not stop the rule running, and asks for a fix. A NOTICE raises a question only the
author can answer.
| Codes | Severity | Explained in |
| --- | --- | --- |
| `WARN-CORR-SUPPRESSION-COMMA`, `WARN-CORR-SUPPRESSION-OFF-FIELDS`, `WARN-CORR-SUPPRESSION-NOT-A-KEY`, `WARN-CORR-CATEGORY-OUTSIDE-ENUM` | warning | [references/suppression.md](references/suppression.md) |
| `ERR-CORR-PROJECT-UNPRODUCED`, `ERR-CORR-OUTCOME-CONST` | problem | "Query rules learned the hard way", below |
| `ERR-CORR-FILTER-OUTSIDE-MODEL`, `ERR-CORR-FILTER-NEVER-MATCHES` | problem | "Filter on the MAPPED field", below |
| `ERR-CORR-TEMPLATE-UNRESOLVED`, `ERR-CORR-ARRAY-IN-NAME`; `WARN-CORR-TEMPLATE-UNRESOLVED`, `WARN-CORR-TEMPLATE-PREFIX`, `WARN-CORR-ARRAY-IN-DESCRIPTION`, `WARN-CORR-NULL-ALTERNATIVE`, `WARN-CORR-TEXT-POINTS-AT-FIELD` | problem; warning | [references/alert-text.md](references/alert-text.md) |
| `ERR-CORR-XDM-WRITE`, `ERR-CORR-SAME-STAGE-READ`; `WARN-CORR-SAME-STAGE-READ` | problem; warning | [references/editor-rules.md](references/editor-rules.md) |
| The alert-field declaration: `AUTO`, or `CUSTOM` mapping nothing | problem | [references/alert-field-mapping.md](references/alert-field-mapping.md) |
| `WARN-CORR-ADDRESS-BOTH-SIDES`; `INFO-CORR-BOTH-IP-FAMILIES`, `INFO-CORR-IPV6-IN-REMOTE-IP`, and the alert-field coverage | warning; notice | [references/alert-field-mapping.md](references/alert-field-mapping.md) |
| `WARN-CORR-DECISION-VALUES-LABEL`, `WARN-CORR-DECISION-VALUES-NOT-LAST`, `WARN-CORR-DECISION-VALUES-ENTRY`, `WARN-CORR-DECISION-VALUES-DUPLICATE-KEY`, `WARN-CORR-DECISION-VALUES-KEY-IN-PROSE` | warning | [references/alert-field-mapping.md](references/alert-field-mapping.md) |
| `INFO-CORR-REALERT`, `INFO-CORR-MUTE-OVER-WINDOW`, `INFO-CORR-VOLATILE-KEY` | notice | [references/suppression.md](references/suppression.md) |
| `INFO-CORR-CLASS-ONLY`, `INFO-CORR-STANDING-CONDITION`; `WARN-CORR-REALTIME-SHAPE` | notice; warning | [references/archetypes.md](references/archetypes.md) |
A caller that builds packs may import these predicates rather than copy them, supply the modelled
map from its own pack files, and apply its OWN severity policy to what comes back. That is the
division: this bundle decides what is TRUE of a rule, the caller decides what to do about it.
## The reference pages
Read the page before doing the thing, never from memory of it.
| Read this | When |
| --- | --- |
| [references/suppression.md](references/suppression.md) | BEFORE choosing or changing any suppression key. The largest body of knowledge here and the easiest to get quietly wrong |
| [references/thresholds-and-numbers.md](references/thresholds-and-numbers.md) | Whenever the rule wants a number: a threshold, a window, a count |
| [references/alert-field-mapping.md](references/alert-field-mapping.md) | BEFORE writing `alert_fields`, when choosing a SEVERITY, and whenever asking what the platform maps without being told |
| [references/alert-text.md](references/alert-text.md) | BEFORE writing `alert_name` or `alert_description`, and whenever an alert reads INVALID_VALUE or NULL |
| [references/editor-rules.md](references/editor-rules.md) | BEFORE calling a rule accepted, and whenever the correlation editor marks a rule that pre-flighted clean |
| [references/provenance.md](references/provenance.md) | When writing the rule's comment block, and before any sweep that edits rules in bulk |
| [references/archetypes.md](references/archetypes.md) | When the source aggregates or is a snapshot, the rule mirrors a vendor's alerts (REAL TIME), the finding names a few things among many, the alert feeds automation, or the signal is a foreign grammar rather than a value |
| [references/run-history.md](references/run-history.md) | Before calling a rule live, and FIRST whenever a rule returns nothing: whether it RUNS, before whether it has FIRED |
## The laws of this skill
- **NEVER filter on a string the model happened to produce.** Filter on the MAPPED field.
- **NEVER hard-code an exclusion.** Surface the field and let the product exclude on it.
- **A suppression key names the ENTITY the alert is about**, and arity is not the safety property.
- **A number with no measured gap behind it is invented**, and the rule must say which it is.
- **A rule that ships disabled says so in two places**, the rule and the README.
- **A rule carries the fields the tenant exports and uses** -- `action`, `alert_domain`, an
`is_enabled` that is always present, and `suppression_fields` as the list the export writes --
and demisto/content CI's ST110, which rejects `action`, `alert_domain`, `alert_type`,
`is_enabled`, `timezone`, `lookup_mapping` and a list `suppression_fields`, does not change that:
the owner decided on 2026-10-22 to keep them because tenant behaviour wins, KNOWN AND ACCEPTED;
do not re-raise it.
- **State what the rule is CORROBORATED by and what it merely OBSERVED**, and never blur them.
- **Record where the rule came from, inside the rule.**
- **Emit every value an analyst decides on as a field of its own, and map the entity of concern
without splitting the group**: a computed column declared in `alert_fields`, the item of
concern apart from the full set, each computed at the grain that defines it.
- **A rule carrying an address carries BOTH families wherever its dataset's model can fill the
IPv6 field**: it outputs, groups, keys and maps IPv4 and IPv6, lists and counts addresses
through one column built from both, and never filters on IPv4 presence alone. A combination
of the two ignores empty strings. A model that only pads the IPv6 field gives nothing to map.
- **Alert text must render**: no array in the name, and words for a value that can be null.
## Filter on the MAPPED field, not on a string the model happened to produce
A modelling rule resolves messy vendor input into canonical XDM fields. A correlation that
re-derives the same thing by matching text on a raw-looking field throws that work away and
inherits every gap in the vendor's data.
The case: a rule matched `xdm.event.original_event_type` for the substring "create". The vendor
sends audit records with a BLANK action, so the model falls back to deriving the event name from
the HTTP method and the resource, producing a name with no verb in it. Those records never matched.
Meanwhile `xdm.event.operation` had already been resolved to the create constant from the same HTTP
method, correctly, for exactly this purpose. The rule ignored the model's answer and recomputed a
worse one.
Before matching a string, check whether the model already mapped the concept to a typed field,
and prefer it. A constant comparison is also cheaper and cannot drift when the vendor renames an
action.
The same rule of thumb catches its mirror image: a query that groups SOLELY by a field the model
sets to a LITERAL CONSTANT. Grouping on such a field produces exactly one row however much data
there is, which reads as a working aggregate and names nothing anyone can act on. Adding a
constant field to an EXISTING `by` list is different, and sometimes the right fix, for
the reason given below: it cannot change cardinality, and it makes the field
emitted.
**A filter literal must be a value the model can produce.** Where every branch of the dataset's
modelling rule assigns a constant, the field's values are a closed set, and a literal outside it
is a defect whichever way it points: `= X` never selects a row and `!= X` excludes nothing. A
rule testing `xdm.logon.type = XDM_CONST.LOGON_TYPE_NETWORK` against a model that assigns only
SERVICE, INTERACTIVE and REMOTE_INTERACTIVE never fires. It is not excused as a bridge to older
data: modelling is applied when the `datamodel` query runs. A modelling-rule edit that leaves the
correlation untouched can create one, which is why the check runs at every release and not only
when a rule is written. A field no modelling rule assigns on the dataset read is the same defect
at the field level (`ERR-CORR-FILTER-OUTSIDE-MODEL`; a stage that can therefore never be true is
`ERR-CORR-FILTER-NEVER-MATCHES`). The mirror is not a defect: `= X` where X is the only value the
model assigns selects every row, and is a correct scope.
## Corroborated and observed are different claims
CORROBORATED (other people ship a rule for this shape) says the shape is recognised; OBSERVED (it
happened and was written up) says it is real. Only the second is evidence, a refinement never
inherits its base's corroboration, and "no corroboration" is a compliant answer that the
provenance check reads as a denial, not a claim. The case and the reasoning are in
[references/provenance.md](references/provenance.md).
## Writing the rule
- PREFER `datamodel dataset = ...` over a raw `dataset = ...`: a preference, not a prohibition. Grouping artifacts are fillable only from `xdm.*` fields, and a modelled name is stable where a raw column name belongs to the vendor. The old "never a raw dataset" law is RETIRED: rules reading one install and run on the tenant (the editor's verdict is not recorded).
- Every rule needs a top-level `description` (what the rule detects) distinct from
`alert_description` (what the fired alert means). Write the alert description for the analyst
who will read it at 3am: what happened, why it matters, what to check. State the VALUE and
never point the reader at a field: "where account_signed_in is true" sends them to the fields
for the one fact the sentence is about, so build a text column in its own `alter` stage and
substitute it. And make it RENDER: an array in `alert_name` shows as INVALID_VALUE, an empty
value as NULL, and the fixes are in [references/alert-text.md](references/alert-text.md).
A prompt triaging the issue reads the description's `Decision values:` block; its keys and the
`alert_name` stem are an interface (`references/alert-field-mapping.md`).
- File name MUST begin with the pack folder name.
- `XDM_CONST.*` compared against `xdm.event.outcome` fails the WHOLE PACK INSTALL (below).
Compare the rendered string -- `"FAILED"`, `"SUCCESS"` -- as read off the modelled dataset. The
symbol is correct in a MODELLING rule, which is why authors reach for it. Proven on three rules
across two packs; `xdm.event.operation = XDM_CONST.OPERATION_TYPE_*` installs and runs (not
checked in the correlation editor), so the general form does not hold and the boundary is
untested.
- No colons inside unquoted YAML scalars: a colon ends the value and the file silently fails to
parse. Gate every correlation through a YAML parse check.
- Fresh `global_rule_id` per rule, and verify uniqueness across the whole repository.
- With `alert_category: User Defined`, the field `user_defined_category` names MUST appear in the
query output, as must `user_defined_severity`'s under `severity: User Defined`: put it in
`| fields` or in the `by` clause. A field the query only filters on is not emitted, and an
`xdm.*` path no modelling rule sets is not returned by a wildcard. A category VALUE
naming no member of the closed enum renders Other (`references/suppression.md`).
- `mapping_strategy: CUSTOM` with a populated `alert_fields`, covering every grouping artifact this
dataset's modelling rule can fill. `AUTO` ignores the block and cannot reach the Domain,
Causality, AGENT_ID or IPv6 artifacts. A declared Remote IP carries the FAR PARTY
relative to what the rule protects -- the caller, on a sign-in -- and an IPv6 address takes its
own key. On a rule that is not a mirror, whose host is only an address, the internal host's
address goes in External Grouping: one pair per alert, which a mirror keeps for the vendor's
parent id (`references/alert-field-mapping.md`, "External Grouping is the per-host key").
- Populate `investigation_query_link` with a real drilldown to the underlying records. Never
leave it empty.
- Map MITRE tactic and technique honestly. If nothing fits well, pick the closest and say so.
- Route by the PRODUCT and by evidence fields, never by a detection's title, name or id, or other
text a customer writes: read those into fields only, and test by rewriting them. The owner's one
narrow exception is in `references/archetypes.md`, "Route by product and evidence".
- `is_enabled` is `true` while you author, pre-flight and measure the rule, because a rule that
does not fire cannot be measured and cannot be shown to work. If it goes out DISABLED, write the
note NOW, while the reason is in your head, and see "A rule that ships disabled says so" below.
The key is never ABSENT: without it nothing in the file states the ship state either way.
## The proven procedure
Only now, with a compiled, queryable model, author `CorrelationRules/*.yml`
(audit-focused, MITRE-mapped; POSTURE domain for posture findings). What an `xdm.*` field means,
holds and holds when empty is cortex-platform-xdm-author's: check the query's use of every field
against it, or against the dataset's modelling rule, before the pre-flight. For the STRUCTURE,
take the skeleton from a correlation already installed on the tenant that opens in the
correlation editor without a marker -- see "The file format is spellbook's" below, which is the
rule this line follows rather than an exception to it.
Where acceptance is slow, change one thing per release, and name the oracle behind a "works":
`references/editor-rules.md`, "When acceptance is slow".
**Field output rule (Smart Grouping):** the correlation `| fields` clause must explicitly
output every field from the authentication story and network story sets (cortex-platform-xdm-author
holds both; without it, the caller's list of what the model assigns is the set) that the
dataset's modelling rule actually maps, plus the pack's own context fields, ending with `xdm.*`.
The wider the coverage of those two sets in the alert output, the cleaner Smart Grouping works,
for an issue at Medium severity or above: a Low issue is not grouped into a case (documented, and
OBSERVED), and an Informational one is inferred not to be (`references/alert-field-mapping.md`).
For an aggregating (`comp`) correlation the group decides how an identity gets out. A field
one-to-one with the group key (the identifier, upn, user_type or identity_type of the actor the
rule groups by) goes in the `by` clause, which cannot change the group. A field that varies within
the group -- one source spanning many accounts -- is an aggregate of its own under a plain name,
`values(<path>) as <role>`, declared in `alert_fields`. Never add it to the `by` clause to get it
out: that splits one finding into one alert per value. In a `datamodel` correlation an `xdm.*` name
reaches the output only unchanged, so a derived value takes a plain name and its XDM alignment is
its `alert_fields` declaration.
Which accounts an alert is ABOUT, and how many alerts it raises, is in
[references/archetypes.md](references/archetypes.md).
**On an aggregating rule, list every field explicitly rather than ending with `xdm.*`.** After a
`comp` the row carries only the aggregate outputs, the `by` keys and whatever a later `alter`
assigns, so the wildcard has nothing meaningful to resolve. Aggregating rules that list their fields are OBSERVED
to install and run. (Whether the wildcard is actively REJECTED after a comp
was not established: a rule carrying it failed to install, but the cause turned out to be a
malformed duration elsewhere in the same file. Listing explicitly is the known-good shape either
way.) Two keys fail silently when a field is left out
of that list, `suppression_fields` and `user_defined_category`, so check both against it before
moving on. `alert_fields` is the THIRD and carries the same requirement: every value it
names must be in that list, and every grouping artifact the modelling rule can fill must be in
both. The linter judges each value on its own, a closing `xdm.*` included, with one
limit: an `xdm.*` value under an open `xdm.*` is taken as returned unless the caller's map shows
no modelling rule assigns it. The alert text is the FOURTH: every `$name` in `alert_name` and
`alert_description` must be a column of the FINAL row (`ERR-CORR-TEMPLATE-UNRESOLVED`).
Query rules learned the hard way:
- `XDM_CONST.*` against `xdm.event.outcome` -> 101704, naming no file and no field, and the whole
pack fails to install. Two packs sat un-installable until a bisect found it, every offline check
passing. `ERR-CORR-OUTCOME-CONST` names it now.
- A `| fields` after a `comp` naming a column the comp never produced -- not a `by` key, not an
`as` alias, not assigned by a later `alter` -> 101704, and the whole pack fails to install,
naming no file and no field (reported by the pack-building session, found by a bisect).
`ERR-CORR-PROJECT-UNPRODUCED` names it now.
- **In a `datamodel` correlation treat `xdm.*` fields as read-only.** The editor rejected each
`xdm.*` write it was shown (OBSERVED, an array into a scalar field every time; the general rule
is REASONED). Never alias an aggregate to an `xdm.*` path and never `alter` into one, although
the engine runs both (`ERR-CORR-XDM-WRITE`). An `alter` target never reads a sibling the same
stage introduces (`ERR-CORR-SAME-STAGE-READ`), and a derived value goes to a NEW name, never
back onto what it reads (`WARN-CORR-SAME-STAGE-READ`). What each rests on is in
[references/editor-rules.md](references/editor-rules.md).
- `ENUM.*` -> "unknown field" on the tenant. Use the proven pattern:
`| alter event_verb = lowercase(to_string(xdm.event.original_event_type))` then
`| filter event_verb contains "del" or ...` using the same verb sets the modelling rule maps.
- **Pre-flight every correlation XQL live** via `start_xql_query` before packing, bad syntax is
rejected at start, instantly and for free. Run the query for real to sanity-check results.
**A clean pre-flight proves the engine runs the query, and an install proves the rule installs;
neither is acceptance by the correlation editor, which is stricter.** A rule can pre-flight
clean and install without a 101704 while the editor rejects it, and may run on schedule too
(its run history says). The editor rules that are known are linted, so they are caught before
the tenant is; opening a rule in the editor is a check an operator may run, not a step this
sequence adds.
- Author the YAML via quoted heredoc (`<<'PY'`), unquoted expands `$xdm...`/`{{}}`.
Then: settle the ship state and write its note (below), which is the last CONTENT edit ->
**`validate`**, before the commit, because after it the number is already spent ->
commit the content -> `bump-version --revision --tag -m "..."` (which writes the release
notes, commits and tags) -> a release gate, if the caller runs one, and READ it (nothing it
refuses may be uploaded) -> **PUSH the commit AND the tag** -> `spellbook upload`, this method's
only route to a tenant -> verify in the UI (Correlations page) and confirm the queries return
sensible rows.
## Copy a correlation that already runs, then edit it
The correlation YAML is wider than anyone remembers, so hand-authoring one from the fields you
recall silently omits half the schema, and hand-authoring the QUERY re-derives problems the
installed rules already solved. Copy the SHAPE as well as the skeleton, from a rule that installs,
runs AND opens in the correlation editor without a marker: a construct the editor later marked
had already spread to every rule of one pack, copied because it ran.
**The file format is spellbook's** (GoCortexIO's public packaging tool, run from
`gocortexio/spellbook:latest` after the README's step zero), not this bundle's. Take the skeleton
from a rule already installed on the tenant, place it with
`spellbook summon correlation`, and report any format surprise to the spellbook project rather
than writing the format here, where it would go stale when spellbook changes it.
## NEVER hard-code an exclusion. Surface the field and let the product exclude on it.
Noisy accounts, backup systems, scanners and jump hosts all need excluding eventually. **None of
that belongs in the query.** An exclusion written into a correlation is invisible to the person
tuning the alert, drifts the moment the estate changes, and needs a pack release to amend. The
platform's native exclusion capability is the right place for every one of them.
What the rule owes the operator instead is the FIELD to exclude on:
- The entity must be mapped to an `xdm.*` field, or to a clearly named computed column.
- It must reach the alert as a FIELD: a `by` key where it is one-to-one with the group, and
otherwise each entity of concern expanded into an alert of its own, whose field then holds the
one value an exclusion matches (`references/archetypes.md`, "Shape the alert for the automation
that consumes it"). Whether an exclusion matches inside a list has not been observed. Carried
only in the description it is out of reach, because an exclusion, a playbook and case grouping
all read fields.
- Say in the rule header which fields an operator is expected to exclude on.
```
// WRONG, a tuning decision frozen into a release
| filter xdm.source.user.username not in ("svc-backup", "svc-inventory")
// RIGHT, the field is surfaced and the platform excludes on it
| comp count_distinct(...) as devices by xdm.source.user.username, xdm.source.ipv4, xdm.source.ipv6
```
A threshold is not an exclusion: it is a property of the shape being detected and belongs in the
query. A severity floor is not an exclusion either. The test is whether the value names a specific
ENTITY in the estate, because that is the thing that changes without the pack knowing.
## A rule that ships disabled says so, in two places
Shipping a detection switched off is a legitimate decision and sometimes the right one: it may be
important and noisy before tuning, or it may need a measurement that only the receiving estate can
take. What is never legitimate is doing it silently. **The person deciding whether to install this
pack reads the README, and never opens the YAML.**
So both readers get told, and they are different readers:
- **The rule's own `xql_query`**, for whoever opens the file, as a separate comment block in the
shape of the `// References` block:
```
// SHIPPED DISABLED, DELIBERATELY. <why, in one line>
// TO ENABLE, in this order:
// 1. <the measurement or exclusion to do first>
// 2. <what to expect on the first run, including any burst>
```
- **The pack README**, for whoever is deciding what the pack gives them, against that rule in the
correlation table, saying "ships disabled" and what to measure before enabling it.
The marker is `SHIPPED DISABLED`, word for word, so a search finds it. Write the note in the
`xql_query`, never only in the prose fields: a
correlation's prose fields sit beside its query fields and share their vocabulary, so a
whole-document search is satisfied by an `alert_description` that merely mentions the words. Which
release gate checks the two halves is the caller's to say; write both whatever it checks.
**Shipping `is_enabled: false` in an UPGRADE did not switch off a rule already live**: it went on
raising alerts (OBSERVED once, 2026-09-04; whether a release or an operator had enabled it is not
recorded). So disable a live rule by hand, and say so.
**Whether a release ships ENABLED is not a lint's call**, because no repository state
distinguishes an authoring upload to the dev tenant from a customer release. A human clears it in
the review before release.
**If the ship state changes, that edit is the LAST content edit before the release commit.** After
`bump-version --tag` a release gate that diffs the pack against its own tag refuses content that
moved since, so a flip remembered late costs an amended note and a moved tag rather than a one-line edit.
## How to decide, when the answer is not obvious
**"Is this detection worth shipping?"**
Answer three questions and be willing to abandon it. Would an analyst act on it? Can it be
separated from legitimate activity by the data available? Would it fire more than a handful of
times a day in a normal week? A rule failing any one makes the queue worse: a detection nobody
acts on is a cost with no return.
**"How do I know the logic is precise enough?"**
Measure it before writing the rule. Pull the real values from the dataset, label the set that
must NOT alert, run the candidate logic over both, and count. Precision is the number that
matters: a smaller detection with no false positives is worth far more than a broad one that
floods. State both numbers when you report.
**"Should I add another pattern to catch one more case?"**
Only if it generalises. Ask whether the pattern would work on a different tenant with different
data. Matching only the phrasing in front of you is overfitting: the rule looks excellent here
and fails everywhere else. Record what you deliberately excluded, and why, so the limits are
visible rather than assumed.
**"The rule returns nothing."**
That is not automatically wrong. First establish that the rule RUNS: its run history says so, and
its alerts cannot ([references/run-history.md](references/run-history.md)). Then establish
whether the condition genuinely does not exist in this tenant, and say so explicitly, or whether
the query is broken. Prove it by relaxing one clause at a time until rows appear, which tells you
which clause is responsible.
**"How wide should the window be?"**
On a scheduled rule, the window must exceed the cron period plus the worst-case ingest lag
(`references/thresholds-and-numbers.md`, "Measure the ingest lag"), measured from the timestamp
`_time` carries to its FIRST arrival, never a re-sent copy's, or boundary events are missed
permanently. Then suppression, not the window, controls how often one finding re-alerts. Write the
three numbers down and check they agree before shipping. The owner's rule there: run every 10
minutes on a staggered minute list, with the window the detection's own span plus the measured
ingest lag, in `hours`. A real-time mirror has no window and no cron
([references/archetypes.md](references/archetypes.md)).
Files in this skill
- .gitignore
- LICENSE
- README.md
- SKILL.md
- references/alert-field-mapping.md
- references/alert-text.md
- references/archetypes.md
- references/console-output.md
- references/editor-rules.md
- references/provenance.md
- references/run-history.md
- references/suppression.md
- references/thresholds-and-numbers.md
- tests/test_bundle_standard.py
- tests/test_console_output.py
- tests/test_reference_pages.py
Attribution
Related skills
View all in ai-agents →Comments
Loading comments…
Newsletter
Get the weekly list of safe new skills, and the ones we pulled.