Anomaly Explanations Need Counterfactual Checks
Trace alert reasons to their records, replay the scorer after verified repairs, and distinguish the cheapest threshold crossing from the corrected score.
A behavioral alert scores 80 and escalates during a fictional repository migration. The display lists odd hours, a large download, a new device, and a policy event. A wrong timezone mapping put the session in the overnight window. A collector retry inflated the download total, and a stale binding made a known device appear new. The policy log records an access during the session.
A counterfactual check replays the decision with the same scorer, reference snapshot, and cutoff, changing only inputs for which the records support a correction. A reproducible reason ranking can still direct an analyst to investigate artifacts of collection. Once the score has an evidentiary basis, test whether variation in the ranking changes which record the analyst requests first.
The records behind the four reasons
The session contains a UTC timestamp and a key into a shared host timezone mapping. A wrong mapping changes the derived local time and can move the activity across a calendar boundary. The device token was captured correctly, but the stale binding for this session linked it to the wrong device. The enrollment record in effect at the session timestamp identifies the correct device, which already appears in the frozen comparison history. The two transfer rows share a transfer ID within the session. The collector’s retry metadata identifies the duplicate and preserves the original row as evidence of the transfer.
The policy log comes from a separate collection path. Its session ID and access timestamp tie the event to the migration session. The timestamp must fall within that session’s start and end times. That join associates an access with a session without turning the policy event into another transfer or treating it as proof that the access was approved.
Figure 1 — The host key connects the shared timezone table to the migration session. The access record joins by session ID, with the access timestamp checked against the session interval. Link width counts paths. The two volume paths trace two records for a single transfer. Illustrative record lineage — not measured data.
The dependency view lets the reviewer ask for the right evidence before interpreting a contribution. A large novelty contribution warrants the session binding and the enrollment record effective at the time. Pulling the latest enrollment first could retroactively assign a device that joined after the session. Keep the original and corrected bindings side by side so the reviewer can identify exactly which relationship changed.
The interaction behind the score drop
Peer Groups Can Manufacture Anomalies varies the reference definition. Here the reference stays fixed while the replay repairs input provenance. Reproduce the recorded score with the decision-time scorer, feature code, reference snapshot, and cutoff. Build every variant from the same retained records. Recompute dependent features from those records so a timezone repair can change the local day as well as the hour. A direct edit to the hour could leave the overnight indicator inconsistent with the repaired timestamp.
The fictional detector uses an uncalibrated 0–100 score and escalates at 60 or higher. Deduplication alone yields 62, the session binding repair alone yields 69, and the timezone repair alone yields 57. Deduplication plus the binding repair yields 55. Combining the timezone repair with deduplication yields 47, and combining it with the binding repair yields 52. The fully repaired score is 46.
The fictional scorer starts at 46 for the corrected session, including the genuine transfer and recorded policy event. Inflated volume adds six points, apparent novelty adds one, and the incorrect local time adds nine. The scorer adds four more when inflated volume and apparent novelty occur together, eight when inflated volume coincides with odd hours, and six when apparent novelty coincides with odd hours. Each pair contributes once, and either repair removes its shared points. Deduplication and the binding repair individually remove 18 and 11 points. Adding those drops predicts 51 because it removes the four-point interaction twice. Together they remove 25 points. Fixing the timezone first removes 23 points. Fixing it after the other edits removes nine because those edits already removed its 14 interaction points. Use these drops to compare repair sets on the recorded inputs. An explainer can allocate shared points across reasons using a different rule, so the displayed ranks need their own check.
Figure 2 — Below the cutoff line at 60, the score of 55 comes from deduplication plus the binding correction. The timezone correction alone reaches 57, and the full replay reaches 46. Illustrative score model — not measured data.
Review effort changes which records come first
Set the verification costs before replaying candidates. In this model, matching the transfer against retry metadata costs one review unit. Checking the session binding against device enrollment costs one. Validating the timezone correction costs three because the reviewer must establish which host and effective interval the mapping applies to. The timezone repair is the only single edit that clears the cutoff. The other two edits together clear it for two units, the least expensive verified set.
A team with two units available for a comparable alert would check the retry metadata and the enrollment record first. Candidate replays can motivate that order, but a candidate warrants use in a review decision only after its evidence checks pass. A confirmed crossing establishes that the original escalation depends on repairable inputs under this cutoff. The team still needs the shared mapping check to establish the fully corrected score and assess other sessions.
With many candidates and nonnegative additive costs, a priority queue can start with the empty set and pop sets by total cost. Append only edits later than the last edit in a fixed ordering so each subset has one parent. When a set comes off the queue, test its validity before scoring it. A set is invalid if its edits conflict, exceed their evidence-backed scope, or leave a dependency unresolved. A binding patch that points to an enrollment whose effective interval excludes the session timestamp is invalid. If an independently verified enrollment-record repair would supply the missing effective interval, the partial set can still have a valid extension. The migration already has a valid enrollment record, so its one-unit binding correction requires no edit to enrollment.
Check the cutoff on pop, after a valid set has been scored. Expand valid sets at or above the cutoff and invalid sets that still have a possible valid extension. Prune only when no permitted extension can restore validity. The first valid set below the cutoff has minimum cost under these assumptions. If computation stops early, the smallest pending cost is a lower bound on any crossing the search has yet to find.
A reason swap matters when the evidence request changes
Test the reason display at a fixed detector score. For a sampling-based explainer, lock its background, sampling budget, output scale, and tie rule. Compare each run’s first evidence request with the request produced by a designated higher-budget run on the same alert and background. Specify the task for each reason before comparing runs. If triage starts by pulling a session capture that contains the UTC timestamp and transfer rows, swapping timing and volume leaves that first request intact. The follow-up still differs because timing requires the shared mapping and volume requires retry metadata. A policy-first ranking calls for the separately collected access log and its session join.
Over fresh seeds, record the gap between the two highest displayed contributions before rounding, using the display’s ranking scale. Within predefined gap bands, divide the number of runs whose first task differs from the comparison task by the number of runs in that band. Report those denominators. A high flip rate near ties supports presenting both evidence requests together when the reasons send analysts to different records. Disagreements at wider gaps warrant examining the underlying contributions and whether the comparison run itself is stable. This diagnostic measures sensitivity to sampling for the tested alert. Repeat it with other approved backgrounds to test reference sensitivity. Store the explainer settings and the actual displayed order with the decision-time evidence so a later reviewer can distinguish sampling variation from ties introduced by display rounding.
A repaired escalation leaves the access decision open
Two facts route the session to operational review. The fully repaired score of 46 falls below 60, and the job ledger ties the session ID to the run named in the approved change ticket. The reviewer checks the service account and destination against the ticket and confirms that the session falls within the approved UTC window. Those checks establish the migration linkage. The policy reviewer still needs the access log and ticket scope to decide whether the recorded access was authorized.
The two-unit crossing gives triage an early result while the shared mapping remains under review. The complete replay and verified run linkage support routing the alert to migration review. The policy reviewer retains the joined access record and decides whether the ticket covered that access.