# salah9003/automated-vulnerability-scanning-with-agentic-ai architecture

> Architecture diagram of the GitHub repository salah9003/automated-vulnerability-scanning-with-agentic-ai, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-02-17). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/salah9003/automated-vulnerability-scanning-with-agentic-ai
- Repository: https://github.com/salah9003/automated-vulnerability-scanning-with-agentic-ai

## Overview

##### Main Components
- Controller/Main Process: The execution starts in main.py, which includes configuration options (target IP, scan description, API key) and orchestrates the workflow.
- AI Agents: The Agents directory contains specialized agent modules (e.g., ammar.py, hassan.py, kofahi.py, rakan.py, salah.py, sajed.py), each fulfilling a distinct role:
- Ammar: Strategy generation.
- Hassan: Reviewing strategies and outputs.
- Kofahi: Error handling.
- Rakan: Monitoring command execution.
- Salah: Command execution.
- Sajed: Report generation.
- Core Modules: agent.py and utils.py likely serve as the common interface and support functions for the agents and the scanning workflow.
- External Dependencies: External system tools from Kali Linux (for vulnerability scanning) and the OpenAI API (for natural language understanding and command synthesis).
- Reporting and Logging: Although not explicitly in the file tree, the README describes log generation in a Logs directory and a markdown report generation (findings_report.md generated by Sajed).

##### Interactions
- Main Process Coordination: main.py acts as the entry point and manages the scan’s flow. It likely invokes the agents (through agent.py or directly) and feeds necessary configuration.
- External Interactions: Connections to the OpenAI API for AI functionalities and the integration of external scanning commands (using Kali tools) should be highlighted.

##### Architectural Patterns & Design Principles
- Multi-Agent Architecture: The design follows a distributed, specialized agent model, where each agent operates independently but contributes to an overall scanning strategy.
- Modular Design: With distinct modules for each agent and utility functions, the system emphasizes separation of concerns, making it easier to maintain and extend.

##### Technology and Frameworks
- Python is the primary language.
- Use of external libraries for API interactions (OpenAI API) and possibly for executing system commands.
- Integration with Kali Linux’s penetration testing tools.

##### Final Recommendations
- Annotations or brief notes on each component about its role, especially concerning how agents work together to adapt and improve the scanning process.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Controller Layer
    subgraph "Controller Layer"
        MP("Main Process (main.py)"):::internal
        AI("Agent Interface (agent.py)"):::internal
        UT("Utility Functions (utils.py)"):::internal
    end

    %% AI Agents Layer
    subgraph "AI Agents"
        A1("Ammar (Strategy Generation)"):::agent
        A2("Hassan (Strategy Review)"):::agent
        A3("Kofahi (Error Handling)"):::agent
        A4("Rakan (Execution Monitor)"):::agent
        A5("Salah (Command Execution)"):::agent
        A6("Sajed (Report Generation)"):::agent
    end

    %% External Dependencies Layer
    subgraph "External Dependencies"
        EX1("Kali Linux Tools"):::external
        EX2("OpenAI API"):::external
        EX3("Logging & Reports"):::external
    end

    %% Connections from Controller Layer
    MP -->|"initiate_agents"| AI
    MP -->|"invoke_utilities"| UT
    MP -->|"api_access"| EX2
    MP -->|"execute_scans"| EX1
    MP -->|"log_results"| EX3

    %% Connections within AI Agents
    AI -->|"start_strategy"| A1
    A1 -->|"pass_strategy"| A2
    A2 -->|"initiate_monitoring"| A4
    A4 -->|"execute_commands"| A5
    A5 -->|"generate_report"| A6
    A6 -->|"iterative_feedback"| A1
    A2 -->|"error_alerts"| A3

    %% Utility Functions supporting agents (common utilities)
    UT -->|"support_Ammar"| A1
    UT -->|"support_Hassan"| A2
    UT -->|"support_Kofahi"| A3
    UT -->|"support_Rakan"| A4
    UT -->|"support_Salah"| A5
    UT -->|"support_Sajed"| A6

    %% External interactions from agents
    A2 -->|"review_with_API"| EX2
    A5 -->|"system_command"| EX1
    A6 -->|"store_report"| EX3

    %% Click Events for Component Mapping
    click MP "https://github.com/salah9003/automated-vulnerability-scanning-with-agentic-ai/blob/main/main.py"
    click AI "https://github.com/salah9003/automated-vulnerability-scanning-with-agentic-ai/blob/main/agent.py"
    click UT "https://github.com/salah9003/automated-vulnerability-scanning-with-agentic-ai/blob/main/utils.py"
    click A1 "https://github.com/salah9003/automated-vulnerability-scanning-with-agentic-ai/blob/main/Agents/ammar.py"
    click A2 "https://github.com/salah9003/automated-vulnerability-scanning-with-agentic-ai/blob/main/Agents/hassan.py"
    click A3 "https://github.com/salah9003/automated-vulnerability-scanning-with-agentic-ai/blob/main/Agents/kofahi.py"
    click A4 "https://github.com/salah9003/automated-vulnerability-scanning-with-agentic-ai/blob/main/Agents/rakan.py"
    click A5 "https://github.com/salah9003/automated-vulnerability-scanning-with-agentic-ai/blob/main/Agents/salah.py"
    click A6 "https://github.com/salah9003/automated-vulnerability-scanning-with-agentic-ai/blob/main/Agents/sajed.py"

    %% Styling
    classDef internal fill:#a8d0e6,stroke:#333,stroke-width:2px;
    classDef agent fill:#f6bd60,stroke:#333,stroke-width:2px;
    classDef external fill:#caffbf,stroke:#333,stroke-width:2px;
```
