AWS Builder Center
Building AegisAI: Deploying an Autonomous ML Cybersecurity Engine on AWS EC2 & Amplify

Building AegisAI: Deploying an Autonomous ML Cybersecurity Engine on AWS EC2 & Amplify

Discover how AegisAI uses AWS EC2, AWS Amplify, and S3 Object Lock to deliver real-time, ML-driven threat detection and autonomous process containment with zero cold starts.

Data Analyst

Overview

Modern cyber threats and zero-day exploits move faster than manual human Security Operations Center (SOC) response times. AegisAI bridges this gap by combining real-time network telemetry streaming, machine learning-driven anomaly detection, SHAP-based Explainable AI (XAI), and autonomous process containment.
In this article, I will share how we built and shipped AegisAI using AWS services to achieve low-latency execution and compliance-grade audit logging.



System Architecture

AegisAI utilizes a three-tier architecture optimized for real-time responsiveness and security compliance:
  1. Frontend (AWS Amplify): A high-performance React 18 dashboard featuring a Three.js 3D WebGL network HUD. Hosted on AWS Amplify for global CDN delivery and seamless continuous deployment directly from GitHub.
  1. Backend Engine (AWS EC2): A Python 3.11 FastAPI server running on an Amazon Linux 2023 EC2 instance. Managed by a persistent  systemd  background service, it runs ONNX Runtime models and XGBoost inference 24/7 without free-tier cold starts.
  1. Immutable Audit Vault (AWS S3 Object Lock): Forensic audit logs, deception honeypot triggers, and multi-agent consensus quorum votes are streamed directly to an AWS S3 bucket configured with Write-Once-Read-Many (WORM) Object Lock in Compliance Mode.



Key Technical Challenges & Solutions

1. Eliminating Latency and Cold Starts

Initial prototypes hosted on free-tier PaaS environments suffered from 30–50 second sleep-cycle cold starts, causing web frontend connection timeouts. Transitioning the FastAPI backend to an AWS EC2 instance running under  systemd  ensured the machine remains awake continuously, cutting request latency down to under 50ms.

2. Managing Machine Learning Dependencies on Amazon Linux

Deploying XGBoost, SHAP, and ONNX Runtime on free-tier EC2 instances requires careful disk space management due to heavy CUDA wheel downloads. By installing CPU-optimized dependencies ( pip install --no-cache-dir ) and extending the EBS root volume, we achieved a clean, lightweight Python 3.11 production runtime.



Conclusion

By leveraging AWS Amplify for frontend delivery, AWS EC2 for persistent ML inference, and AWS S3 Object Lock for tamper-proof compliance logging, AegisAI delivers zero-trust cybersecurity operations at scale.
Check out the project source code on  GitHub !
Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article