Overview
PentAGI employs a sophisticated multi-agent architecture where specialized AI agents collaborate to conduct penetration tests. Each agent has distinct capabilities, tool access, and reasoning patterns optimized for specific phases of security testing.The multi-agent system is optional and can be disabled per assistant. When disabled, a single agent handles all operations directly.
Agent Roles
The system features specialized agents that work together in a coordinated workflow:Researcher Agent
Purpose: Information gathering, reconnaissance, and vulnerability analysis Capabilities:- Web intelligence gathering through integrated browser and search APIs
- Target enumeration and service discovery
- Vulnerability database queries
- OSINT (Open Source Intelligence) collection
- Security advisory research
- Search engines (Tavily, Traversaal, Perplexity, DuckDuckGo, Google, Searxng)
- Web scraper with isolated browser
- Memory search for historical reconnaissance data
- Knowledge graph queries for similar targets
Developer Agent
Purpose: Attack planning, payload development, and exploit adaptation Capabilities:- Exploit development and customization
- Attack chain planning
- Tool selection and configuration
- Payload crafting for specific vulnerabilities
- Technique adaptation based on target environment
- Memory search for successful exploit patterns
- Knowledge graph queries for attack relationships
- Access to exploit databases and tool documentation
- Code generation capabilities for custom exploits
Executor Agent
Purpose: Command execution, tool operation, and result validation Capabilities:- Security tool execution (nmap, metasploit, sqlmap, etc.)
- Command-line operations in sandboxed environment
- Output analysis and validation
- Result documentation
- Error handling and retry logic
- 20+ professional pentesting tools in sandboxed containers
- Shell access for custom commands
- Memory storage for execution results
- Knowledge graph updates with findings
Agent Coordination
Agents communicate through a structured delegation system:Delegation Process
1. Task Analysis: The orchestrator analyzes the user request and current context to determine which agent is most appropriate. 2. Context Preparation: Relevant information from memory and knowledge graph is assembled for the specialized agent. 3. Agent Invocation: The selected agent receives:- Specific task description
- Available tools and their schemas
- Historical context from similar operations
- Constraints and safety parameters
Agent Configuration
Each agent can be configured with different LLM models optimized for their specific roles:Model Selection Considerations
Researcher: Benefits from models with strong reasoning capabilities and broad knowledge (e.g., Claude Sonnet, GPT-4.1, Gemini Pro). Developer: Requires models with excellent code generation and strategic thinking (e.g., Claude Sonnet, DeepSeek Coder, GPT-4.1). Executor: Optimized for speed and accuracy; smaller models often sufficient (e.g., GPT-4.1-mini, Claude Haiku, Gemini Flash).Tool Access Control
Agents have different tool permissions based on their roles:Agent Communication Patterns
Sequential Delegation
Most common pattern where agents work in sequence:- Researcher gathers target information
- Developer creates attack plan based on findings
- Executor runs the planned attacks
- Orchestrator synthesizes results
Iterative Refinement
Agents may be called multiple times with updated context:Parallel Investigation
For complex targets, multiple researchers may investigate different aspects simultaneously (planned feature).Memory and Context Management
Agent-Specific Memory
Each agent type can filter memory searches to retrieve relevant past experiences:Context Windows
Agents have different context window requirements:- Researcher: Large context (64K-100K tokens) for comprehensive analysis
- Developer: Medium context (32K-64K tokens) for code and plans
- Executor: Smaller context (8K-32K tokens) for focused operations
Chain Summarization
To manage growing conversation histories, PentAGI implements intelligent summarization:- Preserves recent messages in full detail
- Summarizes older messages while maintaining critical information
- Keeps tool calls and responses intact for debugging
- Configurable thresholds per agent type
Agent Performance Optimization
Tool Call ID Detection
The system automatically detects LLM provider-specific tool call ID patterns:Retry Logic
Agents implement sophisticated retry mechanisms:- Function call failures trigger retries with error context
- Model timeouts result in fallback models
- Invalid responses prompt self-correction
- Configurable max retries per operation
Barrier Functions
Certain tools act as “barrier functions” that require human approval:- Destructive operations (data deletion, service shutdown)
- Potentially illegal actions (without explicit authorization)
- Operations affecting production systems
Enabling/Disabling Agent Delegation
Agent delegation can be controlled at multiple levels:Global Default
Per-Assistant Configuration
Users can toggle agent delegation in the UI when creating or editing assistants, overriding the global default.When to Use Single vs Multi-Agent
Single Agent Mode (Faster):- Simple, straightforward tasks
- Speed is critical
- Minimal context switching needed
- Direct command execution
- Complex penetration testing scenarios
- Research-heavy operations
- Multi-phase attack planning
- Learning from diverse past experiences
Related Concepts
- Architecture - System-level agent coordination
- Memory System - How agents store and retrieve context
- Knowledge Graph - Semantic understanding across agents