Skip to content

Commit abe3be0

Browse files
committed
feat: 🎸 version 1.0 agentic workflow
Major rewrite of PentestGPT to use an agentic pipeline architecture: Core Changes: - New event-driven architecture with EventBus for TUI-agent decoupling - Implemented AgentController with 5-state lifecycle (IDLE->RUNNING->PAUSED->COMPLETED->ERROR) - Added AgentBackend interface with ClaudeCodeBackend implementation - Session management with file-based persistence for resumable pentests - Langfuse integration for observability and tracing Interface: - New Textual-based TUI with real-time activity feed - Keyboard shortcuts: F1 help, Ctrl+P pause, Ctrl+Q quit - Enhanced CLI with --target, --instruction, --non-interactive, --debug flags Project Structure: - Moved legacy multi-LLM version (v0.15) to legacy/ directory - New pentestgpt/core/ for agent, controller, events, session modules - New pentestgpt/interface/ for TUI and CLI components - New pentestgpt/benchmark/ for xbow benchmark integration - Comprehensive test suite in tests/ with unit and integration tests DevOps: - Docker support with Ubuntu 24.04 container - GitHub Actions CI/CD pipeline - Makefile with dev commands (test, lint, format, typecheck) - Added xbow-validation-benchmarks as submodule
1 parent 0f8e73a commit abe3be0

170 files changed

Lines changed: 17159 additions & 411 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.env.example

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# PentestGPT Configuration
2+
# Copy this file to .env if you want to customize settings
3+
4+
# =============================================================================
5+
# Claude Configuration
6+
# =============================================================================
7+
# Claude Code manages its own API configuration.
8+
# Configure with: claude config (inside container)
9+
10+
# Optional: Claude model to use
11+
# Options: claude-sonnet-4-5-20250929, claude-opus-4-20250514
12+
LLM_MODEL=claude-sonnet-4-5-20250929

.github/dependabot.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
version: 2
2+
updates:
3+
# Python dependencies via pip/poetry
4+
- package-ecosystem: "pip"
5+
directory: "/"
6+
schedule:
7+
interval: "weekly"
8+
day: "monday"
9+
open-pull-requests-limit: 5
10+
labels:
11+
- "dependencies"
12+
- "python"
13+
14+
# GitHub Actions
15+
- package-ecosystem: "github-actions"
16+
directory: "/"
17+
schedule:
18+
interval: "weekly"
19+
day: "monday"
20+
open-pull-requests-limit: 5
21+
labels:
22+
- "dependencies"
23+
- "github-actions"
24+
25+
# Docker
26+
- package-ecosystem: "docker"
27+
directory: "/"
28+
schedule:
29+
interval: "weekly"
30+
day: "monday"
31+
open-pull-requests-limit: 3
32+
labels:
33+
- "dependencies"
34+
- "docker"

.github/pull_request_template.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
## Description
2+
3+
<!-- Describe your changes in detail -->
4+
5+
## Type of Change
6+
7+
<!-- Mark the relevant option with an "x" -->
8+
9+
- [ ] Bug fix (non-breaking change which fixes an issue)
10+
- [ ] New feature (non-breaking change which adds functionality)
11+
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
12+
- [ ] Documentation update
13+
- [ ] Refactoring (no functional changes)
14+
15+
## Checklist
16+
17+
<!-- Mark completed items with an "x" -->
18+
19+
- [ ] I have read the contributing guidelines
20+
- [ ] My code follows the project's code style
21+
- [ ] I have run `make lint` and fixed any issues
22+
- [ ] I have run `make typecheck` and fixed any issues
23+
- [ ] I have added/updated tests for my changes
24+
- [ ] I have run `make test` and all tests pass
25+
- [ ] I have updated documentation if needed
26+
27+
## Testing
28+
29+
<!-- Describe how you tested your changes -->
30+
31+
## Related Issues
32+
33+
<!-- Link any related issues using "Fixes #123" or "Relates to #123" -->
34+
35+
## Screenshots (if applicable)
36+
37+
<!-- Add screenshots for UI changes -->

.github/workflows/ci.yml

Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
lint:
11+
name: Lint
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v4
15+
16+
- name: Install uv
17+
uses: astral-sh/setup-uv@v4
18+
with:
19+
version: "latest"
20+
21+
- name: Set up Python
22+
run: uv python install 3.12
23+
24+
- name: Install dependencies
25+
run: uv sync
26+
27+
- name: Run ruff check
28+
run: uv run ruff check pentestgpt/ tests/
29+
30+
- name: Run ruff format check
31+
run: uv run ruff format --check pentestgpt/ tests/
32+
33+
typecheck:
34+
name: Type Check
35+
runs-on: ubuntu-latest
36+
steps:
37+
- uses: actions/checkout@v4
38+
39+
- name: Install uv
40+
uses: astral-sh/setup-uv@v4
41+
with:
42+
version: "latest"
43+
44+
- name: Set up Python
45+
run: uv python install 3.12
46+
47+
- name: Install dependencies
48+
run: uv sync
49+
50+
- name: Run mypy
51+
run: uv run mypy pentestgpt/
52+
53+
test:
54+
name: Test
55+
runs-on: ubuntu-latest
56+
steps:
57+
- uses: actions/checkout@v4
58+
59+
- name: Install uv
60+
uses: astral-sh/setup-uv@v4
61+
with:
62+
version: "latest"
63+
64+
- name: Set up Python
65+
run: uv python install 3.12
66+
67+
- name: Install dependencies
68+
run: uv sync
69+
70+
- name: Run tests
71+
run: uv run pytest tests/ -v --ignore=tests/docker/
72+
73+
test-docker:
74+
name: Docker Tests
75+
runs-on: ubuntu-latest
76+
steps:
77+
- uses: actions/checkout@v4
78+
with:
79+
submodules: recursive
80+
81+
- name: Validate docker-compose config
82+
run: docker compose config
83+
84+
- name: Build Docker image
85+
run: docker compose build
86+
87+
- name: Install uv
88+
uses: astral-sh/setup-uv@v4
89+
with:
90+
version: "latest"
91+
92+
- name: Set up Python
93+
run: uv python install 3.12
94+
95+
- name: Install dependencies
96+
run: uv sync
97+
98+
- name: Run Docker tests
99+
run: uv run pytest tests/docker/ -v -m docker
100+
101+
build:
102+
name: Build
103+
runs-on: ubuntu-latest
104+
steps:
105+
- uses: actions/checkout@v4
106+
107+
- name: Install uv
108+
uses: astral-sh/setup-uv@v4
109+
with:
110+
version: "latest"
111+
112+
- name: Set up Python
113+
run: uv python install 3.12
114+
115+
- name: Build package
116+
run: uv build
117+
118+
- name: Upload artifacts
119+
uses: actions/upload-artifact@v4
120+
with:
121+
name: dist
122+
path: dist/
123+
retention-days: 7

.github/workflows/publish.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Publish to PyPI
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
publish:
9+
name: Build and Publish
10+
runs-on: ubuntu-latest
11+
environment:
12+
name: pypi
13+
url: https://pypi.org/p/pentestgpt
14+
permissions:
15+
id-token: write
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- name: Set up Python
20+
uses: actions/setup-python@v5
21+
with:
22+
python-version: "3.12"
23+
24+
- name: Install Poetry
25+
run: |
26+
curl -sSL https://install.python-poetry.org | python3 -
27+
echo "$HOME/.local/bin" >> $GITHUB_PATH
28+
29+
- name: Build package
30+
run: poetry build
31+
32+
- name: Publish to PyPI
33+
uses: pypa/gh-action-pypi-publish@release/v1
34+
with:
35+
verbose: true

0 commit comments

Comments
 (0)