Aegis AI
EXECUTIVE SUMMARY
Aegis AI is a zero-trust AI runtime firewall that inspects live model traffic and applies behavioural abuse detection (UEBA) to every request. A FastAPI runtime gateway sits in front of the LLM, backed by a dedicated ML microservice that performs prompt-injection classification, anomaly scoring, and session risk evaluation. Unlike static scanners such as LeakLens, which examine code and secrets before deployment, Aegis AI operates continuously on live inference traffic to detect abuse that only becomes visible at runtime.
PROBLEM STATEMENT
Static analysis and secret scanning catch known problems before an application ships, but they are blind to attacks that only emerge once a model is serving real users. A prompt-injection attempt, a session that slowly escalates privilege, or an account generating anomalous request patterns leaves no trace in the codebase. Teams currently have no enforcement point between their application and the model provider, so abuse is detected only after it has already been answered.
INVESTIGATIVE FINDINGS
- ▸Prompt injection is a runtime behaviour, not a code defect, so pre-deployment scanners cannot observe it
- ▸Per-request classification alone misses slow multi-turn escalation attacks
- ▸Session-level context is required to distinguish an attack from a legitimate long conversation
- ▸Risk must accumulate across a session before a response is blocked, otherwise thresholds become trivial to bypass
- ▸The enforcement point must add negligible latency or it will be routed around
BEHAVIORAL ANALYSIS
Aegis AI treats model traffic as untrusted input regardless of whether the caller authenticated successfully. Risk is treated as an accumulating session property rather than a per-message verdict, which mirrors how real abuse unfolds. The system is designed to be verifiable by its operators — every block is surfaced in the dashboard with the signals that produced it — because a firewall that cannot explain itself is a firewall that will be disabled.
TECHNICAL EXECUTION
The system is structured as a monorepo of three deployable services. The runtime firewall (FastAPI) proxies inference calls, normalises request context, and applies decisions before any payload reaches the model. The ML microservice (FastAPI) hosts the detection models: a prompt-injection classifier, an anomaly detector scoring request features against learned session baselines, and session and risk engines that aggregate signals into a decision. A Next.js 16 dashboard built on shadcn/Radix and Recharts visualises live traffic, flagged sessions, and injection attempts. The firewall and ML service are separated so detection logic can evolve independently of the enforcement path, and the architecture is developed through a six-phase lifecycle covering design, data, baseline modelling, detection, integration, and validation.
SYSTEM ARCHITECTURE
OPERATIONAL FEATURES
- ✓Live inference proxy acting as a mandatory enforcement point for model traffic
- ✓Prompt-injection detection as a dedicated classification model
- ✓Behavioural anomaly detection with session-level baselines
- ✓Session risk engine that accumulates risk across a conversation
- ✓Decision outputs: allow, challenge, and block
- ✓Operator dashboard with live traffic and flagged-session views
- ✓Service separation so detection models iterate independently of the firewall path
- ✓Six-phase development lifecycle with documented validation gates
TECHNOLOGICAL ASSETS
CURRENT STATUS
Active development through the six-phase lifecycle, with the ML microservice phases, anomaly detection, and session risk engines implemented and the dashboard consuming live enforcement events. Current work focuses on detection quality tuning, latency budgeting, and expanding the injection pattern database.
CONCLUSION
Aegis AI demonstrates that protecting an LLM application requires a runtime control plane, not a pre-deployment checklist. By combining prompt-injection classification, behavioural anomaly detection, and session-scoped risk accumulation behind a single low-latency proxy, the system converts model abuse from an invisible problem into an observable and enforceable one.