Spaces:
Runtime error
Runtime error
Update AICoreAGIX_with_TB.py
Browse files- AICoreAGIX_with_TB.py +12 -1
AICoreAGIX_with_TB.py
CHANGED
@@ -81,7 +81,18 @@ def engage_lockdown_mode(self, reason="Unspecified anomaly"):
|
|
81 |
|
82 |
self.quarantine_engine = QuarantineEngine()
|
83 |
self.anomaly_scorer = AnomalyScorer()
|
84 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
85 |
"""Loads the configuration file."""
|
86 |
try:
|
87 |
with open(config_path, 'r') as file:
|
|
|
81 |
|
82 |
self.quarantine_engine = QuarantineEngine()
|
83 |
self.anomaly_scorer = AnomalyScorer()
|
84 |
+
|
85 |
+
|
86 |
+
|
87 |
+
def analyze_event_for_anomalies(self, event_type: str, data: dict):
|
88 |
+
score = self.anomaly_scorer.score_event(event_type, data)
|
89 |
+
if score["score"] >= 70:
|
90 |
+
# Defensive, not destructive
|
91 |
+
self.quarantine_engine.quarantine(data.get("module", "unknown"), reason=score["notes"])
|
92 |
+
logger.warning(f"[Codriao]: Suspicious activity quarantined. Module: {data.get('module')}")
|
93 |
+
return score
|
94 |
+
|
95 |
+
def _load_config(self, config_path: str) -> dict:
|
96 |
"""Loads the configuration file."""
|
97 |
try:
|
98 |
with open(config_path, 'r') as file:
|