PentAGI Autonomous Penetration Testing Platform

repository·main·Indexed 9 days ago

https://github.com/vxcontrol/pentagi

An autonomous penetration testing platform using AI agents to conduct security assessments. It features a sandboxed environment, a Go library for API interaction, a React-based chat frontend with GraphQL, and a flexible searcher interface supporting engines like Google, DuckDuckGo, and Tavily.

Tokens
263.1K
Snippets
557
Records
890
Agent score
97%

What's inside PentAGI

  1. Overview of the Charm.sh Ecosystem

    main

    The Charm stack is a collection of Go libraries used to build sophisticated Terminal User Interfaces (TUIs). The core packages include:

    • bubbletea: An event-driven TUI framework based on the Model-View-Update (MVU) pattern.
    • lipgloss: A styling and layout engine for terminal interfaces (similar to CSS).
    • bubbles: A collection of pre-built interactive components like viewports, text inputs, lists, and tables.
    • huh: An advanced form builder for complex user input flows.
    • glamour: A markdown renderer for terminal output.
  2. Overview of Charm.sh Core Libraries

    main

    The Charm ecosystem provides a suite of Go libraries for building sophisticated Terminal User Interfaces (TUIs). The core packages are:

    • bubbletea: An event-driven TUI framework based on the Model-View-Update (MVU) pattern.
    • lipgloss: A styling and layout engine for terminal interfaces.
    • bubbles: A collection of pre-built interactive components like viewports, text inputs, lists, and tables.
    • huh: An advanced form builder for complex user input.
    • glamour: A markdown renderer for the terminal.
  3. Overview of PentAGI

    main

    PentAGI (Penetration testing Artificial General Intelligence) is an automated security testing platform designed for information security professionals and researchers. It uses AI-powered agents to autonomously determine and execute penetration testing steps within a secure, sandboxed Docker environment.

    Key Capabilities:

    • Autonomous Agents: AI agents that plan and execute tasks, with optional execution monitoring.
    • Tool Integration: Includes 20+ professional security tools (e.g., nmap, metasploit, sqlmap).
    • Sandboxed Execution: All operations occur in isolated Docker containers.
    • Memory & Context: Uses a smart memory system for long-term research storage and optional Knowledge Graph integration (via Graphiti and Neo4j) for semantic relationship tracking.
    • Information Gathering: Built-in web browser (via scraper) and integration with multiple search APIs (e.g., Tavily, Firecrawl, Perplexity, DuckDuckGo).
    • Scalable & Self-Hosted: Microservices-based architecture with PostgreSQL (pgvector) for persistent storage and support for horizontal scaling.
  4. Overview of PentAGI Frontend features

    main

    PentAGI Frontend is a React-based chat application designed for intelligent conversations with AI agents. Key capabilities include:

    • Chat & Agents: Real-time chat interface with multi-agent support, status monitoring, and communication logs.
    • Task Management: A tracking system for tasks and subtasks with real-time progress monitoring.
    • Observability: A real-time terminal for monitoring command output with syntax highlighting.
    • Knowledge Management: Integrated vector store for knowledge base management and search.
    • UI/UX: Responsive design (mobile/tablet/desktop), dark/light theme support, and real-time updates via GraphQL subscriptions.
  5. Overview of the Controller package

    main

    The controller package is the central orchestration layer of the PentAGI backend. It manages the lifecycle and business logic for all core entities, including flows, assistants, tasks, subtasks, and logs. It acts as a high-level service layer that mediates between the database, providers (LLMs), tools, and the event subscription system.

    It supports two primary operational modes:

    1. Autonomous Pentesting Mode: Automated flows involving task generation and execution.
    2. Interactive Assistant Mode: Conversational AI assistants that can utilize agents and tools.
  6. Overview of the PentAGI Observability Stack

    main

    The PentAGI Observability Stack provides a unified monitoring, logging, tracing, and metrics collection system. It is built on OpenTelemetry and integrates several specialized tools:

    • Logging: Structured logging via logrus with context propagation.
    • Tracing: Distributed tracing using OpenTelemetry and Jaeger.
    • Metrics: Application and system-level metrics collection.
    • Langfuse: Specialized observability for LLM operations.
    • Profiling: Runtime profiling capabilities.

    The stack uses a layered interface approach to abstract underlying technologies, allowing the application to interact with a single Observability interface.

  7. Overview of the Docker Client Package

    main

    The Docker client package (backend/pkg/docker) provides a secure, isolated, and sandboxed containerized environment for PentAGI's AI agents. It acts as a specialized wrapper around the official Docker SDK to support AI agent workflows, specifically for executing penetration testing operations, managing terminal access, and running security tools in isolation.

    Key Capabilities:

    • Secure Isolation: Sandboxed execution for all agent operations.
    • Container Lifecycle: Automated creation, execution, and cleanup of containers.
    • Port Management: Automatic and deterministic port allocation.
    • File Operations: Safe host-to-container file transfers and directory listings.
    • Resource Control: Configurable CPU, memory, and network isolation.
  8. License and VXControl Cloud Services access

    main

    PentAGI is licensed under the MIT License.

    Note on Cloud Services: While the VXControl Cloud SDK code is MIT licensed, accessing VXControl Cloud Services (including threat intelligence, AI support, and premium features) requires a separate License Key and compliance with the VXControl Terms of Service. The SDK code is free to use, but service access requires registration.

  9. Font usage in PentAGI

    main

    PentAGI uses a specific set of fonts for its web UI and PDF report generation. These fonts are served from the same origin as the application to ensure privacy and reliability, meaning they are never loaded from external servers.

    Web UI Fonts

    • Inter: The primary UI font for the web application.
    • Roboto Mono: Used for displaying code within the web interface.

    PDF Report Fonts

    • Noto Sans: The main body font for PDF reports. It provides broad script coverage including Latin, Cyrillic, Greek, Devanagari, and Vietnamese.
    • Noto Sans Mono: Used for code blocks within PDF reports (covers Latin and Cyrillic).
    • Noto Sans SC (Simplified Chinese): A CJK font used for Chinese, Japanese, and Korean characters in PDF reports. This font is loaded on demand when CJK text is detected in the report content.
  10. What is ChainAST and how is it structured?

    main

    ChainAST is an abstract syntax tree (AST) used to represent and manage Large Language Model (LLM) conversation chains. It organizes messages into a hierarchy to facilitate validation, modification, and size tracking, particularly for complex flows involving tool calls and responses.

    Hierarchy Structure

    • ChainAST: The root container holding an array of ChainSections.
    • ChainSection: A logical unit of conversation consisting of a Header and multiple BodyPairs.
    • Header: Initiates a section; contains an optional SystemMessage and/or HumanMessage.
    • BodyPair: Represents the core interaction loop. Types include:
      • RequestResponse: An AIMessage containing tool calls followed by one or more ToolMessages.
      • Completion: A simple AIMessage without tool calls.
      • Summarization: A special type containing a tool call to the summarization tool (execute_task_and_return_summary).
    ChainAST
    ├── Sections[] (ChainSection)
        ├── Header
        │   ├── SystemMessage (optional)
        │   ├── HumanMessage (optional)
        │   └── sizeBytes
        ├── sizeBytes
        └── Body[] (BodyPair)
            ├── Type (RequestResponse, Completion, or Summarization)
            ├── AIMessage
            ├── ToolMessages[]
            └── sizeBytes
  11. Understand subtask inclusion in metrics

    main

    When interpreting analytics, note which subtask statuses are included in the calculations:

    • Included (Counted): running (duration is created_at to now), finished, and failed.
    • Excluded (Not Counted): created (not yet started) and waiting (paused for user input).

    This means if a generator creates 10 subtasks but only 1 has started, your metrics will reflect 1 subtask, not 10.