OSS reference implementation of the anomaly detector documented in the Glide OSS plan §M4. Deterministic, explainable signals; no classifier, no ML; every heuristic is a pure function over a facts snapshot the operator passes in.Documentation Index
Fetch the complete documentation index at: https://glide-9da73dea.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Install
Why no ML?
Per the OSS plan §“Critical architectural commitments”:Anomaly signals are heuristics, not a classifier.Signals are inputs to UI decision aids — the policy engine has the only hard veto. Heuristics are explainable, version-controllable, testable in isolation, and don’t drift between training runs. ML is the wrong tool for the “why did this fire” review surface.
Built-in heuristics
| Heuristic | Default severity | What it catches |
|---|---|---|
newRecipientHeuristic | notice | First payment to a counterparty |
makeAmountDeviationHeuristic | warn at 3×, critical at 10× | Amounts well above baseline median |
makeVelocityHeuristic | warn at 2×, critical at 5× | Burst of tool calls |
allowlistBypassHeuristic | critical | Attempt to pay outside the allowlist |
timeWindowHeuristic | warn | Transactions outside business hours |
Storm suppression
A burst of similar signals (e.g., 50 “new-recipient” events in 60 seconds during a payroll batch) should NOT fan out as 50 push notifications. The suppressor returns at mostmaxPerWindow signals
per (kind, agentId) per windowMs; overflow signals are still
recorded — caller’s choice what to do with them (typically routed to
an in-app aggregated feed).
Sentry sink
Optional adapter that routes signals to Sentry as messages tagged with severity + kind. The Sentry instance is operator-supplied so the package doesn’t take a hard dependency on@sentry/nextjs (any object
with captureMessage() works — @sentry/node, Glitchtip, custom shims).
| Anomaly severity | Sentry level |
|---|---|
info, notice | info |
warn | warning |
critical | error |
Adding your own heuristic
Heuristics are just(ctx) => signals[]. Wire one for your domain:
Reading list
- Money-safety contracts — the F-rules every money-touching path observes.
- Receipt schema — what gets logged alongside each anomaly signal.
- Source on GitHub