pentesting 0.100.2 → 0.100.4

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.
package/ARCHITECTURE.md CHANGED
@@ -332,22 +332,19 @@ supported OS/CPU target from `agnusdei1207/pentesting-public`.
332
332
 
333
333
  Pentesting reads a user-global config from `~/.pentesting/.pentesting.toml`,
334
334
  overridden by project-local `.pentesting.toml` files discovered by walking up
335
- from the working directory. The storage config is intentionally small:
336
-
337
- ```toml
338
- [storage]
339
- backend = "local" # Local md/fs runtime state
340
- ```
335
+ from the working directory. Local storage is the default; normal setup only
336
+ needs the public model endpoint environment.
341
337
 
342
338
  The same shape is represented in `builder.schema.json`, `.pentesting.toml`, and
343
- the interactive `/config` UI.
344
-
345
- Environment variables use the `PENTESTING_` prefix, with `__` for nested keys —
346
- e.g. `PENTESTING_SESSION__MODEL_ID=...`. Set `PENTESTING_CONFIG` to override the
347
- global config directory.
339
+ the interactive `/config` UI. Set `PENTESTING_CONFIG` to override the global
340
+ config directory.
348
341
 
349
342
  | Variable | Description |
350
343
  | --- | --- |
344
+ | `OPENAI_API_KEY` | API key or gateway token for OpenAI-compatible providers. |
345
+ | `OPENAI_BASE_URL` | OpenAI-compatible base URL, for example `https://api.openai.com/v1` or a self-hosted gateway. |
346
+ | `OPENAI_MODEL` | Default model id. |
347
+ | `OPENAI_MAX_TOKENS` | Optional output-token override; accepts values like `4096`, `32k`, or `1M`. |
351
348
  | `PENTESTING_BIN` | Use an already-installed Builder binary instead of the managed download. |
352
349
  | `PENTESTING_PRODUCT_NAME` | Runtime banner label. The `pentesting` launcher sets this to `pentesting` automatically. |
353
350
  | `PENTESTING_REPO` | Override the public release repo used for binary downloads. Defaults to `agnusdei1207/pentesting-public`. |
package/README.md CHANGED
@@ -17,7 +17,7 @@ The runtime—not the model—owns routing, tool sandboxing, verification, compl
17
17
 
18
18
  ## ✅ Capabilities
19
19
 
20
- Agent-loop essentials at parity with leading coding agents, plus a security-focused layer on top.
20
+ Agent-loop essentials plus a security-focused runtime layer.
21
21
 
22
22
  | Area | What it does |
23
23
  | --- | --- |
@@ -32,39 +32,51 @@ Agent-loop essentials at parity with leading coding agents, plus a security-focu
32
32
  | MCP & skills | Dynamic MCP tool discovery, layered markdown skills |
33
33
  | Memory | Ebbinghaus-style decaying notes + hybrid lexical/semantic/graph retrieval |
34
34
 
35
- **Beyond the baseline:** evidence-gated completion adjudication (Complete / Replan / Blocked), a CTF-oriented reverse-shell/PTY control plane (multi-session tracking, helper-only `pty_upgrade` plus verified `upgrade`, transcript/history/replay, lifecycle/FD management), and CTF-grade verification tools (flag check, best-of-N verify, findings ledger).
36
-
37
35
  ---
38
36
 
39
37
  ## 🚀 Quick Start
40
38
 
41
- Install globally, or run without installing via your package manager of choice:
39
+ Install globally, or run once with a Node package runner:
42
40
 
43
41
  ```bash
44
42
  npm install -g pentesting && pentesting # install
45
43
  npx pentesting # or run once, no install
46
44
  pnpm dlx pentesting
47
45
  yarn dlx pentesting
48
- bunx pentesting
49
- deno run npm:pentesting
50
46
  ```
51
47
 
48
+ Requires Node.js 18.18+. Use npm/npx/pnpm/yarn; Bun and Deno runners are not supported.
49
+
52
50
  ### 🐳 Run with Docker
53
51
 
54
- No local Rust toolchain or native binary needed — the image ships the full
55
- runtime plus the offensive testing toolchain:
52
+ No local Rust toolchain needed:
56
53
 
57
54
  ```bash
55
+ export OPENAI_API_KEY="sk-..." # provider API key or gateway token
56
+ export OPENAI_BASE_URL="https://api.openai.com/v1"
57
+ export OPENAI_MODEL="gpt-4o"
58
+ export OPENAI_MAX_TOKENS="4096"
59
+
58
60
  docker run -it --rm \
59
- -v "$(pwd):/workspace" -w /workspace \
60
- -e ANTHROPIC_API_KEY \
61
+ -v "$(pwd):/workspace" \
62
+ -v pentesting-config:/root/.pentesting \
63
+ -w /workspace \
64
+ -e OPENAI_API_KEY \
65
+ -e OPENAI_BASE_URL \
66
+ -e OPENAI_MODEL \
67
+ -e OPENAI_MAX_TOKENS \
61
68
  agnusdei1207/pentesting:latest
62
69
  ```
63
70
 
64
71
  Or via Docker Compose:
65
72
 
66
73
  ```bash
67
- PENTESTING_PROJECT_DIR=/path/to/project ANTHROPIC_API_KEY=sk-ant-... docker compose run pentesting
74
+ PENTESTING_PROJECT_DIR=/path/to/project \
75
+ OPENAI_API_KEY=sk-... \
76
+ OPENAI_BASE_URL=https://api.openai.com/v1 \
77
+ OPENAI_MODEL=gpt-4o \
78
+ OPENAI_MAX_TOKENS=4096 \
79
+ docker compose run --rm pentesting
68
80
  ```
69
81
 
70
82
  ### Common commands
@@ -76,7 +88,7 @@ pentesting shell-listener --bind 127.0.0.1 --port 4444 # Authorized reverse-sh
76
88
  pentesting --version
77
89
  ```
78
90
 
79
- Use `shell-listener` in authorized CTF/lab work to accept multiple callbacks, label/tag sessions, probe remote identity, run sentinel-tracked commands, verify dumb-shell PTY upgrades, attach/detach without closing, and retain raw logs, transcripts, command history, replay data, and evidence manifests.
91
+ Use `shell-listener` in authorized CTF/lab work to accept callbacks, tag sessions, run sentinel-tracked commands, verify PTY upgrades, and retain transcripts/evidence.
80
92
 
81
93
  Short version: the agent can catch a dumb reverse shell, upgrade it to a verified PTY, pivot to a second callback, and reclaim both sessions cleanly with `close` / `revoke` / `gc`.
82
94
 
@@ -84,7 +96,7 @@ Inside a session, `/help` lists every command and `/update` pulls the latest rel
84
96
 
85
97
  ### 🔌 Reverse-shell & PTY sessions
86
98
 
87
- Catch and manage authorized shell callbacks like a session manager — **one listener, many targets, full audit trail, no leaked file descriptors.**
99
+ Catch and manage authorized shell callbacks: one listener, many targets, audited cleanup.
88
100
 
89
101
  ```bash
90
102
  pentesting shell-listener --port 4444 # 1. Catch callbacks (tracks many at once)
@@ -104,36 +116,35 @@ pentesting shell-session revoke --session 1 # 5. Hard-close: reclaim FDs +
104
116
 
105
117
  ## ⚙️ Configuration
106
118
 
107
- Pentesting reads `~/.pentesting/.pentesting.toml`, overridden by a project-local `.pentesting.toml`:
108
-
109
- ```toml
110
- [storage]
111
- backend = "local" # Local md/fs runtime state
112
- ```
113
-
114
- Environment variables use the `PENTESTING_` prefix (`__` for nested keys, e.g. `PENTESTING_SESSION__MODEL_ID=...`). Full variable list and the legacy `BUILDER_*` aliases are documented in [`ARCHITECTURE.md`](ARCHITECTURE.md#configuration).
119
+ Pentesting uses local storage by default. For normal use, configure only the model endpoint:
115
120
 
116
121
  ### Example `.env` / shell setup
117
122
 
118
123
  ```bash
119
- # Model provider credentials — set whichever provider(s) you use
120
- export ANTHROPIC_API_KEY="sk-ant-..."
124
+ # OpenAI-compatible provider or gateway
121
125
  export OPENAI_API_KEY="sk-..."
122
- export OPENROUTER_API_KEY="sk-or-..."
126
+ export OPENAI_BASE_URL="https://api.openai.com/v1"
127
+ export OPENAI_MODEL="gpt-4o"
128
+ export OPENAI_MAX_TOKENS="4096"
123
129
 
124
130
  # Runtime overrides (optional)
125
- export PENTESTING_SESSION__MODEL_ID="claude-sonnet-5" # default model for new sessions
126
131
  export PENTESTING_CONFIG="$HOME/.config/pentesting" # move the global config dir
127
132
  export PENTESTING_SKIP_DOWNLOAD=1 # skip postinstall binary download (CI)
128
133
  ```
129
134
 
130
- With Docker, pass the same variables through with `-e`:
135
+ The TUI pre-fills output max tokens from known model names/provider metadata. `OPENAI_MAX_TOKENS` and the TUI field are explicit overrides for custom/self-hosted models.
136
+
137
+ With Docker, mount both your project and the persistent runtime config volume, then pass the same variables through with `-e`:
131
138
 
132
139
  ```bash
133
140
  docker run -it --rm \
134
- -v "$(pwd):/workspace" -w /workspace \
135
- -e ANTHROPIC_API_KEY \
136
- -e PENTESTING_SESSION__MODEL_ID="claude-sonnet-5" \
141
+ -v "$(pwd):/workspace" \
142
+ -v pentesting-config:/root/.pentesting \
143
+ -w /workspace \
144
+ -e OPENAI_API_KEY \
145
+ -e OPENAI_BASE_URL \
146
+ -e OPENAI_MODEL \
147
+ -e OPENAI_MAX_TOKENS \
137
148
  agnusdei1207/pentesting:latest
138
149
  ```
139
150
 
@@ -144,6 +155,7 @@ docker run -it --rm \
144
155
  ## 📖 Documentation
145
156
 
146
157
  * [`ARCHITECTURE.md`](ARCHITECTURE.md) — Runtime flow, agent team, memory model, crate map, tool surface, and supported targets.
158
+ * Internal layout: service traits are split under `builder_app/src/services/*`; OpenAI request conversion is isolated under `dto/openai/request/*`.
147
159
  * [Public site](https://agnusdei1207.github.io/pentesting-public/) — Landing page and public runtime entry surface.
148
160
  * [`compose.yaml`](https://github.com/agnusdei1207/pentesting-public) — Docker Compose facade for pentesting sessions.
149
161
 
package/lib/runtime.mjs CHANGED
@@ -58,10 +58,10 @@ export function resolveReleaseAsset(platform = process.platform, arch = process.
58
58
  if (!target) {
59
59
  const supported = Object.keys(RELEASE_TARGETS).join(", ");
60
60
  throw new Error(
61
- `No native pentesting binary for '${platform}/${arch}'. ` +
61
+ `No native pentesting binary for '${platform}/${arch}'. ` +
62
62
  `Native targets: ${supported}. ` +
63
63
  `On macOS/Windows run it via Docker instead: ` +
64
- `docker run -it --rm -v "$(pwd):/workspace" agnusdei1207/pentesting`,
64
+ `docker run -it --rm -v "$(pwd):/workspace" -v pentesting-config:/root/.pentesting -w /workspace -e OPENAI_API_KEY -e OPENAI_BASE_URL -e OPENAI_MODEL -e OPENAI_MAX_TOKENS agnusdei1207/pentesting`,
65
65
  );
66
66
  }
67
67
  return target;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "pentesting",
3
- "version": "0.100.2",
4
- "builderReleaseTag": "v0.100.0",
3
+ "version": "0.100.4",
4
+ "builderReleaseTag": "v0.100.1",
5
5
  "description": "pentesting — coding agent runtime with audited reverse-shell capture, verified PTY session upgrades, pivot control, evidence transcripts, and safe session reclamation.",
6
6
  "license": "MIT",
7
7
  "author": "agnusdei1207",
@@ -52,8 +52,9 @@
52
52
  "audit": "bash scripts/audit-project.sh",
53
53
  "test": "node --test tests/*.test.mjs",
54
54
  "preflight:local": "bash scripts/preflight-local.sh",
55
+ "refactor:stability": "bash scripts/refactor-stability.sh",
55
56
  "verify": "npm run consistency && npm run test",
56
- "check": "npm run verify",
57
+ "check": "npm run check:docker",
57
58
  "pentesting:help": "bash scripts/pentesting-release-help.sh",
58
59
  "pentesting:status": "bash scripts/pentesting-release-status.sh",
59
60
  "pentesting:test": "npm run test",
@@ -71,7 +72,7 @@
71
72
  "public:sync": "bash scripts/sync-public-repo.sh",
72
73
  "public:mirror-release": "bash scripts/mirror-public-release.sh",
73
74
  "release:backfill": "bash scripts/backfill-release-local.sh",
74
- "check:docker": "sh -c 'npm run docker:build && docker run -it --rm -v builder-workspace:/workspace -e ANTHROPIC_BASE_URL -e ANTHROPIC_AUTH_TOKEN -e ANTHROPIC_MODEL -e ANTHROPIC_API_KEY -e MINIMAX_API_KEY -e OPENAI_API_KEY -e OPENAI_BASE_URL -e GEMINI_API_KEY -e DEEPSEEK_API_KEY agnusdei1207/pentesting:latest'",
75
+ "check:docker": "sh -c ': \"${OPENAI_API_KEY:?Set OPENAI_API_KEY}\"; : \"${OPENAI_BASE_URL:?Set OPENAI_BASE_URL}\"; : \"${OPENAI_MODEL:?Set OPENAI_MODEL}\"; : \"${OPENAI_MAX_TOKENS:?Set OPENAI_MAX_TOKENS}\"; npm run docker:build && docker run -it --rm -v builder-workspace:/workspace -v pentesting-config:/root/.pentesting -e OPENAI_API_KEY -e OPENAI_BASE_URL -e OPENAI_MODEL -e OPENAI_MAX_TOKENS agnusdei1207/pentesting:latest'",
75
76
  "docker:build": "(docker image inspect agnusdei1207/pentesting-build-base:1.96 >/dev/null 2>&1 && docker image inspect agnusdei1207/pentesting-runtime-base:26.04 >/dev/null 2>&1 || npm run docker:base:build) && docker build --build-arg APP_VERSION=$(git describe --tags --abbrev=0 2>/dev/null || echo dev) -t agnusdei1207/pentesting:latest .",
76
77
  "docker:base:build": "docker build -t agnusdei1207/pentesting-build-base:1.96 -f docker/build-base.Dockerfile . && docker build -t agnusdei1207/pentesting-runtime-base:26.04 -f docker/runtime-base.Dockerfile .",
77
78
  "release:patch": "./scripts/release-all.sh patch",