Cyber Sentinel
Building an AI assistant that connects cybersecurity knowledge with the environment a user needs to protect.
Delivered: a working application combining local LLM inference, retrieval-augmented generation and a planner that selects tools for multi-step analysis.
My role: co-designed, co-built and evaluated the application in a two-person team, contributing across architecture, frontend, backend, data pipelines and agent orchestration.
Technology stack
- Application
- Python · FastAPI · Next.js · LangServe
- LLM & retrieval
- Llama 3 · Ollama · LangChain · FAISS
- Data & ingestion
- SQLite · Selenium · Jina Reader
Useful security advice needs more than model knowledge.
A cybersecurity assistant needs to understand current threats, retrieve specialised information and consider the software present in the user’s environment. It also needs to handle internal documents and configuration information that users may not want to send to a hosted LLM.
We built Cyber Sentinel to connect these requirements. A local language model worked with an updateable cybersecurity knowledge base and manually supplied environment details. Rather than answer every question through one retrieval call, it generated a plan and selected tools to gather and analyse the relevant context.
Let the model plan; let the application execute.
We prompted the LLM to produce a structured JSON action plan. Each step specified its input, action and selected tool. Our application iterated through the plan, invoked the tools and passed their results into subsequent processing, ending with a recommendation step.
The tool set covered general knowledge retrieval, CVE-specific retrieval, MITRE ATT&CK lookup, comparison with local configuration, and synthesis of recommendations. This allowed the workflow to combine external security evidence with information about the user’s environment.
Separate planning from execution
The model chose the sequence of steps; application code dispatched and executed them. We used a sequential plan-and-execute workflow, with explicit inputs and outputs between steps, rather than a fixed retrieval-and-answer pipeline.
The final response combined the intermediate results. Retrieved sources were available in the interface so users could inspect the supporting documents.
Keep analysis local and knowledge updateable.
Run inference locally
We ran Llama 3 through Ollama and integrated it through LangChain. This allowed internal documents and configuration details to form part of the inference context without sending that context to a hosted language-model service. The choice required us to operate the local runtime and work within the model’s capabilities.
Retrieve from specialised knowledge stores
We organised FAISS retrieval into six categories: news, CVEs, blogs, guidelines, incident reports and MITRE ATT&CK material. Dedicated stores let the workflow target particular kinds of evidence. SQLite held document metadata, while original files and source links remained available for inspection.
Refresh evidence without retraining
A daily scraping process collected public material from sources including HKCERT, Tenable and security publications. Selenium discovered content and Jina Reader converted public webpages into text for ingestion. Public knowledge collection used external services; inference used the local model.
This separated knowledge updates from model training, while making source coverage and ingestion maintenance part of the application’s responsibilities.
Connect a vulnerability to the user’s configuration.
Question: “What is the malicious code incident in XZ Utils in Linux System?”
Test context: the manually supplied local configuration included XZ Utils version 5.6.0.
This scenario tested whether the application could move from explaining an incident to identifying its relevance to the supplied environment.
- Retrieve the incident evidence. Cyber Sentinel identified the XZ Utils backdoor incident and its associated identifier, CVE-2024-3094, from the knowledge base.
- Compare the affected software with local context. The response flagged the configured XZ Utils version 5.6.0 as affected.
- Return a contextual recommendation. It recommended addressing the affected software and exposed retrieved source links for further inspection.
The observed result demonstrated the connection between retrieval and configuration-aware advice. The configuration was entered by the user; the application did not discover installed software or apply remediation itself.
A working application, from ingestion to interaction.
We delivered a Next.js interface and FastAPI backend with local inference, document ingestion and management, scheduled knowledge collection, tool orchestration, streamed responses and follow-up conversations. Users could update their configuration and inspect the documents retrieved for an answer.
We evaluated Cyber Sentinel alongside a basic RAG implementation using Llama 3, plus Claude 3.5 Sonnet, GPT-4o and Perplexity. Our qualitative comparison used two scenarios—the XZ Utils incident and the Cyberport ransomware incident—and considered answer comprehensiveness, reliability, freshness and relevance to the local environment.
In the XZ Utils scenario, the application connected retrieved vulnerability information to the supplied software version. In the Cyberport scenario, it retrieved information from an uploaded investigation report and used it to explain the incident and suggest preventive measures.
The evaluation covered two selected scenarios. Automatic environment discovery and additional operational security tools remained future work.
What I took forward
Building Cyber Sentinel in 2024 gave me practical experience connecting model behaviour to application architecture: structured planning, tool execution, retrieval, data updates and a usable interface. The key design lesson was to connect the model to the evidence and environment needed for the task, then give users access to the supporting sources.
My later EcoHope work applies AI to engineering delivery, combining shared architectural context, cross-repository coordination, GitHub task tracking and human review.
Explore the AI engineering workspace →