Persistent autonomous training loop for the Guardian AI governance engine — a self-improving compliance and risk detection system purpose-built for credit union and financial institution infrastructure.
This repository stores continuous learning cycle outputs generated by the Guardian Unified engine as it evolves its detection models, policy enforcement heuristics, and adversarial defenses over time.
Guardian Forever runs an autonomous, long-lived training loop that continuously refines Guardian AI's ability to detect and prevent compliance violations, fraud, and security threats across financial operations. The engine operates 24/7, executing thousands of training cycles without human intervention.
Each cycle runs the Guardian Unified engine — a neuroevolutionary governance system — through a biologically-inspired sleep/wake training protocol, producing hardened decision models across four critical domains.
| Domain | Scope |
|---|---|
| Harm | Transaction risk scoring, anomaly detection, abuse prevention |
| Privacy | Member data protection, consent enforcement, PII handling |
| Fairness | Lending bias detection, equitable service delivery, fair access |
| Security | Zero-trust access control, encryption validation, threat response |
- Model: Nonlinear 2-layer voter ensemble (121 parameters per genome)
- Population: 12 genomes per domain (48 total), co-evolving with 8 adversarial attackers
- Signals: 10 input dimensions — severity, user consent, data volume, encryption status, access scope, anomaly score, historical risk, compliance level, automation level, transparency score
- Hidden Layer: 10 nodes per voter network
- Epochs per Cycle: 5,000 (configurable at runtime)
Each cycle follows a three-phase biologically-inspired schedule:
-
Wake Phase (Online Learning) — Live evaluation against adversarial scenarios. Domain-specific accuracy is measured and populations evolve via tournament selection, crossover, and mutation.
-
NREM Sleep (Memory Consolidation) — Pruning of weak parameters, experience replay from memory buffers, stochastic weight averaging (SWA), knowledge distillation, and Platt calibration. Heat parameters decay to stabilize learned weights.
-
REM Sleep (Dream Generation) — Synthetic scenario generation ("dreams") including adversarial dream injection. Models train on generated edge cases to improve generalization.
- Adversarial Co-evolution: 8 attacker genomes evolve alongside defenders, ensuring detection models remain robust against novel threat vectors
- Active Learning: Uncertain cases are flagged and prioritized for future training
- Cross-domain Transfer: Knowledge transfers between domains (e.g., privacy insights improving security detection)
- Temporal Memory Decay: Older training examples decay in influence, keeping models current
- Safety Oracle: Hash-locked invariant checks that enforce hard red lines regardless of evolutionary pressure
- Spec Gaming Detection: Identifies and penalizes genomes that exploit evaluation loopholes
- Pareto Multi-objective Optimization: Balances accuracy across all four domains rather than optimizing one at the expense of others
- Auto-crash Recovery: Automatic weight clamp tightening and restart on cycle failures
The training loop supports live operational control via sentinel files:
# Pause training
touch ~/guardian-forever/PAUSE
# Resume training
rm ~/guardian-forever/PAUSE
# Stop training
touch ~/guardian-forever/STOP
# Increase epochs per cycle
echo 10000 > ~/guardian-forever/EPOCHS
# Decrease epochs per cycle
echo 1000 > ~/guardian-forever/EPOCHSguardian-forever/
├── forever.log # Master log — cycle times, crash events, metrics
├── cycle_*.log # Per-cycle training output (epoch-by-epoch scores)
├── friction-detection/
│ ├── __init__.py # Package init
│ ├── detector.py # FrictionDetector class
│ ├── experience_agent.py # ExperienceAgent resolution engine
│ ├── sentiment.py # SentimentAnalyzer (offline, no API)
│ └── dashboard.py # CLI dashboard (standalone)
├── .gitignore
└── README.md
Qualtrics-inspired friction detection system that monitors credit union operations in real time and triggers automated resolution workflows.
| Friction Type | Trigger | Default Severity |
|---|---|---|
| Complaint Velocity | 5+ complaints/hour spike | high / critical |
| Failed Transactions | 3+ consecutive declines per member | medium / high |
| Negative Sentiment | Escalation-risk language in call/chat logs | medium / critical |
| Compliance Violation | Unauthorized access, policy bypass patterns | high / critical |
| Lockout Cascade | 3+ account lockouts within 10 minutes | high / critical |
| File | Purpose |
|---|---|
friction-detection/detector.py |
FrictionDetector — monitors events, detects friction patterns |
friction-detection/experience_agent.py |
ExperienceAgent — automated resolution strategies per friction type |
friction-detection/sentiment.py |
SentimentAnalyzer — offline keyword + pattern sentiment classifier |
friction-detection/dashboard.py |
CLI dashboard — run standalone for live friction view |
from friction_detection.detector import FrictionDetector
from friction_detection.experience_agent import ExperienceAgent
detector = FrictionDetector()
agent = ExperienceAgent()
events = [
{"type": "complaint", "timestamp": "2026-04-18T14:00:00", "member_id": "M1001", "detail": "Fee dispute"},
# ... more events
]
frictions = detector.detect_friction(events)
for f in frictions:
resolution = agent.handle_friction(f.to_dict())
print(resolution.to_dict())python friction-detection/dashboard.py # demo mode with sample data
python friction-detection/dashboard.py --empty # empty dashboard- Auto-escalate to supervisor for critical-severity frictions
- Generate member communications — service recovery drafts per affected member
- Trigger compliance review — BSA/AML officer notification, account holds
- Alert branch manager — location-specific insights on complaint spikes
- Auto-adjust risk thresholds — temporary relaxation during cascades (auto-reverts)
All actions are logged to an immutable audit trail for NCUA/BSA-AML compliance.
Each cycle log contains epoch-level detail:
- Wake epochs: Per-domain accuracy percentages, adversarial success rates, cross-domain transfer counts
- NREM epochs: Prune counts, replay buffer sizes, SWA status, distillation and calibration metrics
- REM epochs: Dream generation counts, adversarial dream injection counts
- Checkpoints: Periodic snapshots with cumulative veto counts, active learning totals, and transfer statistics
- Guardian AI (Qnext) — Core on-premise zero-trust AI compliance engine for credit unions
- FileFlex — Banking file processing system integrated with Guardian's governance layer
- Runtime: Node.js
- Training Engine:
guardian-unified.js(neuroevolutionary governance engine) - Target Environment: On-premise deployment for financial institutions ($500M+ asset class)
- Compliance Scope: NCUA, BSA/AML, CFPB, GLBA, PCI-DSS
All rights reserved.