SYSTEM DIRECTIVE: You are assisting in the development of a highly advanced, asynchronous, event-driven LangGraph pentesting framework. This system mimics a human red team. Read the "Architectural Rules" section carefully before suggesting any code changes. Do not introduce specialized prompt-sprawl agents. Do not suggest LLM-based validation.
This project is an automated vulnerability discovery and exploitation framework built on LangGraph. Unlike standard CTF bots, it separates creative payload generation from deterministic validation.
- No Prompt Sprawl: Instead of 30 specialized agents (e.g., SQLi Agent, XSS Agent), we use a single Generic Exploit Worker that assumes different roles by pulling strict JSON attack strategies from a Vector Database (Structured RAG).
- Self-Improving: When a Swarm agent successfully bypasses a WAF or writes a custom zero-day payload, the system saves the successful payload back to the Vector DB for future use.
(Developers: Place the Eraser.io/Mermaid graph here)
The architecture operates as an infinite, asynchronous loop managed by a central Hub.
- The Hub (Coordinator): Evaluates the
Shared State. If the target queue is empty, it routes to Recon. If targets exist, it routes to Execution. If all endpoints are exhausted, it routes to Reporting. - Recon Pipeline: The Recon Agent spiders the application and intercepts traffic. It passes raw data to the Data Analyzer, which strips out garbage (CSS/Images) and pushes clean API endpoints into the
target_queue. - Execution Pipeline: The Exploit Worker pops a target from the queue, fetches an attack strategy from the Vector DB, and uses a CLI subprocess tool to fire the payload.
- Validation: The Worker hands the raw HTTP response to the Validator Node. If successful, it writes to
confirmed_vulnerabilitiesand updatesauth_headersfor pivoting. - OSINT Exception: If the Worker encounters unknown technology, it triggers the Researcher Agent, which is the only agent allowed to search the live internet for CVEs and write new JSON strategies to the DB.