Canary LP · Technical Library

The Detection Catalog

37 loss-prevention rules across 10 categories and three execution tiers — generated from source.

37 detection rules across 10 categories and three execution tiers. Each rule is source-defined in canary/services/chirp/rule_definitions.py and loaded into the detection_rules table at seed time. Merchants adjust thresholds via merchant_rule_config.

Execution Tiers

Cash Drawer 4 rules

Cash handling — no-sale abuse, shift variance, paid-out anomalies, after-hours drawer.

RuleNameSeverityTierDefault ThresholdDescription
C-104AFTER_HOURS_DRAWERcriticalTier 1 — Statelessopen_hour=6, close_hour=22Cash drawer opened outside business hours
C-101NO_SALE_ABUSEhighTier 1 — Statelesscount=5, window=shiftN+ no-sale drawer opens per shift
C-102CASH_VARIANCEhighTier 1 — Statelessamount_cents=2000Shift cash variance exceeds N cents
C-103PAID_OUT_ANOMALYmediumTier 1 — Statelessamount_cents=5000Paid-out exceeds N cents without manager override

Composite 1 rules

Multi-signal rules that correlate across primary rule hits.

RuleNameSeverityTierDefault ThresholdDescription
C-901SRA_THRESHOLD_BREACHhighTier 1 — Statelesssra_pct_sales_max=3.0Shrink Risk Assessment exceeds threshold percentage of net sales

Dispute 3 rules

Dispute & chargeback patterns.

RuleNameSeverityTierDefault ThresholdDescription
C-D02DISPUTE_LOSTcriticalTier 1 — StatelessDispute resolved as LOST — confirmed chargeback loss
C-D01DISPUTE_CREATEDhighTier 1 — StatelessNew dispute filed — merchant must respond with evidence
C-D03DISPUTE_VELOCITYhighTier 1 — Statelesscount=3, window_days=30N+ disputes in time window per location

Gift Card 2 rules

Gift card abuse — load velocity, immediate drain.

RuleNameSeverityTierDefault ThresholdDescription
C-602GIFT_CARD_DRAINcriticalTier 1 — Statelessseconds_after_load=1800Full gift card redemption immediately after load
C-601GIFT_CARD_LOAD_VELOCITYhighTier 1 — Statelesscount=3, window_seconds=3600N+ gift card loads in time window (laundering signal)

Invoice 3 rules

Invoice lifecycle anomalies.

RuleNameSeverityTierDefault ThresholdDescription
C-I02INVOICE_CHARGE_FAILEDhighTier 1 — StatelessScheduled invoice charge failed — payment collection risk
C-I03HIGH_VALUE_INVOICE_UNPAIDhighTier 1 — Statelessamount_cents=50000Unpaid invoice exceeds N cents — high-value receivable at risk
C-I01INVOICE_OVERDUEmediumTier 1 — StatelessInvoice past due date with status still UNPAID

Loyalty 4 rules

Loyalty program integrity — rapid accumulation, bulk redemption, cross-location velocity, enrollment fraud.

RuleNameSeverityTierDefault ThresholdDescription
C-802BULK_REDEMPTIONhighTier 1 — Statelesspoints=5000Points redeemed exceed N in single event
C-803CROSS_LOCATION_VELOCITYhighTier 1 — Statelesslocation_count=3, window_seconds=7200Loyalty events at N+ locations in time window
C-801RAPID_POINT_ACCUMULATIONmediumTier 1 — Statelesscount=5, window_seconds=3600N+ loyalty point events in time window
C-804ENROLLMENT_FRAUDmediumTier 1 — Statelesscount=10, window_seconds=86400N+ loyalty enrollments from same employee in time window

Order 4 rules

Order & line-item patterns — excessive discount rates, void rates, sweethearting.

RuleNameSeverityTierDefault ThresholdDescription
C-204UNTENDERED_ORDERcriticalTier 1 — Statelessstale_hours=24Order created with no corresponding payment after threshold hours (sweethearting/open-ticket drift)
C-201EXCESSIVE_DISCOUNT_RATEhighTier 1 — Statelesspercent=50Average order discount exceeds N% (sweethearting signal)
C-202LINE_ITEM_VOID_RATEhighTier 1 — Statelesspercent=10, min_items=10Employee line item void rate exceeds N%
C-203SWEETHEARTINGhighTier 1 — Statelessamount_cents=2000Discount applied without manager approval on high-value item

Payment 11 rules

Transaction-level anomalies — refunds, voids, card velocity, after-hours, manual entry.

RuleNameSeverityTierDefault ThresholdDescription
C-009SQUARE_DELAY_HOLDcriticalTier 1 — StatelessSquare has flagged this payment with a delay action — money is being held
C-001RAPID_REFUNDhighTier 1 — Statelessseconds=900Refund issued within N seconds of original sale
C-002EXCESSIVE_REFUND_RATEhighTier 1 — Statelesspercent=15, min_transactions=5Employee refund rate exceeds N% of total transactions in shift
C-005CARD_VELOCITYhighTier 1 — Statelesscount=5, window_seconds=3600Same card fingerprint used N+ times in time window
C-007HIGH_VALUE_REFUNDhighTier 1 — Statelessamount_cents=10000Single refund exceeds N cents
C-010PARTIAL_AUTHORIZATIONhighTier 1 — Statelessvariance_cents=0Bank approved less than requested — partial authorization signal
C-011NO_SALE_DETECTEDhighTier 1 — StatelessPayment flagged as NO_SALE — cash drawer opened with no transaction
C-003ROUND_AMOUNT_PATTERNmediumTier 1 — Statelesscount=5, window_seconds=3600N+ round-dollar transactions in time window (structuring signal)
C-004AFTER_HOURS_TRANSACTIONmediumTier 1 — Statelessopen_hour=6, close_hour=22Transaction processed outside configured business hours
C-006SPLIT_TENDER_PATTERNmediumTier 1 — Statelesscount=3, window_seconds=3600N+ split-tender transactions in time window (structuring signal)
C-008MANUAL_ENTRY_SPIKEmediumTier 1 — Statelesscount=5, window=shiftN+ keyed-in card transactions per shift (card-not-present risk)

Timecard 3 rules

Clock-in integrity — off-clock transactions, break transactions, cross-location activity.

RuleNameSeverityTierDefault ThresholdDescription
C-301OFF_CLOCK_TRANSACTIONcriticalTier 1 — StatelessPayment processed by employee with no open timecard (ghost employee)
C-302BREAK_TRANSACTIONhighTier 1 — StatelessPayment processed during employee declared break window
C-303WRONG_LOCATIONhighTier 1 — StatelessEmployee clocked in at Location A but payment at Location B

Void 2 rules

Void patterns — high void rates, post-void alerts.

RuleNameSeverityTierDefault ThresholdDescription
C-502POST_VOID_ALERTcriticalTier 1 — Statelessimmediate_max_seconds=120, watch_max_seconds=900, suspicious_max_seconds=28800, self_refund_score_boost=10, off_clock_score_boost=15Full refund of completed sale — tiered by time gap. WATCH (2-15 min), SUSPICIOUS (15 min - 8 hr). Self-refund by same employee boosts risk.
C-501HIGH_VOID_RATEhighTier 1 — Statelesscount=5, window=shiftN+ voids per shift (concealment technique)

Source of Truth

This catalog is generated from canary/services/chirp/rule_definitions.py. To propose a new rule or change a threshold, edit the dataclass definition; the seed pipeline and this catalog both pick it up on the next build.