@pensar/apex 2.2.0-canary.d6258ef8 → 2.3.0-canary.f43660dd
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/build/{agent-frsp4e9f.js → agent-54zbjp5g.js} +9 -9
- package/build/agent-dmfqxetq.js +19 -0
- package/build/{agent-qp259717.js → agent-nr5eq27w.js} +7 -7
- package/build/{apps-qxqkv051.js → apps-yhq3vem2.js} +16 -16
- package/build/{auth-t59cz517.js → auth-kag9cbnd.js} +32 -39
- package/build/authentication-hx4920t3.js +19 -0
- package/build/blackboxAgent-ga9cc2sv.js +19 -0
- package/build/{blackboxPentest-tfw4qs8h.js → blackboxPentest-hac0kjq7.js} +14 -14
- package/build/{cli-g200wfvt.js → cli-0cw9k1tw.js} +4 -2
- package/build/{cli-e4vp401h.js → cli-3m2x8w2t.js} +2 -2
- package/build/{cli-w8evvv3q.js → cli-5b7x19aa.js} +1 -1
- package/build/{cli-1pvfb9z0.js → cli-5dj8fc52.js} +1 -1
- package/build/{cli-h3128sv8.js → cli-5vskcg6x.js} +8 -8
- package/build/{cli-6tvsa4qw.js → cli-8nmjfxpb.js} +58 -26
- package/build/{cli-d5w0q9np.js → cli-bpd40kwt.js} +1 -1
- package/build/{cli-2g238meq.js → cli-c5e9y4f7.js} +2 -2
- package/build/{cli-cs6sg81e.js → cli-crbamax1.js} +2 -2
- package/build/{cli-gr20jztt.js → cli-ez994rr8.js} +1 -1
- package/build/{cli-zw2vjs4v.js → cli-jz6ak250.js} +2 -2
- package/build/{cli-tvv03x9s.js → cli-kkkxevak.js} +3 -3
- package/build/{cli-h6czbkax.js → cli-kpabqavj.js} +19 -6
- package/build/{cli-z7h336ft.js → cli-mg5hqzfk.js} +51 -2
- package/build/{cli-q5f1hbhm.js → cli-nw87xhd7.js} +1 -1
- package/build/{cli-8dgnq80w.js → cli-tzaxpbx8.js} +3983 -55
- package/build/{cli-j1p3f9rw.js → cli-y177s333.js} +3 -3
- package/build/cli.js +33 -33
- package/build/{config-0vpj7q4e.js → config-ejqssj7v.js} +3 -3
- package/build/{doctor-7anrb028.js → doctor-nq5j5b3n.js} +6 -6
- package/build/{fastStrike-5fwva78y.js → fastStrike-r2nnp14k.js} +9 -9
- package/build/{fixes-8p5g9g3y.js → fixes-1k92rcye.js} +16 -16
- package/build/{index-358zy1gf.js → index-dgskmca6.js} +21 -8
- package/build/{index-0g54mn6h.js → index-emkkrdxh.js} +8 -8
- package/build/{index-1txg9pyv.js → index-fxdwg3rg.js} +9 -9
- package/build/{index-ppwh9n9c.js → index-mdnk1yy1.js} +3 -3
- package/build/{index-9h8hn4fj.js → index-q0e883cx.js} +2 -2
- package/build/{index-6n6spqzq.js → index-qcvh5me4.js} +9 -5
- package/build/{index-fxntd5xb.js → index-qgw3yp85.js} +1080 -898
- package/build/{issues-zhc76v97.js → issues-vnk8x7da.js} +44 -16
- package/build/{logs-djkhjp78.js → logs-rr9fwq7m.js} +16 -16
- package/build/{offesecAgent-yv3sx7c9.js → offesecAgent-1sw6kh7y.js} +8 -8
- package/build/pentest-rks9g0xv.js +29 -0
- package/build/{pentests-ytcvakfc.js → pentests-6kpja9cc.js} +16 -16
- package/build/{targetedPentest-91x22vjt.js → targetedPentest-v3vyanfw.js} +9 -9
- package/build/{targets-db299n5v.js → targets-6h670bhe.js} +16 -16
- package/build/threatModel-gqpa574g.js +27 -0
- package/build/{uninstall-gwpra3ve.js → uninstall-1vyfsbab.js} +1 -1
- package/build/{upload-mm8104gb.js → upload-kaqk0rnk.js} +6 -6
- package/build/{utils-2a2q9ykn.js → utils-6gqkfbv5.js} +5 -5
- package/package.json +1 -1
- package/build/agent-0nxcqdjn.js +0 -19
- package/build/authentication-gtsjh6ch.js +0 -19
- package/build/blackboxAgent-f6grtczx.js +0 -19
- package/build/pentest-bc244cvt.js +0 -29
- package/build/threatModel-te1z1zcg.js +0 -27
|
@@ -4,19 +4,19 @@ import {
|
|
|
4
4
|
buildPentestActiveTools,
|
|
5
5
|
buildPentestPrompt,
|
|
6
6
|
buildPentestSystemPrompt
|
|
7
|
-
} from "./cli-
|
|
7
|
+
} from "./cli-jz6ak250.js";
|
|
8
8
|
import"./cli-9fsre5pt.js";
|
|
9
|
-
import"./cli-
|
|
10
|
-
import"./cli-
|
|
11
|
-
import"./cli-
|
|
9
|
+
import"./cli-ez994rr8.js";
|
|
10
|
+
import"./cli-tzaxpbx8.js";
|
|
11
|
+
import"./cli-5b7x19aa.js";
|
|
12
12
|
import"./cli-c8131c4q.js";
|
|
13
|
-
import"./cli-
|
|
14
|
-
import"./cli-
|
|
13
|
+
import"./cli-kpabqavj.js";
|
|
14
|
+
import"./cli-mg5hqzfk.js";
|
|
15
15
|
import"./cli-3k1x5rn3.js";
|
|
16
16
|
import"./cli-gpnb45ck.js";
|
|
17
|
-
import"./cli-
|
|
18
|
-
import"./cli-
|
|
19
|
-
import"./cli-
|
|
17
|
+
import"./cli-bpd40kwt.js";
|
|
18
|
+
import"./cli-0cw9k1tw.js";
|
|
19
|
+
import"./cli-nw87xhd7.js";
|
|
20
20
|
import"./cli-8rxa073f.js";
|
|
21
21
|
export {
|
|
22
22
|
buildPentestSystemPrompt,
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import {
|
|
2
|
+
CodeAgent
|
|
3
|
+
} from "./cli-crbamax1.js";
|
|
4
|
+
import"./cli-9fsre5pt.js";
|
|
5
|
+
import"./cli-ez994rr8.js";
|
|
6
|
+
import"./cli-tzaxpbx8.js";
|
|
7
|
+
import"./cli-5b7x19aa.js";
|
|
8
|
+
import"./cli-c8131c4q.js";
|
|
9
|
+
import"./cli-kpabqavj.js";
|
|
10
|
+
import"./cli-mg5hqzfk.js";
|
|
11
|
+
import"./cli-3k1x5rn3.js";
|
|
12
|
+
import"./cli-gpnb45ck.js";
|
|
13
|
+
import"./cli-bpd40kwt.js";
|
|
14
|
+
import"./cli-0cw9k1tw.js";
|
|
15
|
+
import"./cli-nw87xhd7.js";
|
|
16
|
+
import"./cli-8rxa073f.js";
|
|
17
|
+
export {
|
|
18
|
+
CodeAgent
|
|
19
|
+
};
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
import {
|
|
2
2
|
OffensiveSecurityAgent
|
|
3
|
-
} from "./cli-
|
|
3
|
+
} from "./cli-tzaxpbx8.js";
|
|
4
4
|
import {
|
|
5
5
|
detectOSAndEnhancePrompt
|
|
6
|
-
} from "./cli-
|
|
6
|
+
} from "./cli-5b7x19aa.js";
|
|
7
7
|
import"./cli-c8131c4q.js";
|
|
8
8
|
import {
|
|
9
9
|
init_dist,
|
|
10
10
|
stepCountIs
|
|
11
|
-
} from "./cli-
|
|
12
|
-
import"./cli-
|
|
11
|
+
} from "./cli-kpabqavj.js";
|
|
12
|
+
import"./cli-mg5hqzfk.js";
|
|
13
13
|
import {
|
|
14
14
|
exports_external,
|
|
15
15
|
init_zod
|
|
16
16
|
} from "./cli-3k1x5rn3.js";
|
|
17
17
|
import"./cli-gpnb45ck.js";
|
|
18
|
-
import"./cli-
|
|
19
|
-
import"./cli-
|
|
20
|
-
import"./cli-
|
|
18
|
+
import"./cli-bpd40kwt.js";
|
|
19
|
+
import"./cli-0cw9k1tw.js";
|
|
20
|
+
import"./cli-nw87xhd7.js";
|
|
21
21
|
import"./cli-8rxa073f.js";
|
|
22
22
|
|
|
23
23
|
// src/core/agents/specialized/findingJudge/agent.ts
|
|
@@ -12,27 +12,27 @@ import {
|
|
|
12
12
|
searchEndpoints,
|
|
13
13
|
updateApp,
|
|
14
14
|
updateEndpoint
|
|
15
|
-
} from "./cli-
|
|
16
|
-
import"./cli-
|
|
17
|
-
import"./cli-
|
|
18
|
-
import"./cli-
|
|
19
|
-
import"./cli-
|
|
20
|
-
import"./cli-
|
|
21
|
-
import"./cli-
|
|
22
|
-
import"./cli-
|
|
15
|
+
} from "./cli-8nmjfxpb.js";
|
|
16
|
+
import"./cli-5vskcg6x.js";
|
|
17
|
+
import"./cli-kkkxevak.js";
|
|
18
|
+
import"./cli-3m2x8w2t.js";
|
|
19
|
+
import"./cli-jz6ak250.js";
|
|
20
|
+
import"./cli-y177s333.js";
|
|
21
|
+
import"./cli-crbamax1.js";
|
|
22
|
+
import"./cli-c5e9y4f7.js";
|
|
23
23
|
import"./cli-9fsre5pt.js";
|
|
24
|
-
import"./cli-
|
|
25
|
-
import"./cli-
|
|
26
|
-
import"./cli-
|
|
24
|
+
import"./cli-ez994rr8.js";
|
|
25
|
+
import"./cli-tzaxpbx8.js";
|
|
26
|
+
import"./cli-5b7x19aa.js";
|
|
27
27
|
import"./cli-fw5r7pfj.js";
|
|
28
28
|
import"./cli-c8131c4q.js";
|
|
29
|
-
import"./cli-
|
|
30
|
-
import"./cli-
|
|
29
|
+
import"./cli-kpabqavj.js";
|
|
30
|
+
import"./cli-mg5hqzfk.js";
|
|
31
31
|
import"./cli-3k1x5rn3.js";
|
|
32
32
|
import"./cli-gpnb45ck.js";
|
|
33
|
-
import"./cli-
|
|
34
|
-
import"./cli-
|
|
35
|
-
import"./cli-
|
|
33
|
+
import"./cli-bpd40kwt.js";
|
|
34
|
+
import"./cli-0cw9k1tw.js";
|
|
35
|
+
import"./cli-nw87xhd7.js";
|
|
36
36
|
import"./cli-8rxa073f.js";
|
|
37
37
|
|
|
38
38
|
// src/cli/apps.ts
|
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
|
-
import"./cli-
|
|
3
|
-
import"./cli-
|
|
4
|
-
import"./cli-
|
|
5
|
-
import"./cli-
|
|
6
|
-
import"./cli-
|
|
7
|
-
import"./cli-
|
|
8
|
-
import"./cli-
|
|
9
|
-
import"./cli-
|
|
2
|
+
import"./cli-8nmjfxpb.js";
|
|
3
|
+
import"./cli-5vskcg6x.js";
|
|
4
|
+
import"./cli-kkkxevak.js";
|
|
5
|
+
import"./cli-3m2x8w2t.js";
|
|
6
|
+
import"./cli-jz6ak250.js";
|
|
7
|
+
import"./cli-y177s333.js";
|
|
8
|
+
import"./cli-crbamax1.js";
|
|
9
|
+
import"./cli-c5e9y4f7.js";
|
|
10
10
|
import"./cli-9fsre5pt.js";
|
|
11
|
-
import"./cli-
|
|
12
|
-
import"./cli-
|
|
13
|
-
import"./cli-
|
|
11
|
+
import"./cli-ez994rr8.js";
|
|
12
|
+
import"./cli-tzaxpbx8.js";
|
|
13
|
+
import"./cli-5b7x19aa.js";
|
|
14
14
|
import"./cli-fw5r7pfj.js";
|
|
15
15
|
import"./cli-c8131c4q.js";
|
|
16
|
-
import"./cli-
|
|
16
|
+
import"./cli-kpabqavj.js";
|
|
17
17
|
import {
|
|
18
|
+
createWorkspaceSelection,
|
|
18
19
|
disconnect,
|
|
19
20
|
fetchWorkspaces,
|
|
20
21
|
getPensarApiUrl,
|
|
@@ -24,17 +25,18 @@ import {
|
|
|
24
25
|
pollForWorkspaceCreation,
|
|
25
26
|
pollLegacyToken,
|
|
26
27
|
pollWorkOSToken,
|
|
28
|
+
pollWorkspaceSelection,
|
|
27
29
|
selectWorkspace,
|
|
28
30
|
startDeviceFlow
|
|
29
|
-
} from "./cli-
|
|
31
|
+
} from "./cli-mg5hqzfk.js";
|
|
30
32
|
import"./cli-3k1x5rn3.js";
|
|
31
33
|
import"./cli-gpnb45ck.js";
|
|
32
34
|
import {
|
|
33
35
|
config,
|
|
34
36
|
init_config
|
|
35
|
-
} from "./cli-
|
|
36
|
-
import"./cli-
|
|
37
|
-
import"./cli-
|
|
37
|
+
} from "./cli-bpd40kwt.js";
|
|
38
|
+
import"./cli-0cw9k1tw.js";
|
|
39
|
+
import"./cli-nw87xhd7.js";
|
|
38
40
|
import {
|
|
39
41
|
__require
|
|
40
42
|
} from "./cli-8rxa073f.js";
|
|
@@ -70,26 +72,16 @@ function prompt(question) {
|
|
|
70
72
|
});
|
|
71
73
|
});
|
|
72
74
|
}
|
|
73
|
-
async function
|
|
75
|
+
async function selectWorkspaceInBrowser(apiUrl, accessToken) {
|
|
76
|
+
const selection = await createWorkspaceSelection(apiUrl, accessToken);
|
|
77
|
+
openUrl(selection.selectionUrl);
|
|
74
78
|
console.log(`
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
Enter number (1-${workspaces.length}): `);
|
|
82
|
-
const index = parseInt(answer, 10) - 1;
|
|
83
|
-
if (Number.isNaN(index) || index < 0 || index >= workspaces.length) {
|
|
84
|
-
console.error("Invalid selection.");
|
|
85
|
-
process.exit(1);
|
|
86
|
-
}
|
|
87
|
-
const workspace = workspaces[index];
|
|
88
|
-
if (!workspace) {
|
|
89
|
-
console.error("Invalid selection.");
|
|
90
|
-
process.exit(1);
|
|
91
|
-
}
|
|
92
|
-
return workspace;
|
|
79
|
+
You have multiple workspaces. Choose one in your browser to continue.
|
|
80
|
+
If the browser didn't open, visit:
|
|
81
|
+
${selection.selectionUrl}
|
|
82
|
+
|
|
83
|
+
Waiting for workspace selection...`);
|
|
84
|
+
return pollWorkspaceSelection(apiUrl, accessToken, selection.selectionId);
|
|
93
85
|
}
|
|
94
86
|
async function login() {
|
|
95
87
|
const appConfig = await config.get();
|
|
@@ -187,17 +179,18 @@ If the browser didn't open, visit: ${consoleUrl}/create-workspace?redirect=/cred
|
|
|
187
179
|
console.log("Waiting for workspace creation...");
|
|
188
180
|
workspaces = await pollForWorkspaceCreation(apiUrl, accessToken);
|
|
189
181
|
}
|
|
190
|
-
let
|
|
182
|
+
let workspaceId;
|
|
191
183
|
if (workspaces.length === 1) {
|
|
192
184
|
const onlyWorkspace = workspaces[0];
|
|
193
185
|
if (!onlyWorkspace) {
|
|
194
186
|
throw new Error("No workspace available after workspace lookup");
|
|
195
187
|
}
|
|
196
|
-
|
|
188
|
+
workspaceId = onlyWorkspace.id;
|
|
197
189
|
} else {
|
|
198
|
-
|
|
190
|
+
workspaceId = await selectWorkspaceInBrowser(apiUrl, accessToken);
|
|
199
191
|
}
|
|
200
|
-
const result = await selectWorkspace(apiUrl, accessToken,
|
|
192
|
+
const result = await selectWorkspace(apiUrl, accessToken, workspaceId);
|
|
193
|
+
const workspace = result.workspace;
|
|
201
194
|
await config.update({
|
|
202
195
|
workspaceId: workspace.id,
|
|
203
196
|
workspaceSlug: workspace.slug,
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import {
|
|
2
|
+
runAuthenticationAgent
|
|
3
|
+
} from "./cli-y177s333.js";
|
|
4
|
+
import"./cli-9fsre5pt.js";
|
|
5
|
+
import"./cli-ez994rr8.js";
|
|
6
|
+
import"./cli-tzaxpbx8.js";
|
|
7
|
+
import"./cli-5b7x19aa.js";
|
|
8
|
+
import"./cli-c8131c4q.js";
|
|
9
|
+
import"./cli-kpabqavj.js";
|
|
10
|
+
import"./cli-mg5hqzfk.js";
|
|
11
|
+
import"./cli-3k1x5rn3.js";
|
|
12
|
+
import"./cli-gpnb45ck.js";
|
|
13
|
+
import"./cli-bpd40kwt.js";
|
|
14
|
+
import"./cli-0cw9k1tw.js";
|
|
15
|
+
import"./cli-nw87xhd7.js";
|
|
16
|
+
import"./cli-8rxa073f.js";
|
|
17
|
+
export {
|
|
18
|
+
runAuthenticationAgent
|
|
19
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import {
|
|
2
|
+
BlackboxAttackSurfaceAgent
|
|
3
|
+
} from "./cli-kkkxevak.js";
|
|
4
|
+
import"./cli-9fsre5pt.js";
|
|
5
|
+
import"./cli-ez994rr8.js";
|
|
6
|
+
import"./cli-tzaxpbx8.js";
|
|
7
|
+
import"./cli-5b7x19aa.js";
|
|
8
|
+
import"./cli-c8131c4q.js";
|
|
9
|
+
import"./cli-kpabqavj.js";
|
|
10
|
+
import"./cli-mg5hqzfk.js";
|
|
11
|
+
import"./cli-3k1x5rn3.js";
|
|
12
|
+
import"./cli-gpnb45ck.js";
|
|
13
|
+
import"./cli-bpd40kwt.js";
|
|
14
|
+
import"./cli-0cw9k1tw.js";
|
|
15
|
+
import"./cli-nw87xhd7.js";
|
|
16
|
+
import"./cli-8rxa073f.js";
|
|
17
|
+
export {
|
|
18
|
+
BlackboxAttackSurfaceAgent
|
|
19
|
+
};
|
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
import {
|
|
2
2
|
runPentestWorkflow
|
|
3
|
-
} from "./cli-
|
|
4
|
-
import"./cli-
|
|
5
|
-
import"./cli-
|
|
6
|
-
import"./cli-
|
|
7
|
-
import"./cli-
|
|
8
|
-
import"./cli-
|
|
3
|
+
} from "./cli-5vskcg6x.js";
|
|
4
|
+
import"./cli-kkkxevak.js";
|
|
5
|
+
import"./cli-3m2x8w2t.js";
|
|
6
|
+
import"./cli-jz6ak250.js";
|
|
7
|
+
import"./cli-crbamax1.js";
|
|
8
|
+
import"./cli-c5e9y4f7.js";
|
|
9
9
|
import"./cli-9fsre5pt.js";
|
|
10
|
-
import"./cli-
|
|
11
|
-
import"./cli-
|
|
12
|
-
import"./cli-
|
|
10
|
+
import"./cli-ez994rr8.js";
|
|
11
|
+
import"./cli-tzaxpbx8.js";
|
|
12
|
+
import"./cli-5b7x19aa.js";
|
|
13
13
|
import"./cli-fw5r7pfj.js";
|
|
14
14
|
import"./cli-c8131c4q.js";
|
|
15
|
-
import"./cli-
|
|
16
|
-
import"./cli-
|
|
15
|
+
import"./cli-kpabqavj.js";
|
|
16
|
+
import"./cli-mg5hqzfk.js";
|
|
17
17
|
import"./cli-3k1x5rn3.js";
|
|
18
18
|
import"./cli-gpnb45ck.js";
|
|
19
|
-
import"./cli-
|
|
20
|
-
import"./cli-
|
|
21
|
-
import"./cli-
|
|
19
|
+
import"./cli-bpd40kwt.js";
|
|
20
|
+
import"./cli-0cw9k1tw.js";
|
|
21
|
+
import"./cli-nw87xhd7.js";
|
|
22
22
|
import"./cli-8rxa073f.js";
|
|
23
23
|
|
|
24
24
|
// src/core/api/blackboxPentest.ts
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getCurrentVersion,
|
|
3
3
|
init_installation
|
|
4
|
-
} from "./cli-
|
|
4
|
+
} from "./cli-nw87xhd7.js";
|
|
5
5
|
import {
|
|
6
6
|
__esm
|
|
7
7
|
} from "./cli-8rxa073f.js";
|
|
@@ -38,6 +38,7 @@ function applyEnvFallbacks(parsedConfig) {
|
|
|
38
38
|
...parsedConfig,
|
|
39
39
|
responsibleUseAccepted: parsedConfig.responsibleUseAccepted ?? false,
|
|
40
40
|
defaultHeaders: parsedConfig.defaultHeaders ?? DEFAULT_CONFIG.defaultHeaders,
|
|
41
|
+
strikeMode: parsedConfig.strikeMode ?? DEFAULT_CONFIG.strikeMode,
|
|
41
42
|
surfaceIntegrationEnabled: parsedConfig.surfaceIntegrationEnabled ?? parseBoolEnv(process.env.PENSAR_SURFACE_INTEGRATION),
|
|
42
43
|
version,
|
|
43
44
|
openAiAPIKey: parsedConfig.openAiAPIKey ?? process.env.OPENAI_API_KEY,
|
|
@@ -78,7 +79,8 @@ var init_config = __esm(() => {
|
|
|
78
79
|
init_installation();
|
|
79
80
|
DEFAULT_CONFIG = {
|
|
80
81
|
responsibleUseAccepted: false,
|
|
81
|
-
defaultHeaders: { "User-Agent": "pensar-apex" }
|
|
82
|
+
defaultHeaders: { "User-Agent": "pensar-apex" },
|
|
83
|
+
strikeMode: false
|
|
82
84
|
};
|
|
83
85
|
});
|
|
84
86
|
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
EvidenceFileEntrySchema
|
|
3
|
-
} from "./cli-
|
|
3
|
+
} from "./cli-ez994rr8.js";
|
|
4
4
|
import {
|
|
5
5
|
CweEntrySchema,
|
|
6
6
|
ValidatedCweEntrySchema,
|
|
7
7
|
hasCanonicalName
|
|
8
|
-
} from "./cli-
|
|
8
|
+
} from "./cli-tzaxpbx8.js";
|
|
9
9
|
import {
|
|
10
10
|
exports_external,
|
|
11
11
|
init_zod
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import {
|
|
2
2
|
BlackboxAttackSurfaceAgent
|
|
3
|
-
} from "./cli-
|
|
3
|
+
} from "./cli-kkkxevak.js";
|
|
4
4
|
import {
|
|
5
5
|
REPORT_FILENAME_JSON,
|
|
6
6
|
REPORT_FILENAME_MD,
|
|
7
7
|
buildPentestReport,
|
|
8
8
|
renderJson,
|
|
9
9
|
renderMarkdown
|
|
10
|
-
} from "./cli-
|
|
10
|
+
} from "./cli-3m2x8w2t.js";
|
|
11
11
|
import {
|
|
12
12
|
TargetedPentestAgent,
|
|
13
13
|
buildPentestSystemPrompt
|
|
14
|
-
} from "./cli-
|
|
14
|
+
} from "./cli-jz6ak250.js";
|
|
15
15
|
import {
|
|
16
16
|
CodeAgent
|
|
17
|
-
} from "./cli-
|
|
17
|
+
} from "./cli-crbamax1.js";
|
|
18
18
|
import {
|
|
19
19
|
AppsDiscoveryResultSchema,
|
|
20
20
|
DiscoverySummarySchema,
|
|
@@ -22,7 +22,7 @@ import {
|
|
|
22
22
|
WHITEBOX_APPS_DISCOVERY_SYSTEM_PROMPT,
|
|
23
23
|
WHITEBOX_DISCOVERY_SYSTEM_PROMPT,
|
|
24
24
|
WHITEBOX_ENDPOINT_DOCUMENTATION_SYSTEM_PROMPT
|
|
25
|
-
} from "./cli-
|
|
25
|
+
} from "./cli-c5e9y4f7.js";
|
|
26
26
|
import {
|
|
27
27
|
FindingsRegistry,
|
|
28
28
|
OffensiveSecurityAgent,
|
|
@@ -31,7 +31,7 @@ import {
|
|
|
31
31
|
pLimit,
|
|
32
32
|
runWithBoundedConcurrency,
|
|
33
33
|
toGrpcPentestContext
|
|
34
|
-
} from "./cli-
|
|
34
|
+
} from "./cli-tzaxpbx8.js";
|
|
35
35
|
import {
|
|
36
36
|
createThreatModelPrompt
|
|
37
37
|
} from "./cli-fw5r7pfj.js";
|
|
@@ -45,7 +45,7 @@ import {
|
|
|
45
45
|
init_structured,
|
|
46
46
|
newSessionId,
|
|
47
47
|
scopedLogger
|
|
48
|
-
} from "./cli-
|
|
48
|
+
} from "./cli-kpabqavj.js";
|
|
49
49
|
import {
|
|
50
50
|
__require
|
|
51
51
|
} from "./cli-8rxa073f.js";
|
|
@@ -7786,7 +7786,7 @@ async function runPentestSwarm(input) {
|
|
|
7786
7786
|
}
|
|
7787
7787
|
async function runPentestWorkflow(input) {
|
|
7788
7788
|
if (input.fastStrike) {
|
|
7789
|
-
const { runFastStrike } = await import("./fastStrike-
|
|
7789
|
+
const { runFastStrike } = await import("./fastStrike-r2nnp14k.js");
|
|
7790
7790
|
return runFastStrike(input);
|
|
7791
7791
|
}
|
|
7792
7792
|
const {
|
|
@@ -4,19 +4,19 @@ import {
|
|
|
4
4
|
OffensiveSecurityAgent,
|
|
5
5
|
SKILL_TOOL_NAMES,
|
|
6
6
|
buildBaseSystemPrompt
|
|
7
|
-
} from "./cli-
|
|
7
|
+
} from "./cli-tzaxpbx8.js";
|
|
8
8
|
import {
|
|
9
9
|
init_dist,
|
|
10
10
|
init_session,
|
|
11
11
|
sessions,
|
|
12
12
|
stepCountIs
|
|
13
|
-
} from "./cli-
|
|
13
|
+
} from "./cli-kpabqavj.js";
|
|
14
14
|
import {
|
|
15
15
|
ensureValidToken,
|
|
16
16
|
getPensarApiUrl,
|
|
17
17
|
init_auth,
|
|
18
18
|
init_constants
|
|
19
|
-
} from "./cli-
|
|
19
|
+
} from "./cli-mg5hqzfk.js";
|
|
20
20
|
import {
|
|
21
21
|
exports_external,
|
|
22
22
|
init_zod
|
|
@@ -24,7 +24,7 @@ import {
|
|
|
24
24
|
import {
|
|
25
25
|
config,
|
|
26
26
|
init_config
|
|
27
|
-
} from "./cli-
|
|
27
|
+
} from "./cli-bpd40kwt.js";
|
|
28
28
|
import {
|
|
29
29
|
__commonJS,
|
|
30
30
|
__require
|
|
@@ -7135,6 +7135,12 @@ async function updateIssue(issueId, data) {
|
|
|
7135
7135
|
async function retestIssue(issueId) {
|
|
7136
7136
|
return apiRequest("POST", `/issues/${issueId}/retest`);
|
|
7137
7137
|
}
|
|
7138
|
+
async function linkPullRequest(issueId, url) {
|
|
7139
|
+
return apiRequest("POST", `/issues/${issueId}/pull-requests`, { url });
|
|
7140
|
+
}
|
|
7141
|
+
async function listIssuePullRequests(issueId) {
|
|
7142
|
+
return apiRequest("GET", `/issues/${issueId}/pull-requests`);
|
|
7143
|
+
}
|
|
7138
7144
|
async function listFixes(issueId) {
|
|
7139
7145
|
return apiRequest("GET", `/issues/${issueId}/fixes`);
|
|
7140
7146
|
}
|
|
@@ -7322,46 +7328,60 @@ async function runOffensiveSecurityAgent(input) {
|
|
|
7322
7328
|
return { streamResult: agent.streamResult, session: agent.session };
|
|
7323
7329
|
}
|
|
7324
7330
|
// src/core/agents/specialized/patching/prompts.ts
|
|
7325
|
-
var PREAMBLE2 = `You are an expert security vulnerability patching agent. Your goal is to analyze security vulnerabilities,
|
|
7331
|
+
var PREAMBLE2 = `You are an expert security vulnerability patching agent — an autonomous coding agent specialized in fixing security issues. Your goal is to analyze security vulnerabilities, apply high-quality fixes, verify they don't break existing functionality, and return structured PR metadata.`;
|
|
7326
7332
|
var ORIENT_STEP = `1. **Orient Yourself**:
|
|
7327
7333
|
- Review the AGENTS.md / project documentation provided in your prompt for build, lint, and test commands
|
|
7328
|
-
- Use list_files to explore the repository structure
|
|
7334
|
+
- Use glob / list_files to explore the repository structure (prefer glob for pattern searches like "**/*.ts")
|
|
7329
7335
|
- Read package.json, Makefile, or equivalent to understand the project's toolchain
|
|
7330
|
-
- Identify the lint command, test command, type-check command, and any other verification scripts
|
|
7331
|
-
|
|
7336
|
+
- Identify the lint command, test command, type-check command, and any other verification scripts
|
|
7337
|
+
- Optionally call profile_codebase for a high-level map of the repo`;
|
|
7338
|
+
var TASK_STEP = `2. **Track Work with Tasks**:
|
|
7339
|
+
- Use create_task early to decompose the job into concrete steps (orient, understand, edit, verify, finalize)
|
|
7340
|
+
- Update tasks with update_task as you progress (in_progress → completed / failed)
|
|
7341
|
+
- Use list_tasks when you need to recall what's left
|
|
7342
|
+
- Keep tasks atomic — one clear outcome per task`;
|
|
7343
|
+
var UNDERSTAND_STEP = `3. **Understand the Vulnerability**:
|
|
7332
7344
|
- Carefully read the vulnerability description, CWE mappings, and any dataflow analysis provided
|
|
7333
7345
|
- Understand the root cause: What makes this code vulnerable?
|
|
7334
7346
|
- Identify the attack vector: How would an attacker exploit this?
|
|
7335
|
-
- Consider the context: What is the application trying to do
|
|
7336
|
-
|
|
7347
|
+
- Consider the context: What is the application trying to do?
|
|
7348
|
+
- Use web_search / get_page when you need framework-specific security guidance or CVE details`;
|
|
7349
|
+
var REVIEW_STEP = `4. **Review the Code**:
|
|
7337
7350
|
- Use read_file to read the vulnerable file(s) mentioned in the issue
|
|
7338
|
-
- Use grep
|
|
7351
|
+
- Use grep or run_code_query for structural searches (rg / ast-grep) across related patterns
|
|
7339
7352
|
- Review related files: imports, dependencies, configuration files
|
|
7340
7353
|
- Understand the data flow: Where does user input come from? Where does it go?`;
|
|
7341
|
-
var PLAN_STEP = `
|
|
7354
|
+
var PLAN_STEP = `5. **Plan Your Fix**:
|
|
7342
7355
|
- Identify the exact code that needs to change
|
|
7343
7356
|
- Determine the appropriate security control (input validation, parameterized queries, access control, etc.)
|
|
7344
7357
|
- Consider side effects: Will this break existing functionality?
|
|
7345
7358
|
- Think about edge cases: What other inputs or scenarios need to be handled?
|
|
7346
7359
|
- Look for framework-specific or language-specific best practices
|
|
7347
|
-
- State your complete plan clearly before making changes`;
|
|
7348
|
-
var APPLY_STEP = `
|
|
7349
|
-
-
|
|
7360
|
+
- State your complete plan clearly before making changes, and reflect it in your task list`;
|
|
7361
|
+
var APPLY_STEP = `6. **Apply the Patch**:
|
|
7362
|
+
- Prefer update_file for small, exact string replacements
|
|
7363
|
+
- Prefer apply_patch (unified diff) for multi-hunk or multi-file edits
|
|
7350
7364
|
- Use create_file if you need to add new security utilities or middleware
|
|
7365
|
+
- Use delete_file only when removing obsolete insecure code that is truly unused
|
|
7351
7366
|
- Make minimal, targeted changes — don't refactor unrelated code
|
|
7352
7367
|
- Follow the existing code style and conventions
|
|
7353
7368
|
- Ensure your changes integrate cleanly with the existing codebase`;
|
|
7354
|
-
var
|
|
7369
|
+
var GIT_STEP = `7. **Self-Check with Git**:
|
|
7370
|
+
- Use git_status to see which files changed
|
|
7371
|
+
- Use git_diff to review the exact patch before verification
|
|
7372
|
+
- Do NOT commit, push, or open a PR — the host handles that after you finalize`;
|
|
7373
|
+
var RESTART_STEP = `8. **Restart Dev Environment** (if applicable):
|
|
7355
7374
|
- Use execute_command to restart any dev servers or services so your changes are loaded
|
|
7356
7375
|
- Wait for the services to become healthy`;
|
|
7357
|
-
var VERIFY_STEP = `
|
|
7376
|
+
var VERIFY_STEP = `9. **Verify the Patch**:
|
|
7358
7377
|
- Use execute_command to run the project's lint command (e.g. \`npm run lint\`, \`ruff check\`, \`cargo clippy\`)
|
|
7359
7378
|
- Use execute_command to run the project's type-check command if applicable (e.g. \`npx tsc --noEmit\`, \`mypy\`)
|
|
7360
7379
|
- Use execute_command to run the project's test suite (e.g. \`npm test\`, \`pytest\`, \`cargo test\`)
|
|
7361
7380
|
- If a Proof of Concept (POC) is provided, run it to verify the vulnerability is fixed — the POC should FAIL (non-zero exit code) after a successful patch
|
|
7362
7381
|
- If any check fails, read the error output carefully, fix the issues, and re-run until all checks pass
|
|
7363
7382
|
- If the project has no clear lint/test commands, at minimum verify the changed files parse correctly (e.g. \`node -c file.js\`, \`python -m py_compile file.py\`)`;
|
|
7364
|
-
var FINALIZE_STEP = `
|
|
7383
|
+
var FINALIZE_STEP = `10. **Finalize**:
|
|
7384
|
+
- Mark remaining tasks completed
|
|
7365
7385
|
- Use the response tool to complete the patching process
|
|
7366
7386
|
- Provide a clear, detailed summary of:
|
|
7367
7387
|
* Each file you changed and why
|
|
@@ -7428,12 +7448,18 @@ var SECURITY_BEST_PRACTICES = `# Security Best Practices by Vulnerability Type
|
|
|
7428
7448
|
- Remove sensitive data from client-side code`;
|
|
7429
7449
|
var TOOL_USAGE2 = `# Tool Usage
|
|
7430
7450
|
|
|
7431
|
-
- **
|
|
7451
|
+
- **glob**: Find files by pattern (e.g. "**/*.ts", "**/package.json")
|
|
7452
|
+
- **list_files**: Explore directory structure
|
|
7432
7453
|
- **read_file**: Read file contents to understand code
|
|
7433
|
-
- **grep**: Search for patterns
|
|
7434
|
-
- **
|
|
7435
|
-
- **
|
|
7436
|
-
- **
|
|
7454
|
+
- **grep** / **run_code_query**: Search for patterns (run_code_query supports rg / ast-grep / comby)
|
|
7455
|
+
- **profile_codebase**: High-level codebase map when orientation is hard
|
|
7456
|
+
- **web_search** / **get_page**: Look up CVE details, framework security docs
|
|
7457
|
+
- **create_task** / **update_task** / **list_tasks**: Todo tracking for the run
|
|
7458
|
+
- **update_file**: Small exact search-and-replace edits
|
|
7459
|
+
- **apply_patch**: Multi-hunk / multi-file unified diffs
|
|
7460
|
+
- **create_file** / **delete_file**: Add or remove files when needed
|
|
7461
|
+
- **git_status** / **git_diff**: Self-check changes (do not commit/push/PR)
|
|
7462
|
+
- **execute_command**: Lint, type-check, tests, restart services, run POCs
|
|
7437
7463
|
- **response**: Complete the process with the structured patch result`;
|
|
7438
7464
|
var REQUIREMENTS = `# Critical Requirements
|
|
7439
7465
|
|
|
@@ -7445,6 +7471,7 @@ var REQUIREMENTS = `# Critical Requirements
|
|
|
7445
7471
|
6. **Test the Fix**: If a POC is provided, run it after patching. The POC should FAIL (non-zero exit code) once the vulnerability is fixed.
|
|
7446
7472
|
7. **Be Persistent**: It may take multiple iterations to get the fix right — iterate until the POC fails and tests pass.
|
|
7447
7473
|
8. **Be Complete**: Address the root cause, not just symptoms
|
|
7474
|
+
9. **Stay Autonomous**: You will not receive follow-up messages — finish the job in this run
|
|
7448
7475
|
|
|
7449
7476
|
# Important Notes
|
|
7450
7477
|
|
|
@@ -7455,17 +7482,20 @@ var REQUIREMENTS = `# Critical Requirements
|
|
|
7455
7482
|
- Follow language and framework conventions
|
|
7456
7483
|
- When multiple approaches exist, choose the most secure and idiomatic
|
|
7457
7484
|
- If a fix requires configuration changes or environment variables, note this clearly
|
|
7458
|
-
- If AGENTS.md or project docs specify particular lint/test/build commands, use those exact commands
|
|
7485
|
+
- If AGENTS.md or project docs specify particular lint/test/build commands, use those exact commands
|
|
7486
|
+
- Do not commit, push, or open a pull request — the host does that after your response`;
|
|
7459
7487
|
function buildSystemPrompt() {
|
|
7460
7488
|
return [
|
|
7461
7489
|
PREAMBLE2,
|
|
7462
7490
|
"",
|
|
7463
7491
|
"# Process",
|
|
7464
7492
|
"",
|
|
7465
|
-
"You MUST follow this
|
|
7493
|
+
"You MUST follow this autonomous coding-agent process:",
|
|
7466
7494
|
"",
|
|
7467
7495
|
ORIENT_STEP,
|
|
7468
7496
|
"",
|
|
7497
|
+
TASK_STEP,
|
|
7498
|
+
"",
|
|
7469
7499
|
UNDERSTAND_STEP,
|
|
7470
7500
|
"",
|
|
7471
7501
|
REVIEW_STEP,
|
|
@@ -7474,6 +7504,8 @@ function buildSystemPrompt() {
|
|
|
7474
7504
|
"",
|
|
7475
7505
|
APPLY_STEP,
|
|
7476
7506
|
"",
|
|
7507
|
+
GIT_STEP,
|
|
7508
|
+
"",
|
|
7477
7509
|
RESTART_STEP,
|
|
7478
7510
|
"",
|
|
7479
7511
|
VERIFY_STEP,
|
|
@@ -8307,4 +8339,4 @@ Working directory: ${input.codebasePath}`;
|
|
|
8307
8339
|
});
|
|
8308
8340
|
return { session, outputPath: input.outputPath };
|
|
8309
8341
|
}
|
|
8310
|
-
export { listApps, getApp, createApp, updateApp, deleteApp, listEndpoints, getEndpoint, createEndpoint, updateEndpoint, deleteEndpoint, searchApps, searchEndpoints, listScans, getScan, listPentestTargets, dispatchPentest, listIssues, getIssue, updateIssue, retestIssue, listFixes, getFix, listAgentLogs, searchAgentLogs, listTargetLogs, searchTargetLogs, runOffensiveSecurityAgent, buildPentestPrompt, buildThreatModelPrompt, createSkillsRegistry, runThreatModelWorkflow };
|
|
8342
|
+
export { listApps, getApp, createApp, updateApp, deleteApp, listEndpoints, getEndpoint, createEndpoint, updateEndpoint, deleteEndpoint, searchApps, searchEndpoints, listScans, getScan, listPentestTargets, dispatchPentest, listIssues, getIssue, updateIssue, retestIssue, linkPullRequest, listIssuePullRequests, listFixes, getFix, listAgentLogs, searchAgentLogs, listTargetLogs, searchTargetLogs, runOffensiveSecurityAgent, buildPentestPrompt, buildThreatModelPrompt, createSkillsRegistry, runThreatModelWorkflow };
|
|
@@ -2,11 +2,11 @@ import {
|
|
|
2
2
|
EndpointTransportEnum,
|
|
3
3
|
GrpcEndpointMetadataSchema,
|
|
4
4
|
OffensiveSecurityAgent
|
|
5
|
-
} from "./cli-
|
|
5
|
+
} from "./cli-tzaxpbx8.js";
|
|
6
6
|
import {
|
|
7
7
|
hasToolCall,
|
|
8
8
|
init_dist
|
|
9
|
-
} from "./cli-
|
|
9
|
+
} from "./cli-kpabqavj.js";
|
|
10
10
|
import {
|
|
11
11
|
exports_external,
|
|
12
12
|
init_zod,
|