What exists today
theAuth does not ship an anomaly detector. There is noscan() function and no anomaly finding type. Three small pieces exist, and everything else on this page is something you build on top of the audit log.
Not implemented
These were described on earlier versions of this page and are not in the TypeScript package: ascan() API, the finding types privilege_escalation, high_denial_rate, rapid_fire, unusual_resource_access, and off_hours_activity, the AnomalyConfig options (since, until, minDenialRate, rapidFireThreshold, agentId), and finding objects with severity, evidence, and detectedAt. If you want these signals, compute them from the audit log as shown below.
Code examples
Find denied calls for an agent
Compute a denial rate per agent
React to denials with the onViolation hook
authorize() result. Keep counters in a durable store if you need them to survive restarts.
Pause an agent after repeated denials
Read the trust score factors
lastViolation is the timestamp of the most recent denied call of any kind. Computing a score also stores it.
Next steps
Trust scoring
Turn denial history into a graduated trust level.
Approval flows
Route flagged agents through human review before they act.
Audit trail
Query the raw log data these signals are built on.