aiptx 2.0.7__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (187) hide show
  1. aipt_v2/__init__.py +110 -0
  2. aipt_v2/__main__.py +24 -0
  3. aipt_v2/agents/AIPTxAgent/__init__.py +10 -0
  4. aipt_v2/agents/AIPTxAgent/aiptx_agent.py +211 -0
  5. aipt_v2/agents/__init__.py +46 -0
  6. aipt_v2/agents/base.py +520 -0
  7. aipt_v2/agents/exploit_agent.py +688 -0
  8. aipt_v2/agents/ptt.py +406 -0
  9. aipt_v2/agents/state.py +168 -0
  10. aipt_v2/app.py +957 -0
  11. aipt_v2/browser/__init__.py +31 -0
  12. aipt_v2/browser/automation.py +458 -0
  13. aipt_v2/browser/crawler.py +453 -0
  14. aipt_v2/cli.py +2933 -0
  15. aipt_v2/compliance/__init__.py +71 -0
  16. aipt_v2/compliance/compliance_report.py +449 -0
  17. aipt_v2/compliance/framework_mapper.py +424 -0
  18. aipt_v2/compliance/nist_mapping.py +345 -0
  19. aipt_v2/compliance/owasp_mapping.py +330 -0
  20. aipt_v2/compliance/pci_mapping.py +297 -0
  21. aipt_v2/config.py +341 -0
  22. aipt_v2/core/__init__.py +43 -0
  23. aipt_v2/core/agent.py +630 -0
  24. aipt_v2/core/llm.py +395 -0
  25. aipt_v2/core/memory.py +305 -0
  26. aipt_v2/core/ptt.py +329 -0
  27. aipt_v2/database/__init__.py +14 -0
  28. aipt_v2/database/models.py +232 -0
  29. aipt_v2/database/repository.py +384 -0
  30. aipt_v2/docker/__init__.py +23 -0
  31. aipt_v2/docker/builder.py +260 -0
  32. aipt_v2/docker/manager.py +222 -0
  33. aipt_v2/docker/sandbox.py +371 -0
  34. aipt_v2/evasion/__init__.py +58 -0
  35. aipt_v2/evasion/request_obfuscator.py +272 -0
  36. aipt_v2/evasion/tls_fingerprint.py +285 -0
  37. aipt_v2/evasion/ua_rotator.py +301 -0
  38. aipt_v2/evasion/waf_bypass.py +439 -0
  39. aipt_v2/execution/__init__.py +23 -0
  40. aipt_v2/execution/executor.py +302 -0
  41. aipt_v2/execution/parser.py +544 -0
  42. aipt_v2/execution/terminal.py +337 -0
  43. aipt_v2/health.py +437 -0
  44. aipt_v2/intelligence/__init__.py +194 -0
  45. aipt_v2/intelligence/adaptation.py +474 -0
  46. aipt_v2/intelligence/auth.py +520 -0
  47. aipt_v2/intelligence/chaining.py +775 -0
  48. aipt_v2/intelligence/correlation.py +536 -0
  49. aipt_v2/intelligence/cve_aipt.py +334 -0
  50. aipt_v2/intelligence/cve_info.py +1111 -0
  51. aipt_v2/intelligence/knowledge_graph.py +590 -0
  52. aipt_v2/intelligence/learning.py +626 -0
  53. aipt_v2/intelligence/llm_analyzer.py +502 -0
  54. aipt_v2/intelligence/llm_tool_selector.py +518 -0
  55. aipt_v2/intelligence/payload_generator.py +562 -0
  56. aipt_v2/intelligence/rag.py +239 -0
  57. aipt_v2/intelligence/scope.py +442 -0
  58. aipt_v2/intelligence/searchers/__init__.py +5 -0
  59. aipt_v2/intelligence/searchers/exploitdb_searcher.py +523 -0
  60. aipt_v2/intelligence/searchers/github_searcher.py +467 -0
  61. aipt_v2/intelligence/searchers/google_searcher.py +281 -0
  62. aipt_v2/intelligence/tools.json +443 -0
  63. aipt_v2/intelligence/triage.py +670 -0
  64. aipt_v2/interactive_shell.py +559 -0
  65. aipt_v2/interface/__init__.py +5 -0
  66. aipt_v2/interface/cli.py +230 -0
  67. aipt_v2/interface/main.py +501 -0
  68. aipt_v2/interface/tui.py +1276 -0
  69. aipt_v2/interface/utils.py +583 -0
  70. aipt_v2/llm/__init__.py +39 -0
  71. aipt_v2/llm/config.py +26 -0
  72. aipt_v2/llm/llm.py +514 -0
  73. aipt_v2/llm/memory.py +214 -0
  74. aipt_v2/llm/request_queue.py +89 -0
  75. aipt_v2/llm/utils.py +89 -0
  76. aipt_v2/local_tool_installer.py +1467 -0
  77. aipt_v2/models/__init__.py +15 -0
  78. aipt_v2/models/findings.py +295 -0
  79. aipt_v2/models/phase_result.py +224 -0
  80. aipt_v2/models/scan_config.py +207 -0
  81. aipt_v2/monitoring/grafana/dashboards/aipt-dashboard.json +355 -0
  82. aipt_v2/monitoring/grafana/dashboards/default.yml +17 -0
  83. aipt_v2/monitoring/grafana/datasources/prometheus.yml +17 -0
  84. aipt_v2/monitoring/prometheus.yml +60 -0
  85. aipt_v2/orchestration/__init__.py +52 -0
  86. aipt_v2/orchestration/pipeline.py +398 -0
  87. aipt_v2/orchestration/progress.py +300 -0
  88. aipt_v2/orchestration/scheduler.py +296 -0
  89. aipt_v2/orchestrator.py +2427 -0
  90. aipt_v2/payloads/__init__.py +27 -0
  91. aipt_v2/payloads/cmdi.py +150 -0
  92. aipt_v2/payloads/sqli.py +263 -0
  93. aipt_v2/payloads/ssrf.py +204 -0
  94. aipt_v2/payloads/templates.py +222 -0
  95. aipt_v2/payloads/traversal.py +166 -0
  96. aipt_v2/payloads/xss.py +204 -0
  97. aipt_v2/prompts/__init__.py +60 -0
  98. aipt_v2/proxy/__init__.py +29 -0
  99. aipt_v2/proxy/history.py +352 -0
  100. aipt_v2/proxy/interceptor.py +452 -0
  101. aipt_v2/recon/__init__.py +44 -0
  102. aipt_v2/recon/dns.py +241 -0
  103. aipt_v2/recon/osint.py +367 -0
  104. aipt_v2/recon/subdomain.py +372 -0
  105. aipt_v2/recon/tech_detect.py +311 -0
  106. aipt_v2/reports/__init__.py +17 -0
  107. aipt_v2/reports/generator.py +313 -0
  108. aipt_v2/reports/html_report.py +378 -0
  109. aipt_v2/runtime/__init__.py +53 -0
  110. aipt_v2/runtime/base.py +30 -0
  111. aipt_v2/runtime/docker.py +401 -0
  112. aipt_v2/runtime/local.py +346 -0
  113. aipt_v2/runtime/tool_server.py +205 -0
  114. aipt_v2/runtime/vps.py +830 -0
  115. aipt_v2/scanners/__init__.py +28 -0
  116. aipt_v2/scanners/base.py +273 -0
  117. aipt_v2/scanners/nikto.py +244 -0
  118. aipt_v2/scanners/nmap.py +402 -0
  119. aipt_v2/scanners/nuclei.py +273 -0
  120. aipt_v2/scanners/web.py +454 -0
  121. aipt_v2/scripts/security_audit.py +366 -0
  122. aipt_v2/setup_wizard.py +941 -0
  123. aipt_v2/skills/__init__.py +80 -0
  124. aipt_v2/skills/agents/__init__.py +14 -0
  125. aipt_v2/skills/agents/api_tester.py +706 -0
  126. aipt_v2/skills/agents/base.py +477 -0
  127. aipt_v2/skills/agents/code_review.py +459 -0
  128. aipt_v2/skills/agents/security_agent.py +336 -0
  129. aipt_v2/skills/agents/web_pentest.py +818 -0
  130. aipt_v2/skills/prompts/__init__.py +647 -0
  131. aipt_v2/system_detector.py +539 -0
  132. aipt_v2/telemetry/__init__.py +7 -0
  133. aipt_v2/telemetry/tracer.py +347 -0
  134. aipt_v2/terminal/__init__.py +28 -0
  135. aipt_v2/terminal/executor.py +400 -0
  136. aipt_v2/terminal/sandbox.py +350 -0
  137. aipt_v2/tools/__init__.py +44 -0
  138. aipt_v2/tools/active_directory/__init__.py +78 -0
  139. aipt_v2/tools/active_directory/ad_config.py +238 -0
  140. aipt_v2/tools/active_directory/bloodhound_wrapper.py +447 -0
  141. aipt_v2/tools/active_directory/kerberos_attacks.py +430 -0
  142. aipt_v2/tools/active_directory/ldap_enum.py +533 -0
  143. aipt_v2/tools/active_directory/smb_attacks.py +505 -0
  144. aipt_v2/tools/agents_graph/__init__.py +19 -0
  145. aipt_v2/tools/agents_graph/agents_graph_actions.py +69 -0
  146. aipt_v2/tools/api_security/__init__.py +76 -0
  147. aipt_v2/tools/api_security/api_discovery.py +608 -0
  148. aipt_v2/tools/api_security/graphql_scanner.py +622 -0
  149. aipt_v2/tools/api_security/jwt_analyzer.py +577 -0
  150. aipt_v2/tools/api_security/openapi_fuzzer.py +761 -0
  151. aipt_v2/tools/browser/__init__.py +5 -0
  152. aipt_v2/tools/browser/browser_actions.py +238 -0
  153. aipt_v2/tools/browser/browser_instance.py +535 -0
  154. aipt_v2/tools/browser/tab_manager.py +344 -0
  155. aipt_v2/tools/cloud/__init__.py +70 -0
  156. aipt_v2/tools/cloud/cloud_config.py +273 -0
  157. aipt_v2/tools/cloud/cloud_scanner.py +639 -0
  158. aipt_v2/tools/cloud/prowler_tool.py +571 -0
  159. aipt_v2/tools/cloud/scoutsuite_tool.py +359 -0
  160. aipt_v2/tools/executor.py +307 -0
  161. aipt_v2/tools/parser.py +408 -0
  162. aipt_v2/tools/proxy/__init__.py +5 -0
  163. aipt_v2/tools/proxy/proxy_actions.py +103 -0
  164. aipt_v2/tools/proxy/proxy_manager.py +789 -0
  165. aipt_v2/tools/registry.py +196 -0
  166. aipt_v2/tools/scanners/__init__.py +343 -0
  167. aipt_v2/tools/scanners/acunetix_tool.py +712 -0
  168. aipt_v2/tools/scanners/burp_tool.py +631 -0
  169. aipt_v2/tools/scanners/config.py +156 -0
  170. aipt_v2/tools/scanners/nessus_tool.py +588 -0
  171. aipt_v2/tools/scanners/zap_tool.py +612 -0
  172. aipt_v2/tools/terminal/__init__.py +5 -0
  173. aipt_v2/tools/terminal/terminal_actions.py +37 -0
  174. aipt_v2/tools/terminal/terminal_manager.py +153 -0
  175. aipt_v2/tools/terminal/terminal_session.py +449 -0
  176. aipt_v2/tools/tool_processing.py +108 -0
  177. aipt_v2/utils/__init__.py +17 -0
  178. aipt_v2/utils/logging.py +202 -0
  179. aipt_v2/utils/model_manager.py +187 -0
  180. aipt_v2/utils/searchers/__init__.py +269 -0
  181. aipt_v2/verify_install.py +793 -0
  182. aiptx-2.0.7.dist-info/METADATA +345 -0
  183. aiptx-2.0.7.dist-info/RECORD +187 -0
  184. aiptx-2.0.7.dist-info/WHEEL +5 -0
  185. aiptx-2.0.7.dist-info/entry_points.txt +7 -0
  186. aiptx-2.0.7.dist-info/licenses/LICENSE +21 -0
  187. aiptx-2.0.7.dist-info/top_level.txt +1 -0
aipt_v2/__init__.py ADDED
@@ -0,0 +1,110 @@
1
+ """
2
+ AIPT v2 - AI-Powered Penetration Testing Framework
3
+ ===================================================
4
+
5
+ A unified penetration testing framework built on top of 8 reference tools:
6
+ - AIPTx: LLM (litellm), Runtime (Docker), Tools (Browser, Terminal, Proxy)
7
+ - pentest-agent: CVE Intelligence with EPSS scoring
8
+ - PentestAssistant: RAG-based tool selection with BGE embeddings
9
+ - PentestGPT: PTT (Penetration Testing Tree) task tracking
10
+ - VulnBot: Output parsing patterns
11
+ - HackSynth: Multi-step reasoning
12
+ - Pentagi: Docker isolation
13
+ - ez-ai-agent: Simple execution model
14
+
15
+ Features:
16
+ - Universal LLM support via litellm (100+ models)
17
+ - Docker sandbox execution
18
+ - Browser automation via Playwright
19
+ - Proxy interception via mitmproxy
20
+ - CVE prioritization (CVSS + EPSS + trending + POC)
21
+ - RAG tool selection with semantic search
22
+ - Hierarchical task tracking
23
+ - SQLAlchemy persistence
24
+ - FastAPI REST API
25
+ """
26
+
27
+ __version__ = "2.0.7"
28
+ __author__ = "AIPT Team"
29
+
30
+ # Available submodules (direct import)
31
+ __all__ = [
32
+ # Core - LangGraph agent, LLM providers, memory
33
+ "core",
34
+ # Docker - Container management and sandboxing
35
+ "docker",
36
+ # Execution - Terminal, parser, sandbox integration
37
+ "execution",
38
+ # Orchestration - Pipeline, scheduler, progress tracking
39
+ "orchestration",
40
+ # Intelligence - Vulnerability analysis, triage, scope
41
+ "intelligence",
42
+ # Tools - Scanner integrations (Acunetix, Burp, etc.)
43
+ "tools",
44
+ # Payloads - XSS, SQLi, SSRF, SSTI, etc.
45
+ "payloads",
46
+ # Scanners - Nuclei, Nmap, Nikto wrappers
47
+ "scanners",
48
+ # Recon - Subdomain, DNS, tech detection
49
+ "recon",
50
+ # Browser - Playwright automation
51
+ "browser",
52
+ # Terminal - Command execution
53
+ "terminal",
54
+ # Proxy - mitmproxy interception
55
+ "proxy",
56
+ ]
57
+
58
+ # Lazy imports to avoid failures when optional dependencies are missing
59
+
60
+
61
+ def __getattr__(name):
62
+ """Lazy import handler for optional dependencies"""
63
+ if name == "LLM":
64
+ from aipt_v2.llm.llm import LLM
65
+ return LLM
66
+ elif name == "LLMConfig":
67
+ from aipt_v2.llm.config import LLMConfig
68
+ return LLMConfig
69
+ elif name == "PTT":
70
+ from aipt_v2.agents.ptt import PTT
71
+ return PTT
72
+ elif name == "BaseAgent":
73
+ from aipt_v2.agents.base import BaseAgent
74
+ return BaseAgent
75
+ elif name == "CVEIntelligence":
76
+ from aipt_v2.intelligence.cve_aipt import CVEIntelligence
77
+ return CVEIntelligence
78
+ elif name == "ToolRAG":
79
+ from aipt_v2.intelligence.rag import ToolRAG
80
+ return ToolRAG
81
+ elif name == "OutputParser":
82
+ from aipt_v2.tools.parser import OutputParser
83
+ return OutputParser
84
+ elif name == "Repository":
85
+ from aipt_v2.database.repository import Repository
86
+ return Repository
87
+ # New models module
88
+ elif name == "Finding":
89
+ from aipt_v2.models.findings import Finding
90
+ return Finding
91
+ elif name == "Severity":
92
+ from aipt_v2.models.findings import Severity
93
+ return Severity
94
+ elif name == "ScanConfig":
95
+ from aipt_v2.models.scan_config import ScanConfig
96
+ return ScanConfig
97
+ elif name == "ScanMode":
98
+ from aipt_v2.models.scan_config import ScanMode
99
+ return ScanMode
100
+ elif name == "PhaseResult":
101
+ from aipt_v2.models.phase_result import PhaseResult
102
+ return PhaseResult
103
+ # Reports module
104
+ elif name == "ReportGenerator":
105
+ from aipt_v2.reports.generator import ReportGenerator
106
+ return ReportGenerator
107
+ elif name == "ReportConfig":
108
+ from aipt_v2.reports.generator import ReportConfig
109
+ return ReportConfig
110
+ raise AttributeError(f"module 'aipt_v2' has no attribute '{name}'")
aipt_v2/__main__.py ADDED
@@ -0,0 +1,24 @@
1
+ #!/usr/bin/env python3
2
+ """
3
+ AIPTX - AI-Powered Penetration Testing Framework
4
+ ================================================
5
+
6
+ This module allows running aiptx as a module:
7
+ python -m aiptx scan example.com
8
+ python -m aiptx --help
9
+
10
+ Or directly after pipx install:
11
+ aiptx scan example.com
12
+ """
13
+
14
+ import sys
15
+
16
+
17
+ def main():
18
+ """Entry point for module execution."""
19
+ from cli import main as cli_main
20
+ sys.exit(cli_main())
21
+
22
+
23
+ if __name__ == "__main__":
24
+ main()
@@ -0,0 +1,10 @@
1
+ """
2
+ AIPT AIPTxAgent - Main penetration testing agent
3
+ """
4
+
5
+ from aipt_v2.agents.AIPTxAgent.aiptx_agent import AIPTxAgent
6
+
7
+ # Backwards compatibility alias
8
+ StrixAgent = AIPTxAgent
9
+
10
+ __all__ = ["AIPTxAgent", "StrixAgent"]
@@ -0,0 +1,211 @@
1
+ """
2
+ AIPT AIPTxAgent - Main penetration testing agent
3
+
4
+ This is the primary agent that orchestrates penetration testing activities.
5
+ It uses the BaseAgent infrastructure with security-focused tools and prompts.
6
+ """
7
+
8
+ import asyncio
9
+ import logging
10
+ from typing import Any, Optional, Dict
11
+
12
+ from aipt_v2.agents.base import BaseAgent
13
+ from aipt_v2.agents.ptt import PTT, TaskStatus
14
+ from aipt_v2.llm.config import LLMConfig
15
+
16
+
17
+ logger = logging.getLogger(__name__)
18
+
19
+
20
+ class AIPTxAgent(BaseAgent):
21
+ """
22
+ AIPTxAgent - AI-powered penetration testing agent.
23
+
24
+ This agent performs autonomous security testing using a Think-Select-Execute-Learn loop:
25
+ 1. THINK: Analyze current state and decide next action
26
+ 2. SELECT: Choose appropriate security tools via RAG
27
+ 3. EXECUTE: Run tools and capture output
28
+ 4. LEARN: Extract findings, update PTT, decide next phase
29
+
30
+ Features:
31
+ - Multi-phase pentest tracking (recon, enum, exploit, post, report)
32
+ - RAG-based tool selection with 50+ security tools
33
+ - CVE intelligence with CVSS+EPSS+POC scoring
34
+ - Docker sandbox for isolated tool execution
35
+ - Browser automation for web application testing
36
+ - Proxy interception for traffic analysis
37
+ """
38
+
39
+ agent_name = "AIPTxAgent"
40
+ max_iterations = 300
41
+
42
+ def __init__(self, config: Dict[str, Any]):
43
+ """
44
+ Initialize AIPTxAgent.
45
+
46
+ Args:
47
+ config: Agent configuration with:
48
+ - llm_config: LLMConfig instance
49
+ - max_iterations: Maximum agent loop iterations
50
+ - non_interactive: Run without user interaction
51
+ - local_sources: Local source directories to mount
52
+ """
53
+ # Ensure llm_config is provided
54
+ if "llm_config" not in config:
55
+ config["llm_config"] = LLMConfig()
56
+
57
+ super().__init__(config)
58
+
59
+ # Initialize PTT for tracking pentest progress
60
+ self.ptt = PTT()
61
+
62
+ # Store scan configuration
63
+ self.scan_config: Optional[Dict[str, Any]] = None
64
+ self.targets_info: list[Dict[str, Any]] = []
65
+
66
+ # Results storage
67
+ self.findings: list[Dict[str, Any]] = []
68
+ self.vulnerabilities: list[Dict[str, Any]] = []
69
+
70
+ async def execute_scan(self, scan_config: Dict[str, Any]) -> Dict[str, Any]:
71
+ """
72
+ Execute a penetration test scan.
73
+
74
+ Args:
75
+ scan_config: Scan configuration with:
76
+ - scan_id: Unique scan identifier
77
+ - targets: List of target info dicts
78
+ - user_instructions: Optional user instructions
79
+ - run_name: Name for this run
80
+
81
+ Returns:
82
+ Dict with scan results including findings and vulnerabilities
83
+ """
84
+ self.scan_config = scan_config
85
+ self.targets_info = scan_config.get("targets", [])
86
+
87
+ # Build the task prompt
88
+ task = self._build_task_prompt(scan_config)
89
+
90
+ # Initialize PTT for first target
91
+ if self.targets_info:
92
+ first_target = self.targets_info[0].get("original", "unknown")
93
+ self.ptt.initialize(first_target)
94
+
95
+ logger.info(f"Starting penetration test scan: {scan_config.get('scan_id', 'unknown')}")
96
+
97
+ try:
98
+ # Run the agent loop
99
+ result = await self.agent_loop(task)
100
+
101
+ # Compile final results
102
+ final_result = {
103
+ "success": True,
104
+ "scan_id": scan_config.get("scan_id"),
105
+ "findings": self.findings,
106
+ "vulnerabilities": self.vulnerabilities,
107
+ "ptt_summary": self.ptt.get_summary() if self.ptt.target else {},
108
+ "agent_summary": self.state.get_execution_summary(),
109
+ }
110
+
111
+ return final_result
112
+
113
+ except asyncio.CancelledError:
114
+ logger.warning("Scan was cancelled")
115
+ return {
116
+ "success": False,
117
+ "error": "Scan was cancelled",
118
+ "scan_id": scan_config.get("scan_id"),
119
+ }
120
+ except Exception as e:
121
+ logger.exception(f"Scan failed: {e}")
122
+ return {
123
+ "success": False,
124
+ "error": str(e),
125
+ "scan_id": scan_config.get("scan_id"),
126
+ }
127
+
128
+ def _build_task_prompt(self, scan_config: Dict[str, Any]) -> str:
129
+ """Build the initial task prompt for the agent."""
130
+ targets = scan_config.get("targets", [])
131
+ user_instructions = scan_config.get("user_instructions", "")
132
+
133
+ # Build target description
134
+ if len(targets) == 1:
135
+ target_desc = targets[0].get("original", "unknown target")
136
+ target_type = targets[0].get("type", "unknown")
137
+ else:
138
+ target_desc = f"{len(targets)} targets"
139
+ target_type = "multiple"
140
+
141
+ task = f"""You are an AI penetration testing agent. Your mission is to perform a comprehensive security assessment on: {target_desc}
142
+
143
+ Target Type: {target_type}
144
+ """
145
+
146
+ if len(targets) == 1:
147
+ details = targets[0].get("details", {})
148
+ if details:
149
+ task += f"Target Details: {details}\n"
150
+
151
+ if user_instructions:
152
+ task += f"\nUser Instructions: {user_instructions}\n"
153
+
154
+ task += """
155
+ Your objectives:
156
+ 1. RECONNAISSANCE: Gather information about the target (ports, services, technologies)
157
+ 2. ENUMERATION: Identify potential attack vectors and vulnerabilities
158
+ 3. EXPLOITATION: Safely test identified vulnerabilities (do not cause damage)
159
+ 4. DOCUMENTATION: Record all findings with severity and remediation advice
160
+
161
+ Guidelines:
162
+ - Follow responsible disclosure practices
163
+ - Document all findings clearly
164
+ - Prioritize high-impact vulnerabilities
165
+ - Stay within authorized scope
166
+ - Use appropriate tools for each phase
167
+
168
+ Begin your security assessment now. Start with reconnaissance to understand the target.
169
+ """
170
+
171
+ return task
172
+
173
+ def add_finding(self, finding: Dict[str, Any]) -> None:
174
+ """Add a finding to the scan results."""
175
+ self.findings.append(finding)
176
+
177
+ # Also track in PTT
178
+ if self.ptt.target:
179
+ phase = finding.get("phase", self.ptt.current_phase)
180
+ self.ptt.add_findings(phase, [finding])
181
+
182
+ def add_vulnerability(self, vulnerability: Dict[str, Any]) -> None:
183
+ """Add a vulnerability to the scan results."""
184
+ self.vulnerabilities.append(vulnerability)
185
+
186
+ # Also add as finding
187
+ self.add_finding({
188
+ **vulnerability,
189
+ "type": "vulnerability",
190
+ })
191
+
192
+ # Notify tracer if available
193
+ from aipt_v2.telemetry.tracer import get_global_tracer
194
+ tracer = get_global_tracer()
195
+ if tracer and hasattr(tracer, "report_vulnerability"):
196
+ tracer.report_vulnerability(
197
+ report_id=vulnerability.get("id", "VULN"),
198
+ title=vulnerability.get("title", "Unknown Vulnerability"),
199
+ content=vulnerability.get("description", ""),
200
+ severity=vulnerability.get("severity", "info"),
201
+ )
202
+
203
+ def get_ptt_summary(self) -> str:
204
+ """Get PTT progress summary for the LLM."""
205
+ if self.ptt.target:
206
+ return self.ptt.to_prompt()
207
+ return "No PTT initialized"
208
+
209
+
210
+ # Backwards compatibility alias
211
+ StrixAgent = AIPTxAgent
@@ -0,0 +1,46 @@
1
+ """
2
+ AIPT Agents Module - Agent orchestration and task tracking
3
+
4
+ Includes:
5
+ - PTT (Penetration Testing Tracker) for task management
6
+ - BaseAgent for general agent functionality
7
+ - ExploitReasoningAgent for LLM-powered exploitation
8
+ """
9
+
10
+ # Core components that don't require external dependencies
11
+ from aipt_v2.agents.ptt import PTT, Task, Phase, TaskStatus, PhaseType
12
+ from aipt_v2.agents.state import AgentState
13
+
14
+ __all__ = [
15
+ "PTT",
16
+ "Task",
17
+ "Phase",
18
+ "PhaseType",
19
+ "TaskStatus",
20
+ "AgentState",
21
+ "BaseAgent",
22
+ "ExploitReasoningAgent",
23
+ "ExploitResult",
24
+ "ExploitStep",
25
+ "ExploitAction",
26
+ ]
27
+
28
+
29
+ def __getattr__(name):
30
+ """Lazy import for components with external dependencies"""
31
+ if name == "BaseAgent":
32
+ from aipt_v2.agents.base import BaseAgent
33
+ return BaseAgent
34
+ if name == "ExploitReasoningAgent":
35
+ from aipt_v2.agents.exploit_agent import ExploitReasoningAgent
36
+ return ExploitReasoningAgent
37
+ if name == "ExploitResult":
38
+ from aipt_v2.agents.exploit_agent import ExploitResult
39
+ return ExploitResult
40
+ if name == "ExploitStep":
41
+ from aipt_v2.agents.exploit_agent import ExploitStep
42
+ return ExploitStep
43
+ if name == "ExploitAction":
44
+ from aipt_v2.agents.exploit_agent import ExploitAction
45
+ return ExploitAction
46
+ raise AttributeError(f"module 'aipt_v2.agents' has no attribute '{name}'")