Skip to content

Proposal: Add Anomaly Guardrail Plugin #190

@HectorMozo3110

Description

@HectorMozo3110

Summary

This issue proposes adding a new plugin called Anomaly Guardrail to the OnAIR framework.
The plugin introduces configurable anomaly detection, severity classification, and severity-to-action mappings, providing a modular guardrail system for telemetry data streams.

Motivation

  • Enhances OnAIR with real-time anomaly guardrails for telemetry.
  • Supports severity-based responses (LOG_ONLY, REDUCE_LOAD, SAFE_MODE).
  • Complements existing plugins (e.g., Kalman, generic) by focusing specifically on fault detection and classification.
  • Provides a reusable framework for anomaly detection that can be tested with both CSV and Redis telemetry sources.

Features

  • Outlier detection using Z-score or Interquartile Range (IQR).
  • Frozen signal (“stuck” values) detection.
  • Severity classification: minor, moderate, critical.
  • Configurable severity-to-action mapping, e.g., minor:LOG_ONLY, moderate:REDUCE_LOAD, critical:SAFE_MODE.
  • CSV audit logging of anomaly events.
  • Log post-processor (count_anomalies.py) to collapse redundant anomaly runs.
  • Redis-based publisher (redis-experiment-publisher-anomalies.py) to simulate mixed normal + anomalous telemetry for testing.

Usage

  1. Run with the sample config:

    python driver.py onair/config/config_anomaly_guardrail.ini
  2. Publish synthetic telemetry for testing:

    python3 redis-experiment-publisher-anomalies.py --normals 100 --anomalies 50 --repeat 3 --shuffle
  3. Post-process anomaly logs:

    python3 count_anomalies.py --in logs/anomaly_events.csv --out logs/anomaly_events_clean.csv --mode edge --emit-end

Files to be Added

  • plugins/anomaly_guardrail_plugin.py – core anomaly detection and classification logic
  • onair/config/config_anomaly_guardrail.ini – configuration of thresholds, severity mapping, monitored columns
  • redis-experiment-publisher-anomalies.py – telemetry simulator for Redis
  • count_anomalies.py – log summarization and cleanup utility
  • doc/AnomalyGuardrail.md – usage guide

Reference

Detailed usage and context included in this commit:
👉 AnomalyGuardrail@ commit

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions