pentesting 0.100.3 → 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,42 +32,39 @@ 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
58
- export ANTHROPIC_AUTH_TOKEN="sk-..." # provider token
59
- export ANTHROPIC_API_KEY="$ANTHROPIC_AUTH_TOKEN" # keep both for Anthropic-compatible gateways
60
- export ANTHROPIC_BASE_URL="https://api.minimax.io/anthropic"
61
- export ANTHROPIC_MODEL="MiniMax-M2.7"
62
- export PENTESTING_SESSION__MODEL_ID="$ANTHROPIC_MODEL"
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"
63
59
 
64
60
  docker run -it --rm \
65
- -v "$(pwd):/workspace" -w /workspace \
66
- -e ANTHROPIC_AUTH_TOKEN \
67
- -e ANTHROPIC_API_KEY \
68
- -e ANTHROPIC_BASE_URL \
69
- -e ANTHROPIC_MODEL \
70
- -e PENTESTING_SESSION__MODEL_ID \
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 \
71
68
  agnusdei1207/pentesting:latest
72
69
  ```
73
70
 
@@ -75,12 +72,11 @@ Or via Docker Compose:
75
72
 
76
73
  ```bash
77
74
  PENTESTING_PROJECT_DIR=/path/to/project \
78
- ANTHROPIC_AUTH_TOKEN=sk-... \
79
- ANTHROPIC_API_KEY=sk-... \
80
- ANTHROPIC_BASE_URL=https://api.minimax.io/anthropic \
81
- ANTHROPIC_MODEL=MiniMax-M2.7 \
82
- PENTESTING_SESSION__MODEL_ID=MiniMax-M2.7 \
83
- docker compose run pentesting
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
84
80
  ```
85
81
 
86
82
  ### Common commands
@@ -92,7 +88,7 @@ pentesting shell-listener --bind 127.0.0.1 --port 4444 # Authorized reverse-sh
92
88
  pentesting --version
93
89
  ```
94
90
 
95
- 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.
96
92
 
97
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`.
98
94
 
@@ -100,7 +96,7 @@ Inside a session, `/help` lists every command and `/update` pulls the latest rel
100
96
 
101
97
  ### 🔌 Reverse-shell & PTY sessions
102
98
 
103
- 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.
104
100
 
105
101
  ```bash
106
102
  pentesting shell-listener --port 4444 # 1. Catch callbacks (tracks many at once)
@@ -120,42 +116,35 @@ pentesting shell-session revoke --session 1 # 5. Hard-close: reclaim FDs +
120
116
 
121
117
  ## ⚙️ Configuration
122
118
 
123
- Pentesting reads `~/.pentesting/.pentesting.toml`, overridden by a project-local `.pentesting.toml`:
124
-
125
- ```toml
126
- [storage]
127
- backend = "local" # Local md/fs runtime state
128
- ```
129
-
130
- 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:
131
120
 
132
121
  ### Example `.env` / shell setup
133
122
 
134
123
  ```bash
135
- # Model provider credentials — set whichever provider(s) you use
136
- export ANTHROPIC_API_KEY="sk-ant-..."
137
- export ANTHROPIC_AUTH_TOKEN="$ANTHROPIC_API_KEY" # token used by Anthropic-compatible providers
138
- export ANTHROPIC_BASE_URL="https://api.minimax.io/anthropic"
139
- export ANTHROPIC_MODEL="MiniMax-M2.7"
124
+ # OpenAI-compatible provider or gateway
140
125
  export OPENAI_API_KEY="sk-..."
141
- 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"
142
129
 
143
130
  # Runtime overrides (optional)
144
- export PENTESTING_SESSION__MODEL_ID="$ANTHROPIC_MODEL" # default model for new sessions
145
131
  export PENTESTING_CONFIG="$HOME/.config/pentesting" # move the global config dir
146
132
  export PENTESTING_SKIP_DOWNLOAD=1 # skip postinstall binary download (CI)
147
133
  ```
148
134
 
149
- 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`:
150
138
 
151
139
  ```bash
152
140
  docker run -it --rm \
153
- -v "$(pwd):/workspace" -w /workspace \
154
- -e ANTHROPIC_AUTH_TOKEN \
155
- -e ANTHROPIC_API_KEY \
156
- -e ANTHROPIC_BASE_URL \
157
- -e ANTHROPIC_MODEL \
158
- -e PENTESTING_SESSION__MODEL_ID \
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 \
159
148
  agnusdei1207/pentesting:latest
160
149
  ```
161
150
 
@@ -166,6 +155,7 @@ docker run -it --rm \
166
155
  ## 📖 Documentation
167
156
 
168
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/*`.
169
159
  * [Public site](https://agnusdei1207.github.io/pentesting-public/) — Landing page and public runtime entry surface.
170
160
  * [`compose.yaml`](https://github.com/agnusdei1207/pentesting-public) — Docker Compose facade for pentesting sessions.
171
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.3",
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",