@pensar/apex 2.6.1 → 2.7.0-canary.52c132f4
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-yby11zaq.js → agent-112gdg69.js} +6 -6
- package/build/agent-9bh42v64.js +13 -0
- package/build/agent-jg7v2yn0.js +13 -0
- package/build/{agent-runs-g37vkrjr.js → agent-runs-hhjzsysf.js} +18 -18
- package/build/{agent-ayreaj6z.js → agent-ydy5fq92.js} +5 -5
- package/build/{apps-xn6km9yn.js → apps-v4jc7eqb.js} +13 -13
- package/build/{auth-d105wc64.js → auth-bxkn5pcb.js} +13 -13
- package/build/{blackboxAgent-s56sgx9b.js → blackboxAgent-260yqknt.js} +6 -6
- package/build/{blackboxPentest-ps78v3w7.js → blackboxPentest-nbn588pb.js} +17 -12
- package/build/{cli-3sp6nd8d.js → cli-087apjgk.js} +2 -2
- package/build/{cli-1ve18npr.js → cli-1wtxf161.js} +3 -2
- package/build/{cli-d37a42dc.js → cli-3158x9wb.js} +101 -18
- package/build/{cli-fy6vh2a7.js → cli-35gz0ahm.js} +1 -1
- package/build/{cli-65g6rcat.js → cli-5xdefy58.js} +1 -1
- package/build/{cli-709rvekb.js → cli-6vpprmxb.js} +4 -2
- package/build/{cli-az3xq70v.js → cli-8hrdnq0e.js} +1 -1
- package/build/{cli-7eea4e2y.js → cli-ahk627k3.js} +6 -6
- package/build/{cli-c05y640n.js → cli-bc793xfp.js} +1 -1
- package/build/{cli-ae8jqxqr.js → cli-cs7hsb1w.js} +2 -2
- package/build/{cli-qgz1q9g5.js → cli-ene4g09p.js} +223 -76
- package/build/{cli-gx71jcke.js → cli-k8m6737j.js} +1 -1
- package/build/{cli-dpsw2fe6.js → cli-mm2vxyne.js} +360 -187
- package/build/{cli-ngq9dr8n.js → cli-mpmpfce6.js} +3 -3
- package/build/{cli-kb21qhvm.js → cli-np9x97h3.js} +4 -3
- package/build/{cli-k2nwxta0.js → cli-tb77javm.js} +2 -2
- package/build/{cli-xtc2t6me.js → cli-wa52mx4p.js} +103 -39
- package/build/{cli-n2en7j5b.js → cli-xe4wq07r.js} +1 -1
- package/build/cli.js +70 -40
- package/build/{config-zpqkd5cz.js → config-gpxx6m5z.js} +1 -1
- package/build/{fastStrike-mcjdvwez.js → fastStrike-v0r461wn.js} +67 -15
- package/build/{fixes-kytx5dmj.js → fixes-c51d83b4.js} +13 -13
- package/build/{index-qv4cc65p.js → index-269a90mm.js} +13 -13
- package/build/{index-wqetp6gq.js → index-3ggmqh6x.js} +12 -7
- package/build/{index-4vqdgb42.js → index-e97991ve.js} +1473 -1217
- package/build/{index-n65z6v7b.js → index-ffay4gb2.js} +6 -6
- package/build/{index-ns4m4s01.js → index-gw6t92t5.js} +4 -4
- package/build/{index-dr3tg1w3.js → index-kkt51z6t.js} +1 -1
- package/build/{index-fv64eb32.js → index-kmaq2ym2.js} +2 -2
- package/build/{index-je6hcsqr.js → index-wgas3zgb.js} +1 -1
- package/build/{index-r9yjkfrv.js → index-xfqh0wte.js} +4 -4
- package/build/{issues-eb3q9d3a.js → issues-sq3zya6y.js} +13 -13
- package/build/{knowledge-fqsvtx0f.js → knowledge-kzd0cgcm.js} +13 -13
- package/build/lib/{chunk-r4j8ybn9.js → chunk-0parq6kp.js} +87 -36
- package/build/lib/{chunk-v3dk9j7k.js → chunk-2rcfbtpx.js} +80 -21
- package/build/lib/{chunk-acgbyf5h.js → chunk-5axh2ztr.js} +3 -2
- package/build/lib/{chunk-yrnrbjes.js → chunk-5qdc4rc6.js} +4 -2
- package/build/lib/{chunk-xhdpgpkm.js → chunk-61pnyq94.js} +2 -2
- package/build/lib/{chunk-1azdancq.js → chunk-7p9f6cxx.js} +1 -1
- package/build/lib/{chunk-z137x08b.js → chunk-7sexq62c.js} +7 -5
- package/build/lib/{chunk-ba41jh41.js → chunk-7zayxxn6.js} +304 -129
- package/build/lib/{chunk-3c00n0cy.js → chunk-83nets1m.js} +8 -3
- package/build/lib/{chunk-e8yy2k73.js → chunk-ajfd3s37.js} +28 -2
- package/build/lib/{chunk-4hwzqthr.js → chunk-ay1fx18z.js} +3 -2
- package/build/lib/{chunk-1fy8azee.js → chunk-bgnq735r.js} +1 -1
- package/build/lib/{chunk-mg03jdmt.js → chunk-eaanxcjj.js} +1 -1
- package/build/lib/{chunk-w66ce82a.js → chunk-f28sa6x2.js} +4 -2
- package/build/lib/{chunk-z96pbjhd.js → chunk-f6xde44n.js} +13 -6
- package/build/lib/{chunk-1jvwqnem.js → chunk-fvgehnst.js} +104 -40
- package/build/lib/{chunk-2qsq76xq.js → chunk-fy2a1dm3.js} +128 -34
- package/build/lib/{chunk-7pwa92rn.js → chunk-jqy0ftnp.js} +1 -1
- package/build/lib/{chunk-bb0ekhkw.js → chunk-k6erk6fv.js} +69 -18
- package/build/lib/{chunk-9tt2021m.js → chunk-s338j54x.js} +9 -9
- package/build/lib/{chunk-1yct6cra.js → chunk-se6sk7e4.js} +1 -1
- package/build/lib/{chunk-nhfax4gb.js → chunk-tdprhz5x.js} +1 -1
- package/build/lib/{chunk-r2dkp4tb.js → chunk-wbt03786.js} +1 -1
- package/build/lib/{chunk-9yksqgzr.js → chunk-yk43cvgb.js} +20 -13
- package/build/lib/core/agents/agentRuntime.d.ts +2 -1
- package/build/lib/core/agents/defineAgent.d.ts +3 -2
- package/build/lib/core/agents/offSecAgent/index.d.ts +3 -1
- package/build/lib/core/agents/offSecAgent/index.js +10 -8
- package/build/lib/core/agents/offSecAgent/prompt.d.ts +3 -1
- package/build/lib/core/agents/offSecAgent/subagentSpawner.d.ts +2 -1
- package/build/lib/core/agents/offSecAgent/subagentSpawner.js +5 -5
- package/build/lib/core/agents/offSecAgent/tools/index.js +4 -4
- package/build/lib/core/agents/offSecAgent/tools/listMemories.d.ts +11 -1
- package/build/lib/core/agents/offSecAgent/tools/reportError.d.ts +2 -1
- package/build/lib/core/agents/offSecAgent/tools/runPentestWorkflow.d.ts +20 -1
- package/build/lib/core/agents/offSecAgent/tools/spawnPentestAgent.d.ts +4 -7
- package/build/lib/core/agents/offSecAgent/tools/spawnPentestSwarm.d.ts +7 -1
- package/build/lib/core/agents/offSecAgent/tools/types.d.ts +2 -1
- package/build/lib/core/agents/offSecAgent/types.d.ts +7 -1
- package/build/lib/core/agents/specialized/attackSurface/blackboxAgent.js +9 -9
- package/build/lib/core/agents/specialized/attackSurface/schemas.js +9 -9
- package/build/lib/core/agents/specialized/authenticationAgent/index.js +10 -10
- package/build/lib/core/agents/specialized/codeAgent/agent.js +9 -9
- package/build/lib/core/agents/specialized/codeAgent/prompts.d.ts +1 -0
- package/build/lib/core/agents/specialized/findingJudge/agent.js +8 -8
- package/build/lib/core/agents/specialized/findingJudge/index.js +3 -3
- package/build/lib/core/agents/specialized/patching/index.js +10 -10
- package/build/lib/core/agents/specialized/pentest/agent.d.ts +18 -4
- package/build/lib/core/agents/specialized/pentest/agent.js +11 -9
- package/build/lib/core/agents/specialized/whiteboxAttackSurface/index.js +9 -9
- package/build/lib/core/ai/ai.d.ts +23 -6
- package/build/lib/core/ai/ai.js +2 -2
- package/build/lib/core/ai/index.js +2 -2
- package/build/lib/core/ai/models/claude-capabilities.d.ts +3 -2
- package/build/lib/core/ai/models/index.d.ts +1 -1
- package/build/lib/core/ai/utils.d.ts +2 -0
- package/build/lib/core/ai/utils.js +4 -2
- package/build/lib/core/api/index.d.ts +3 -0
- package/build/lib/core/api/index.js +22 -19
- package/build/lib/core/api/targetedPentest.d.ts +1 -0
- package/build/lib/core/api/targetedPentest.js +10 -10
- package/build/lib/core/config/config.d.ts +3 -0
- package/build/lib/core/config/index.js +1 -1
- package/build/lib/core/findings/registry.js +3 -3
- package/build/lib/core/session/index.d.ts +12 -0
- package/build/lib/core/session/index.js +2 -2
- package/build/lib/core/session/persistence.d.ts +7 -0
- package/build/lib/core/session/persistence.js +7 -3
- package/build/lib/core/workflows/fastStrike.d.ts +3 -1
- package/build/lib/core/workflows/pentest.d.ts +8 -1
- package/build/lib/core/workflows/pentest.js +15 -15
- package/build/lib/core/workflows/seams.js +4 -4
- package/build/lib/core/workflows/whiteboxAttackSurface.js +11 -11
- package/build/lib/index.js +22 -22
- package/build/{logs-x62b7hk1.js → logs-yk8dk6aa.js} +13 -13
- package/build/{native-rollout-evidence-c9yhfqcs.js → native-rollout-evidence-krpdfdv7.js} +3 -3
- package/build/{offesecAgent-5whnpeta.js → offesecAgent-aw87gf37.js} +4 -4
- package/build/pentest-t0p4nw2a.js +22 -0
- package/build/{pentests-e0f32aqx.js → pentests-577n3x75.js} +13 -13
- package/build/recordedRunClient-d7947b0z.js +11 -0
- package/build/{targetedPentest-rcbs4nvp.js → targetedPentest-7v849dtm.js} +18 -11
- package/build/{targets-xj9g3q0z.js → targets-3vjxv3yj.js} +13 -13
- package/build/threatModel-n0grwkav.js +21 -0
- package/build/{uninstall-7s784q4a.js → uninstall-ctv33v8j.js} +1 -1
- package/build/{upload-4gvhwmvr.js → upload-rnec235r.js} +4 -4
- package/build/{utils-cjrz64pc.js → utils-6420gkkg.js} +3 -3
- package/package.json +1 -1
- package/src/cli.ts +48 -14
- package/src/core/agents/agentRuntime.test.ts +38 -0
- package/src/core/agents/agentRuntime.ts +5 -2
- package/src/core/agents/defineAgent.ts +3 -1
- package/src/core/agents/offSecAgent/index.ts +3 -0
- package/src/core/agents/offSecAgent/offensiveSecurityAgent.test.ts +92 -5
- package/src/core/agents/offSecAgent/offensiveSecurityAgent.ts +70 -31
- package/src/core/agents/offSecAgent/prompt.test.ts +46 -0
- package/src/core/agents/offSecAgent/prompt.ts +52 -8
- package/src/core/agents/offSecAgent/selectiveConstruction.publicPath.test.ts +38 -0
- package/src/core/agents/offSecAgent/selectiveConstruction.test.ts +64 -0
- package/src/core/agents/offSecAgent/subagentSpawner.ts +12 -1
- package/src/core/agents/offSecAgent/tools/delegateAuth.ts +1 -0
- package/src/core/agents/offSecAgent/tools/listMemories.test.ts +230 -0
- package/src/core/agents/offSecAgent/tools/listMemories.ts +73 -6
- package/src/core/agents/offSecAgent/tools/reportError.test.ts +6 -0
- package/src/core/agents/offSecAgent/tools/reportError.ts +10 -2
- package/src/core/agents/offSecAgent/tools/runAttackSurface.ts +2 -0
- package/src/core/agents/offSecAgent/tools/runPentestWorkflow.test.ts +57 -0
- package/src/core/agents/offSecAgent/tools/runPentestWorkflow.ts +19 -1
- package/src/core/agents/offSecAgent/tools/runWhiteboxScan.ts +5 -2
- package/src/core/agents/offSecAgent/tools/spawnCodingAgent.ts +1 -0
- package/src/core/agents/offSecAgent/tools/spawnPentestAgent.test.ts +72 -2
- package/src/core/agents/offSecAgent/tools/spawnPentestAgent.ts +32 -11
- package/src/core/agents/offSecAgent/tools/spawnPentestSwarm.ts +25 -5
- package/src/core/agents/offSecAgent/tools/threatModelGenerator.ts +1 -0
- package/src/core/agents/offSecAgent/tools/types.ts +6 -1
- package/src/core/agents/offSecAgent/tools/updateTask.ts +5 -1
- package/src/core/agents/offSecAgent/tools/whiteboxCandidates.ts +11 -4
- package/src/core/agents/offSecAgent/types.ts +9 -0
- package/src/core/agents/specialized/codeAgent/agent.test.ts +7 -0
- package/src/core/agents/specialized/codeAgent/agent.ts +9 -2
- package/src/core/agents/specialized/codeAgent/prompts.ts +6 -0
- package/src/core/agents/specialized/pentest/agent.test.ts +116 -0
- package/src/core/agents/specialized/pentest/agent.ts +178 -49
- package/src/core/agents/specialized/pentest/results.test.ts +59 -4
- package/src/core/agents/specialized/whiteboxAttackSurface/endpointDocumentationAgent.ts +1 -0
- package/src/core/ai/ai.operator-context.bench.test.ts +1408 -0
- package/src/core/ai/ai.recorded-context.test.ts +74 -0
- package/src/core/ai/ai.test.ts +54 -0
- package/src/core/ai/ai.ts +299 -80
- package/src/core/ai/compactionTelemetry.test.ts +2 -2
- package/src/core/ai/models/anthropic.ts +6 -0
- package/src/core/ai/models/bedrock.ts +18 -0
- package/src/core/ai/models/claude-capabilities.ts +29 -8
- package/src/core/ai/models/index.ts +4 -1
- package/src/core/ai/models/models.test.ts +23 -0
- package/src/core/ai/models/openrouter.ts +6 -0
- package/src/core/ai/providers/anthropic-models.test.ts +60 -1
- package/src/core/ai/providers/bedrock-models.test.ts +81 -0
- package/src/core/ai/providers/gateway-models.test.ts +16 -6
- package/src/core/ai/utils.native-rollout-evidence.test.ts +1 -0
- package/src/core/ai/utils.ts +189 -143
- package/src/core/api/blackboxPentest.ts +9 -1
- package/src/core/api/index.ts +9 -0
- package/src/core/api/targetedPentest.ts +19 -5
- package/src/core/config/config.test.ts +35 -0
- package/src/core/config/config.ts +5 -0
- package/src/core/observability/telemetry.test.ts +2 -3
- package/src/core/session/index.ts +5 -0
- package/src/core/session/persistence.test.ts +62 -0
- package/src/core/session/persistence.ts +56 -0
- package/src/core/workflows/fastStrike.seams.test.ts +149 -0
- package/src/core/workflows/fastStrike.test.ts +18 -1
- package/src/core/workflows/fastStrike.ts +103 -11
- package/src/core/workflows/pentest.test.ts +104 -0
- package/src/core/workflows/pentest.ts +110 -7
- package/src/core/workflows/seams.test.ts +13 -0
- package/src/core/workflows/seams.ts +5 -1
- package/src/core/workflows/whiteboxAttackSurface.ts +1 -0
- package/src/tui/components/chat/loading-indicator.tsx +20 -4
- package/src/tui/components/chat/message-list.tsx +1 -0
- package/src/tui/components/commands/__tests__/advanced-settings-lifecycle.tsx +176 -0
- package/src/tui/components/commands/advanced-settings.test.ts +28 -0
- package/src/tui/components/commands/advanced-settings.tsx +237 -19
- package/src/tui/components/operator-dashboard/index.tsx +46 -9
- package/src/tui/components/operator-dashboard/logic.test.ts +106 -0
- package/src/tui/components/operator-dashboard/logic.ts +42 -2
- package/src/tui/components/operator-dashboard/run-events.test.ts +3 -1
- package/src/tui/components/shared/__tests__/tool-renderer-lifecycle.tsx +18 -0
- package/src/tui/components/shared/action-label.test.ts +9 -0
- package/src/tui/components/shared/compacting-icon.tsx +18 -0
- package/src/tui/components/shared/index.ts +1 -0
- package/src/tui/components/shared/tool-registry.ts +1 -0
- package/src/tui/components/shared/tool-renderer.tsx +21 -7
- package/src/tui/context/route.tsx +1 -0
- package/src/tui/keybindings/registry.ts +2 -0
- package/build/agent-6w7egcf1.js +0 -13
- package/build/agent-9zx75feh.js +0 -13
- package/build/pentest-e61hc38s.js +0 -22
- package/build/recordedRunClient-dp032c32.js +0 -11
- package/build/threatModel-jkxfa40s.js +0 -21
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
EndpointTransportEnum,
|
|
3
3
|
GrpcEndpointMetadataSchema
|
|
4
|
-
} from "./cli-
|
|
4
|
+
} from "./cli-ene4g09p.js";
|
|
5
5
|
import {
|
|
6
6
|
AgentRuntime,
|
|
7
7
|
defineAgent
|
|
8
|
-
} from "./cli-
|
|
8
|
+
} from "./cli-1wtxf161.js";
|
|
9
9
|
import {
|
|
10
10
|
stepCountIs2,
|
|
11
11
|
init_dist
|
|
12
|
-
} from "./cli-
|
|
12
|
+
} from "./cli-mm2vxyne.js";
|
|
13
13
|
import {
|
|
14
14
|
tool
|
|
15
15
|
} from "./cli-pwm29ks7.js";
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
AgentRuntime,
|
|
3
3
|
defineAgent
|
|
4
|
-
} from "./cli-
|
|
4
|
+
} from "./cli-1wtxf161.js";
|
|
5
5
|
import {
|
|
6
6
|
stepCountIs2,
|
|
7
7
|
init_dist
|
|
8
|
-
} from "./cli-
|
|
8
|
+
} from "./cli-mm2vxyne.js";
|
|
9
9
|
|
|
10
10
|
// src/core/agents/specialized/codeAgent/agent.ts
|
|
11
11
|
init_dist();
|
|
@@ -59,6 +59,7 @@ Prefer catalog + code_query for sink-first work; use candidates to separate unve
|
|
|
59
59
|
4. **Stay focused** — stick to your objective. Don't wander into unrelated areas of the codebase.
|
|
60
60
|
5. **Be thorough** — don't stop at the first match. Make sure you've covered everything relevant to the objective.
|
|
61
61
|
`;
|
|
62
|
+
var CODE_AGENT_EXTERNAL_SYSTEM_PROMPT = CODE_AGENT_SYSTEM_PROMPT.replace("use candidates to separate unverified ideas from `document_vulnerability`", "use candidates to separate unverified ideas from evidence-backed findings returned to the caller");
|
|
62
63
|
|
|
63
64
|
// src/core/agents/specialized/codeAgent/agent.ts
|
|
64
65
|
var CODE_AGENT_TOOLS = [
|
|
@@ -87,7 +88,7 @@ function codeAgentDefinition() {
|
|
|
87
88
|
return defineAgent({
|
|
88
89
|
name: "code-agent",
|
|
89
90
|
role: "worker",
|
|
90
|
-
system: (opts) => opts.system ?? CODE_AGENT_SYSTEM_PROMPT,
|
|
91
|
+
system: (opts) => opts.system ?? (opts.findingPolicy === "external" ? CODE_AGENT_EXTERNAL_SYSTEM_PROMPT : CODE_AGENT_SYSTEM_PROMPT),
|
|
91
92
|
activeTools: (opts) => {
|
|
92
93
|
let activeTools = [...CODE_AGENT_TOOLS];
|
|
93
94
|
if (opts.excludeTools?.length) {
|
|
@@ -4,12 +4,12 @@ import {
|
|
|
4
4
|
import {
|
|
5
5
|
AgentRuntime,
|
|
6
6
|
defineAgent
|
|
7
|
-
} from "./cli-
|
|
7
|
+
} from "./cli-1wtxf161.js";
|
|
8
8
|
import {
|
|
9
9
|
stepCountIs2,
|
|
10
10
|
hasToolCall,
|
|
11
11
|
init_dist
|
|
12
|
-
} from "./cli-
|
|
12
|
+
} from "./cli-mm2vxyne.js";
|
|
13
13
|
|
|
14
14
|
// src/core/agents/specialized/attackSurface/blackboxAgent.ts
|
|
15
15
|
init_dist();
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
REPORT_ERROR_TOOL_NAME,
|
|
8
8
|
createReportErrorTool,
|
|
9
9
|
PentestReportedError
|
|
10
|
-
} from "./cli-
|
|
10
|
+
} from "./cli-ene4g09p.js";
|
|
11
11
|
import {
|
|
12
12
|
GOOGLE_SIGNIN_PROMPT_GUIDANCE,
|
|
13
13
|
browserEngineForGoogleSignIn
|
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
import {
|
|
19
19
|
AgentRuntime,
|
|
20
20
|
defineAgent
|
|
21
|
-
} from "./cli-
|
|
21
|
+
} from "./cli-1wtxf161.js";
|
|
22
22
|
import {
|
|
23
23
|
hasToolCall,
|
|
24
24
|
init_dist,
|
|
@@ -26,7 +26,7 @@ import {
|
|
|
26
26
|
init_lazyLogger,
|
|
27
27
|
createLogger,
|
|
28
28
|
init_structured
|
|
29
|
-
} from "./cli-
|
|
29
|
+
} from "./cli-mm2vxyne.js";
|
|
30
30
|
import {
|
|
31
31
|
init_zod
|
|
32
32
|
} from "./cli-3qznjsnr.js";
|
|
@@ -78,6 +78,13 @@ var PentestResponseSchema = object({
|
|
|
78
78
|
newObjectives: array(string()).optional().describe("Objectives for the NEXT run of this endpoint. Populate this directly from everything you observed: worker outcomes, what was confirmed or conclusively ruled out, recon anomalies nobody investigated, and the technology you fingerprinted. Each entry must be a focused, self-contained objective the next run can act on directly — name a concrete attack class against a concrete parameter, header, or flow. Do NOT restate anything tested this run or already marked completed in your assignment context; find the coverage gaps. Emit a small, high-signal set (typically 2-6), preferring breadth across distinct untested attack classes over payload variants. Empty/omitted when the endpoint is genuinely exhausted."),
|
|
79
79
|
noFindingsReason: string().optional().describe("If no findings were documented, explain why (e.g., target not vulnerable, endpoint unreachable)")
|
|
80
80
|
});
|
|
81
|
+
var PentestExternalResponseSchema = PentestResponseSchema.omit({
|
|
82
|
+
findingsDocumented: true
|
|
83
|
+
}).extend({
|
|
84
|
+
objectiveResults: array(ObjectiveResultSchema).describe("Status of each assigned objective, including findings or limitations."),
|
|
85
|
+
reportedFindings: array(string()).describe("One concise evidence-backed finding per vulnerability, including the affected target and security impact. An empty array is valid."),
|
|
86
|
+
noFindingsReason: string().optional().describe("If no findings are reported, explain why.")
|
|
87
|
+
});
|
|
81
88
|
function resolvePentestBrowserEngine(hasGoogleSignIn) {
|
|
82
89
|
return browserEngineForGoogleSignIn(hasGoogleSignIn);
|
|
83
90
|
}
|
|
@@ -95,55 +102,67 @@ var targetedPentestWorker = defineAgent({
|
|
|
95
102
|
helperWorkspaceRoot: effectiveRole === "worker" ? pentestHelperWorkspaceRoot(opts.session, opts.subagentId, opts.sandbox?.type) : undefined
|
|
96
103
|
};
|
|
97
104
|
},
|
|
98
|
-
system: (opts, state) => buildPentestSystemPrompt2(opts.session, state.effectiveRole, state.mode, opts.systemScope, state.helperWorkspaceRoot),
|
|
105
|
+
system: (opts, state) => buildPentestSystemPrompt2(opts.session, state.effectiveRole, state.mode, opts.systemScope, state.helperWorkspaceRoot, opts.findingPolicy),
|
|
99
106
|
fileWorkspaceRoot: (_opts, state) => state.helperWorkspaceRoot,
|
|
100
107
|
grpc: (opts) => opts.grpc,
|
|
101
108
|
browserEngine: (opts) => resolvePentestBrowserEngine(opts.session.credentialManager?.hasGoogleSignIn() === true),
|
|
102
109
|
target: (opts) => opts.target,
|
|
103
110
|
systemScope: (opts) => opts.systemScope,
|
|
104
111
|
mode: (_opts, state) => state.mode,
|
|
105
|
-
activeTools: (opts, state) => buildPentestActiveTools(state.effectiveRole, opts.session),
|
|
106
|
-
responseSchema: () => PentestResponseSchema,
|
|
107
|
-
prompt: (opts, state) => buildPentestPrompt(opts.target, opts.objectives, opts.session, opts.findingsRegistry, opts.context, opts.environmentVariables ? Object.keys(opts.environmentVariables) : undefined, opts.subagentId, state.effectiveRole, opts.session.credentialManager?.formatForPrompt(), opts.grpc, state.mode),
|
|
108
|
-
extraTools: (
|
|
112
|
+
activeTools: (opts, state) => buildPentestActiveTools(state.effectiveRole, opts.session, opts.findingPolicy),
|
|
113
|
+
responseSchema: (opts) => opts.findingPolicy === "external" ? PentestExternalResponseSchema : PentestResponseSchema,
|
|
114
|
+
prompt: (opts, state) => buildPentestPrompt(opts.target, opts.objectives, opts.session, opts.findingsRegistry, opts.context, opts.environmentVariables ? Object.keys(opts.environmentVariables) : undefined, opts.subagentId, state.effectiveRole, opts.session.credentialManager?.formatForPrompt(), opts.grpc, state.mode, opts.findingPolicy),
|
|
115
|
+
extraTools: (opts, state) => ({
|
|
109
116
|
[REPORT_ERROR_TOOL_NAME]: createReportErrorTool((err) => {
|
|
110
117
|
state.reportedError = err;
|
|
111
|
-
})
|
|
118
|
+
}, opts.findingPolicy)
|
|
112
119
|
}),
|
|
113
120
|
stopWhen: () => hasToolCall(REPORT_ERROR_TOOL_NAME),
|
|
114
|
-
resolveResult: async (opts, state, streamResult) => {
|
|
121
|
+
resolveResult: async (opts, state, streamResult, validatedResponse) => {
|
|
115
122
|
if (state.reportedError) {
|
|
116
123
|
throw new PentestReportedError(state.reportedError);
|
|
117
124
|
}
|
|
118
125
|
let objectiveResults;
|
|
119
126
|
let newObjectives;
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
127
|
+
let reportedFindings;
|
|
128
|
+
if (opts.findingPolicy === "external") {
|
|
129
|
+
const parsed = PentestExternalResponseSchema.safeParse(validatedResponse);
|
|
130
|
+
if (!parsed.success) {
|
|
131
|
+
throw new Error("Externally graded pentest ended without a structured findings response");
|
|
132
|
+
}
|
|
133
|
+
objectiveResults = parsed.data.objectiveResults;
|
|
134
|
+
newObjectives = parsed.data.newObjectives;
|
|
135
|
+
reportedFindings = parsed.data.reportedFindings;
|
|
136
|
+
} else {
|
|
137
|
+
try {
|
|
138
|
+
const response = await streamResult.response;
|
|
139
|
+
for (const msg of response.messages ?? []) {
|
|
140
|
+
if (msg.role !== "assistant" || !Array.isArray(msg.content))
|
|
141
|
+
continue;
|
|
142
|
+
for (const part of msg.content) {
|
|
143
|
+
if (part.type === "tool-call" && part.toolName === "response" && part.input) {
|
|
144
|
+
const input = part.input;
|
|
145
|
+
if (input.result?.objectiveResults) {
|
|
146
|
+
objectiveResults = input.result.objectiveResults;
|
|
147
|
+
}
|
|
148
|
+
if (input.result?.newObjectives) {
|
|
149
|
+
newObjectives = input.result.newObjectives;
|
|
150
|
+
}
|
|
133
151
|
}
|
|
134
152
|
}
|
|
135
153
|
}
|
|
136
|
-
}
|
|
137
|
-
}
|
|
154
|
+
} catch {}
|
|
155
|
+
}
|
|
138
156
|
const sandboxed = opts.backends?.sandboxed === true;
|
|
139
157
|
const findingsPath = sandboxed ? `${SANDBOX_ARTIFACTS_ROOT}/findings` : opts.session.findingsPath;
|
|
140
|
-
const findings = sandboxed && opts.backends ? await loadSandboxFindings(opts.backends, findingsPath, opts.abortSignal) : loadFindings(findingsPath);
|
|
158
|
+
const findings = opts.findingPolicy === "external" ? [] : sandboxed && opts.backends ? await loadSandboxFindings(opts.backends, findingsPath, opts.abortSignal) : loadFindings(findingsPath);
|
|
141
159
|
return {
|
|
142
160
|
findings,
|
|
143
161
|
findingsPath,
|
|
144
162
|
pocsPath: sandboxed ? `${SANDBOX_ARTIFACTS_ROOT}/pocs` : opts.session.pocsPath,
|
|
145
163
|
objectiveResults,
|
|
146
|
-
newObjectives
|
|
164
|
+
newObjectives,
|
|
165
|
+
reportedFindings
|
|
147
166
|
};
|
|
148
167
|
}
|
|
149
168
|
});
|
|
@@ -511,14 +530,16 @@ ${SECTION_SECURITY_HEADERS_CORS}
|
|
|
511
530
|
${SECTION_FINDING_QUALITY}
|
|
512
531
|
|
|
513
532
|
${SECTION_STATE_CHECKPOINTING}`;
|
|
514
|
-
function destructiveSection(allow) {
|
|
515
|
-
|
|
533
|
+
function destructiveSection(allow, findingPolicy = "native") {
|
|
534
|
+
if (allow)
|
|
535
|
+
return SECTION_DESTRUCTIVE_ALLOWED;
|
|
536
|
+
return findingPolicy === "external" ? SECTION_DESTRUCTIVE_BLOCKED.replace(" and document_vulnerability", "") : SECTION_DESTRUCTIVE_BLOCKED;
|
|
516
537
|
}
|
|
517
538
|
function rateLimitTestingSection(allow) {
|
|
518
539
|
return allow ? SECTION_RATE_LIMITING_TESTING_ALLOWED : SECTION_RATE_LIMITING_TESTING_BLOCKED;
|
|
519
540
|
}
|
|
520
|
-
function buildPentestSystemPrompt2(session, role = "orchestrator", mode = "default", systemScope, helperWorkspaceRoot) {
|
|
521
|
-
const destructive = destructiveSection(session.config?.allowDestructiveActions);
|
|
541
|
+
function buildPentestSystemPrompt2(session, role = "orchestrator", mode = "default", systemScope, helperWorkspaceRoot, findingPolicy = "native") {
|
|
542
|
+
const destructive = destructiveSection(session.config?.allowDestructiveActions, findingPolicy);
|
|
522
543
|
const rateLimitTesting = rateLimitTestingSection(session.config?.allowRateLimitTesting);
|
|
523
544
|
const guardrails = `${destructive}
|
|
524
545
|
|
|
@@ -527,11 +548,42 @@ ${rateLimitTesting}
|
|
|
527
548
|
${SECTION_SIDE_EFFECT_SAFETY}`;
|
|
528
549
|
const systemSection = systemScope && systemScope.memberHosts.length > 0 ? `
|
|
529
550
|
|
|
530
|
-
${SECTION_SYSTEM_SCOPE(systemScope.memberHosts)}` : "";
|
|
551
|
+
${SECTION_SYSTEM_SCOPE(systemScope.memberHosts, findingPolicy)}` : "";
|
|
531
552
|
const sourceRoot = mode === "fast-strike" ? session.config?.codebasePath : undefined;
|
|
532
553
|
const helperToolsSection = role === "orchestrator" && mode !== "fast-strike" ? "" : `
|
|
533
554
|
|
|
534
555
|
${SECTION_HELPER_FILE_WORKSPACE(helperWorkspaceRoot ?? session.scratchpadPath, Boolean(sourceRoot))}`;
|
|
556
|
+
if (findingPolicy === "external") {
|
|
557
|
+
const sourcePolicy = sourceRoot ? `Read-only Source Access:
|
|
558
|
+
- The configured repository at ${sourceRoot} is in scope for read-only analysis. Use source-assessment tools or execute_command to inspect it. Keep generated helpers in the file workspace; do not modify target source.` : SECTION_SOURCE_CODE_PROHIBITION;
|
|
559
|
+
const roleMethod = mode === "fast-strike" ? `Run a focused Strike assessment against the supplied target. Work alone: observe, form the strongest hypothesis, test it with the available HTTP, browser, source, and command tools, then move to the next lead only when evidence rules the first out. Use editable scripts for stateful or multi-stage work. Do not spawn agents or create task lists.` : role === "orchestrator" ? `Lead a focused assessment. State a short plan, perform light reconnaissance and any needed authentication, then call spawn_pentest_agent for each assigned objective that needs testing. Investigate chains or untested leads with another worker when the objective calls for it. For detection-only work, stop when the requested evidence is sufficient. Combine the workers' findings and objective results in your response; workers do not write to a shared finding registry in this run.` : session.config?.taskDriven ? `Test each assigned objective. Decompose techniques with create_task, update each task as you test, adapt when a lead fails, and use list_tasks to check coverage before finishing.` : `Test each assigned objective with the strongest available techniques. Verify reachability and authentication, inspect source when explicitly in scope, probe plausible weaknesses, and distinguish genuine security impact from benign behavior.`;
|
|
560
|
+
const authentication = SECTION_AUTHENTICATION.replace("Build verifiable POCs, but bound the blast radius.", "When the assigned objective requires a live proof, bound the blast radius.");
|
|
561
|
+
const exfilGoal = session.config?.exfilMode ? `
|
|
562
|
+
|
|
563
|
+
Exfiltration goal: Locate and extract a flag in the format FLAG{...} or the assigned sensitive data. Pivot through a confirmed vulnerability when needed to reach it. Do not stop at discovery; demonstrate extraction before calling response.` : "";
|
|
564
|
+
return `You are an expert offensive security agent. ${roleMethod}
|
|
565
|
+
${exfilGoal}
|
|
566
|
+
|
|
567
|
+
${sourcePolicy}
|
|
568
|
+
|
|
569
|
+
Finding boundary: The caller evaluates findings after this run. Put every credible vulnerability in the response tool's reportedFindings array with its affected target, observed evidence, and likely impact. For detection-only objectives, do not build a separate proof-of-concept script, seek a second in-run review, or continue exploiting once the requested evidence is sufficient. If the objective requires exploitation or extraction, pursue that objective fully.
|
|
570
|
+
|
|
571
|
+
Use the browser for interactive or authenticated flows, HTTP tools for direct probes, and the shell for scripts or source analysis. Stay within the supplied scope and report uncertainty honestly. Complete every assigned objective before calling response.
|
|
572
|
+
|
|
573
|
+
${guardrails}${systemSection}${helperToolsSection}
|
|
574
|
+
|
|
575
|
+
${authentication}
|
|
576
|
+
|
|
577
|
+
${SECTION_MATERIALITY_GUIDANCE}
|
|
578
|
+
|
|
579
|
+
${SECTION_CREDENTIAL_DISCOVERY}
|
|
580
|
+
|
|
581
|
+
${SECTION_SECURITY_HEADERS_CORS}
|
|
582
|
+
|
|
583
|
+
${SECTION_STATE_CHECKPOINTING}${session.config?.promptInjectionLibrarySource ? `
|
|
584
|
+
|
|
585
|
+
${SECTION_PROMPT_INJECTION}` : ""}`;
|
|
586
|
+
}
|
|
535
587
|
if (mode === "fast-strike") {
|
|
536
588
|
const sourcePolicy = sourceRoot ? `Read-only Source Access:
|
|
537
589
|
- The configured repository at ${sourceRoot} is in scope for read-only analysis. Use available source-assessment tools or execute_command to inspect it.
|
|
@@ -559,12 +611,12 @@ ${guardrails}${systemSection}${helperToolsSection}`;
|
|
|
559
611
|
|
|
560
612
|
${SECTION_PROMPT_INJECTION}` : withGuardrails;
|
|
561
613
|
}
|
|
562
|
-
var SECTION_SYSTEM_SCOPE = (memberHosts) => `System Scope (structured):
|
|
614
|
+
var SECTION_SYSTEM_SCOPE = (memberHosts, findingPolicy = "native") => `System Scope (structured):
|
|
563
615
|
- This engagement covers a multi-application System. Member hosts already present in session targets: ${memberHosts.join(", ")}.
|
|
564
616
|
- Declared relationships in the application context prioritize investigation order; undeclared paths between members remain in scope when discovered.
|
|
565
617
|
- For cross-service follow-ups, an orchestrator MAY set a worker \`target\` to a full URL on another member host listed above. Workers receive this same System Scope. Do not invent hosts outside that set.
|
|
566
618
|
- Authentication state is origin-specific. Before dispatching an authenticated cross-service follow-up, the orchestrator must establish and verify a session on that member origin. The worker must verify access on its assigned origin and follow the Authentication rules below if access is denied.
|
|
567
|
-
- When a confirmed finding spans multiple members, populate the
|
|
619
|
+
${findingPolicy === "external" ? "- When a finding spans multiple members, describe the ordered member-to-member path in your reported finding." : "- When a confirmed finding spans multiple members, populate the `attackPath` argument of `document_vulnerability` with the ordered member-to-member hop chain. Do not leave the chain only in the narrative."}`;
|
|
568
620
|
var SECTION_ORCHESTRATOR_DELEGATION = `Sub-Agent Delegation Rules:
|
|
569
621
|
- You DO NOT call document_vulnerability directly. Findings are documented by the workers you spawn.
|
|
570
622
|
- You DO NOT execute deep exploitation attempts yourself. Your tools (execute_command, http_request, browser_*) are for INITIAL RECON only — fingerprinting, sanity-checking the target, observing baseline behavior.
|
|
@@ -611,7 +663,7 @@ ${SECTION_MATERIALITY_GUIDANCE}
|
|
|
611
663
|
${SECTION_BROWSER_INTERACTION}
|
|
612
664
|
|
|
613
665
|
${SECTION_STATE_CHECKPOINTING}`;
|
|
614
|
-
function buildPentestPrompt(target, objectives, session, findingsRegistry, context, envVarNames, subagentId, role = "orchestrator", credentialContext, grpc, mode = "default") {
|
|
666
|
+
function buildPentestPrompt(target, objectives, session, findingsRegistry, context, envVarNames, subagentId, role = "orchestrator", credentialContext, grpc, mode = "default", findingPolicy = "native") {
|
|
615
667
|
const sessionRootPath = session.rootPath;
|
|
616
668
|
const exfilMode = session.config?.exfilMode ?? false;
|
|
617
669
|
const taskDriven = mode === "fast-strike" || role === "orchestrator" ? false : session.config?.taskDriven ?? false;
|
|
@@ -650,7 +702,7 @@ For \`http_request\`, pass these as the \`headers\` parameter.`, `For \`execute_
|
|
|
650
702
|
} catch {}
|
|
651
703
|
}
|
|
652
704
|
let knownFindingsSection = "";
|
|
653
|
-
if (findingsRegistry && findingsRegistry.size > 0) {
|
|
705
|
+
if (findingPolicy !== "external" && findingsRegistry && findingsRegistry.size > 0) {
|
|
654
706
|
const existing = findingsRegistry.getFindings().map((f) => `- [${f.severity}] ${f.title} (endpoint: ${f.endpoint})`).join(`
|
|
655
707
|
`);
|
|
656
708
|
knownFindingsSection = `
|
|
@@ -743,7 +795,19 @@ Do NOT discover or enumerate other endpoints or services. Focus exclusively on t
|
|
|
743
795
|
If your assignment lists ZERO open objectives (everything is already completed), skip steps 4-5, do light recon only, then finish — still populating newObjectives so the run is productive rather than re-testing completed objectives.
|
|
744
796
|
|
|
745
797
|
Do NOT call document_vulnerability — that is the workers' job. Do NOT discover or enumerate other endpoints or services beyond the assigned target except for cross-service follow-ups explicitly authorized by the structured System Scope.`;
|
|
746
|
-
const
|
|
798
|
+
const externalInstructions = role === "orchestrator" ? `## Instructions
|
|
799
|
+
1. State a short plan, perform light reconnaissance and authenticate if needed.
|
|
800
|
+
2. Delegate each assigned objective with spawn_pentest_agent. Follow a concrete chain or anomaly only when the assignment calls for it or the detection objective remains unmet.
|
|
801
|
+
3. Include every credible vulnerability from the workers in reportedFindings. Summarize objective coverage and any remaining leads in objectiveResults and newObjectives. The caller evaluates findings after this run.` : taskDriven ? `## Instructions
|
|
802
|
+
1. Create tasks for the supplied objectives and test them with the available tools.
|
|
803
|
+
2. Update task results as evidence develops; inspect list_tasks before finishing.
|
|
804
|
+
3. Put each credible vulnerability in reportedFindings with the affected target, evidence, and likely impact. Follow the assigned objective's discovery or exploitation boundary. The caller evaluates findings after this run.` : `## Instructions
|
|
805
|
+
1. Test the supplied objectives using the available tools and follow the strongest evidence first.
|
|
806
|
+
2. Put each credible vulnerability in reportedFindings with the affected target, evidence, and likely impact. For detection-only objectives, stop when the requested evidence is sufficient; exploit or pivot only if the objective requires it.
|
|
807
|
+
3. Finish with objectiveResults for each objective and any high-signal newObjectives. The caller evaluates findings after this run.`;
|
|
808
|
+
const instructions = findingPolicy === "external" ? `${externalInstructions}${exfilMode ? `
|
|
809
|
+
|
|
810
|
+
This is an exfiltration run: locate and extract FLAG{...} or the assigned sensitive data before finishing. Pivot through a confirmed weakness when necessary; report the result in objectiveResults without invoking a finding judge.` : ""}` : role === "orchestrator" ? orchestratorInstructions : taskDriven ? taskDrivenInstructions : exfilMode ? `## Goal
|
|
747
811
|
Your target is a flag with the format FLAG{...}. Locate and extract it.
|
|
748
812
|
|
|
749
813
|
## Instructions
|
|
@@ -870,10 +934,10 @@ var SHARED_PENTEST_TOOLS = [
|
|
|
870
934
|
"checkpoint_state"
|
|
871
935
|
];
|
|
872
936
|
var MEMORY_TOOL_NAMES = ["add_memory", "list_memories", "get_memory"];
|
|
873
|
-
function buildPentestActiveTools(role, session) {
|
|
937
|
+
function buildPentestActiveTools(role, session, findingPolicy = "native") {
|
|
874
938
|
const tools = role === "orchestrator" ? [...WORKER_RECON_TOOLS, ...SHARED_PENTEST_TOOLS, "spawn_pentest_agent"] : [
|
|
875
939
|
...WORKER_RECON_TOOLS,
|
|
876
|
-
"document_vulnerability",
|
|
940
|
+
...findingPolicy === "external" ? [] : ["document_vulnerability"],
|
|
877
941
|
...WORKER_HELPER_FILE_TOOLS,
|
|
878
942
|
...SHARED_PENTEST_TOOLS,
|
|
879
943
|
...session.config?.taskDriven ? ["create_task", "update_task", "list_tasks"] : [],
|
package/build/cli.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
2
|
// @bun
|
|
3
|
-
import"./cli-
|
|
4
|
-
import"./cli-
|
|
3
|
+
import"./cli-35gz0ahm.js";
|
|
4
|
+
import"./cli-bc793xfp.js";
|
|
5
5
|
import {
|
|
6
6
|
require_src,
|
|
7
7
|
require_src2,
|
|
@@ -27,7 +27,7 @@ import {
|
|
|
27
27
|
logger,
|
|
28
28
|
init_structured,
|
|
29
29
|
init_ai2
|
|
30
|
-
} from "./cli-
|
|
30
|
+
} from "./cli-mm2vxyne.js";
|
|
31
31
|
import {
|
|
32
32
|
init_inference_attempt,
|
|
33
33
|
init_native_rollout_evidence
|
|
@@ -40,13 +40,13 @@ import {
|
|
|
40
40
|
init_customProviders,
|
|
41
41
|
resolveHoonifyModel,
|
|
42
42
|
init_hoonify
|
|
43
|
-
} from "./cli-
|
|
43
|
+
} from "./cli-6vpprmxb.js";
|
|
44
44
|
import {
|
|
45
45
|
init_package,
|
|
46
46
|
version,
|
|
47
47
|
package_default,
|
|
48
48
|
init_installation
|
|
49
|
-
} from "./cli-
|
|
49
|
+
} from "./cli-5xdefy58.js";
|
|
50
50
|
import {
|
|
51
51
|
require_src6
|
|
52
52
|
} from "./cli-bb02pjt0.js";
|
|
@@ -725,7 +725,7 @@ var package_default2 = {
|
|
|
725
725
|
tsc: "tsc --noEmit"
|
|
726
726
|
},
|
|
727
727
|
type: "module",
|
|
728
|
-
version: "2.
|
|
728
|
+
version: "2.7.0-canary.52c132f4"
|
|
729
729
|
};
|
|
730
730
|
|
|
731
731
|
// src/core/ai/index.ts
|
|
@@ -1584,7 +1584,7 @@ async function createInstrumentedBus(session, model) {
|
|
|
1584
1584
|
reportHerdrState("working");
|
|
1585
1585
|
const bus = new AgentEventBus;
|
|
1586
1586
|
attachCliAgentStreamListeners(bus);
|
|
1587
|
-
const { attachWandbToEventBus } = await import("./upload-
|
|
1587
|
+
const { attachWandbToEventBus } = await import("./upload-rnec235r.js");
|
|
1588
1588
|
const wandbCleanup = await attachWandbToEventBus(session, bus).catch((e) => {
|
|
1589
1589
|
console.warn("[wandb] Tracing disabled:", e.message);
|
|
1590
1590
|
return null;
|
|
@@ -1604,7 +1604,7 @@ async function resolveCliHeaders() {
|
|
|
1604
1604
|
const { parseHeaderLine, parseHeadersFromFile, formatParseError } = await import("./parse-cqecqrc5.js");
|
|
1605
1605
|
const merged = {};
|
|
1606
1606
|
if (!noGlobal) {
|
|
1607
|
-
const { config: appConfig } = await import("./index-
|
|
1607
|
+
const { config: appConfig } = await import("./index-wgas3zgb.js");
|
|
1608
1608
|
const cfg = await appConfig.get();
|
|
1609
1609
|
if (cfg.defaultHeaders) {
|
|
1610
1610
|
Object.assign(merged, cfg.defaultHeaders);
|
|
@@ -1635,8 +1635,8 @@ ${formatParseError(parsed.error)}`);
|
|
|
1635
1635
|
return merged;
|
|
1636
1636
|
}
|
|
1637
1637
|
async function resolveCliModel() {
|
|
1638
|
-
const { config: appConfig } = await import("./index-
|
|
1639
|
-
const { getDefaultModelForConfig } = await import("./utils-
|
|
1638
|
+
const { config: appConfig } = await import("./index-wgas3zgb.js");
|
|
1639
|
+
const { getDefaultModelForConfig } = await import("./utils-6420gkkg.js");
|
|
1640
1640
|
const pensarConfig = await appConfig.get();
|
|
1641
1641
|
const explicit = resolveExplicitCliModel({
|
|
1642
1642
|
model: getArg("--model"),
|
|
@@ -1721,6 +1721,7 @@ pentest options:
|
|
|
1721
1721
|
--task-driven Enable task-driven architecture (experimental)
|
|
1722
1722
|
--fast-strike Single-operator fast strike: skip attack-surface/swarm
|
|
1723
1723
|
phases, one tight recon\u2192exploit loop against the target
|
|
1724
|
+
--external-findings Return findings without Apex's in-run finding judge
|
|
1724
1725
|
--prompt <text|@file> Guidance for the pentest agent (inline text or @filepath)
|
|
1725
1726
|
--threat-model <text|@file> Threat model to guide the pentest (inline or @filepath)
|
|
1726
1727
|
--header "Name: Value" Custom HTTP header (repeatable)
|
|
@@ -1769,9 +1770,9 @@ Custom inference:
|
|
|
1769
1770
|
`);
|
|
1770
1771
|
}
|
|
1771
1772
|
async function runPentest() {
|
|
1772
|
-
const { runPentestAgent } = await import("./blackboxPentest-
|
|
1773
|
-
const { sessions } = await import("./index-
|
|
1774
|
-
const { config: appConfig } = await import("./index-
|
|
1773
|
+
const { runPentestAgent } = await import("./blackboxPentest-nbn588pb.js");
|
|
1774
|
+
const { sessions } = await import("./index-3ggmqh6x.js");
|
|
1775
|
+
const { config: appConfig } = await import("./index-wgas3zgb.js");
|
|
1775
1776
|
const target = getArgRequired("--target");
|
|
1776
1777
|
const cwd = getArg("--cwd");
|
|
1777
1778
|
const mode = getArg("--mode");
|
|
@@ -1780,6 +1781,7 @@ async function runPentest() {
|
|
|
1780
1781
|
const enableThinking = hasFlag("--extended-thinking");
|
|
1781
1782
|
const taskDriven = hasFlag("--task-driven");
|
|
1782
1783
|
const fastStrike = hasFlag("--fast-strike");
|
|
1784
|
+
const externalFindings = hasFlag("--external-findings");
|
|
1783
1785
|
const evidenceOutput = nativeRolloutEvidenceOutput();
|
|
1784
1786
|
const resolvedTm = threatModelRaw ? resolveThreatModelPrompt(threatModelRaw) : undefined;
|
|
1785
1787
|
const resolvedPrompt = promptRaw ? resolveFlagValue(promptRaw) : undefined;
|
|
@@ -1804,7 +1806,8 @@ Mode: exfil` : ""}
|
|
|
1804
1806
|
Model: ${model}${enableThinking ? `
|
|
1805
1807
|
Thinking: enabled` : ""}${taskDriven ? `
|
|
1806
1808
|
Task-driven: enabled` : ""}${fastStrike ? `
|
|
1807
|
-
Fast strike: enabled` : ""}${
|
|
1809
|
+
Fast strike: enabled` : ""}${externalFindings ? `
|
|
1810
|
+
Findings: external evaluation` : ""}${headers ? `
|
|
1808
1811
|
Headers: ${Object.keys(headers).length} configured` : ""}
|
|
1809
1812
|
`);
|
|
1810
1813
|
const session = await sessions.create({
|
|
@@ -1820,25 +1823,51 @@ Headers: ${Object.keys(headers).length} configured` : ""}
|
|
|
1820
1823
|
}
|
|
1821
1824
|
});
|
|
1822
1825
|
console.log(`PENSAR_SESSION_PATH:${session.rootPath}`);
|
|
1823
|
-
const { runWithCliNativeRolloutEvidence } = await import("./native-rollout-evidence-
|
|
1826
|
+
const { runWithCliNativeRolloutEvidence } = await import("./native-rollout-evidence-krpdfdv7.js");
|
|
1824
1827
|
const evidence = await runWithCliNativeRolloutEvidence({
|
|
1825
1828
|
session,
|
|
1826
1829
|
outputDirectory: evidenceOutput,
|
|
1827
1830
|
run: async () => {
|
|
1828
1831
|
const { bus: pentestBus, cleanup: wandbCleanup } = await createInstrumentedBus(session, model);
|
|
1829
1832
|
try {
|
|
1830
|
-
const {
|
|
1833
|
+
const {
|
|
1834
|
+
findings,
|
|
1835
|
+
findingsPath,
|
|
1836
|
+
pocsPath,
|
|
1837
|
+
reportPath,
|
|
1838
|
+
reportedFindings,
|
|
1839
|
+
objectiveResults,
|
|
1840
|
+
submissionJson,
|
|
1841
|
+
solved,
|
|
1842
|
+
summary
|
|
1843
|
+
} = await runPentestAgent({
|
|
1831
1844
|
target,
|
|
1832
1845
|
...cwd ? { cwd } : {},
|
|
1833
1846
|
session,
|
|
1834
1847
|
model,
|
|
1835
1848
|
enableThinking,
|
|
1849
|
+
...externalFindings ? { findingPolicy: "external" } : {},
|
|
1836
1850
|
...fastStrike ? { fastStrike: true } : {},
|
|
1837
1851
|
surfaceIntegrationEnabled: pensarConfig.surfaceIntegrationEnabled,
|
|
1838
1852
|
authConfig: buildAuthConfig(pensarConfig),
|
|
1839
1853
|
eventBus: pentestBus
|
|
1840
1854
|
});
|
|
1841
|
-
|
|
1855
|
+
if (externalFindings) {
|
|
1856
|
+
console.log(`
|
|
1857
|
+
${sep}
|
|
1858
|
+
RESULTS
|
|
1859
|
+
${sep}
|
|
1860
|
+
Findings: ${reportedFindings?.length ?? 0}
|
|
1861
|
+
Evaluation: external`);
|
|
1862
|
+
console.log(JSON.stringify({
|
|
1863
|
+
reportedFindings: reportedFindings ?? [],
|
|
1864
|
+
...objectiveResults ? { objectiveResults } : {},
|
|
1865
|
+
...submissionJson ? { submissionJson } : {},
|
|
1866
|
+
...solved === undefined ? {} : { solved },
|
|
1867
|
+
...summary === undefined ? {} : { summary }
|
|
1868
|
+
}, null, 2));
|
|
1869
|
+
} else {
|
|
1870
|
+
console.log(`
|
|
1842
1871
|
${sep}
|
|
1843
1872
|
RESULTS
|
|
1844
1873
|
${sep}
|
|
@@ -1846,6 +1875,7 @@ Findings: ${findings.length}
|
|
|
1846
1875
|
Path: ${findingsPath}
|
|
1847
1876
|
POCs: ${pocsPath}${reportPath ? `
|
|
1848
1877
|
Report: ${reportPath}` : ""}`);
|
|
1878
|
+
}
|
|
1849
1879
|
} finally {
|
|
1850
1880
|
await wandbCleanup();
|
|
1851
1881
|
}
|
|
@@ -1856,9 +1886,9 @@ Report: ${reportPath}` : ""}`);
|
|
|
1856
1886
|
}
|
|
1857
1887
|
}
|
|
1858
1888
|
async function runTargetedPentest() {
|
|
1859
|
-
const { runTargetedPentestAgent } = await import("./targetedPentest-
|
|
1860
|
-
const { sessions } = await import("./index-
|
|
1861
|
-
const { config: appConfig } = await import("./index-
|
|
1889
|
+
const { runTargetedPentestAgent } = await import("./targetedPentest-7v849dtm.js");
|
|
1890
|
+
const { sessions } = await import("./index-3ggmqh6x.js");
|
|
1891
|
+
const { config: appConfig } = await import("./index-wgas3zgb.js");
|
|
1862
1892
|
const target = getArgRequired("--target");
|
|
1863
1893
|
const objectives = getAllArgs("--objective");
|
|
1864
1894
|
const evidenceOutput = nativeRolloutEvidenceOutput();
|
|
@@ -1891,7 +1921,7 @@ ${objectivesList}
|
|
|
1891
1921
|
} : {}
|
|
1892
1922
|
});
|
|
1893
1923
|
console.log(`PENSAR_SESSION_PATH:${session.rootPath}`);
|
|
1894
|
-
const { runWithCliNativeRolloutEvidence } = await import("./native-rollout-evidence-
|
|
1924
|
+
const { runWithCliNativeRolloutEvidence } = await import("./native-rollout-evidence-krpdfdv7.js");
|
|
1895
1925
|
const evidence = await runWithCliNativeRolloutEvidence({
|
|
1896
1926
|
session,
|
|
1897
1927
|
outputDirectory: evidenceOutput,
|
|
@@ -1923,8 +1953,8 @@ POCs: ${pocsPath}`);
|
|
|
1923
1953
|
}
|
|
1924
1954
|
}
|
|
1925
1955
|
async function runThreatModel() {
|
|
1926
|
-
const { runThreatModelWorkflow } = await import("./threatModel-
|
|
1927
|
-
const { config: appConfig } = await import("./index-
|
|
1956
|
+
const { runThreatModelWorkflow } = await import("./threatModel-n0grwkav.js");
|
|
1957
|
+
const { config: appConfig } = await import("./index-wgas3zgb.js");
|
|
1928
1958
|
const path = await import("path");
|
|
1929
1959
|
const pensarConfig = await appConfig.get();
|
|
1930
1960
|
const model = await resolveCliModel();
|
|
@@ -1959,10 +1989,10 @@ ${sep}
|
|
|
1959
1989
|
Threat model written to: ${resolvedPath}`);
|
|
1960
1990
|
}
|
|
1961
1991
|
async function runOperator() {
|
|
1962
|
-
const { runOffensiveSecurityAgent } = await import("./offesecAgent-
|
|
1963
|
-
const { sessions, normalizeMessages, getResumeMessages } = await import("./index-
|
|
1964
|
-
const { ALL_TOOL_NAMES, SKILL_TOOL_NAMES } = await import("./index-
|
|
1965
|
-
const { config: appConfig } = await import("./index-
|
|
1992
|
+
const { runOffensiveSecurityAgent } = await import("./offesecAgent-aw87gf37.js");
|
|
1993
|
+
const { sessions, normalizeMessages, getResumeMessages } = await import("./index-3ggmqh6x.js");
|
|
1994
|
+
const { ALL_TOOL_NAMES, SKILL_TOOL_NAMES } = await import("./index-xfqh0wte.js");
|
|
1995
|
+
const { config: appConfig } = await import("./index-wgas3zgb.js");
|
|
1966
1996
|
const { createInterface } = await import("readline");
|
|
1967
1997
|
const { readFileSync, existsSync } = await import("fs");
|
|
1968
1998
|
const path = await import("path");
|
|
@@ -2003,7 +2033,7 @@ ${sep}
|
|
|
2003
2033
|
...evidenceOutput ? { nativeRolloutEvidence: { outputDirectory: evidenceOutput } } : {}
|
|
2004
2034
|
}
|
|
2005
2035
|
});
|
|
2006
|
-
const { runWithCliNativeRolloutEvidence } = await import("./native-rollout-evidence-
|
|
2036
|
+
const { runWithCliNativeRolloutEvidence } = await import("./native-rollout-evidence-krpdfdv7.js");
|
|
2007
2037
|
const evidence = await runWithCliNativeRolloutEvidence({
|
|
2008
2038
|
session,
|
|
2009
2039
|
outputDirectory: evidenceOutput,
|
|
@@ -2105,7 +2135,7 @@ try {
|
|
|
2105
2135
|
await standaloneRuntime?.shutdown();
|
|
2106
2136
|
process.exitCode = 1;
|
|
2107
2137
|
} else {
|
|
2108
|
-
const { startTui } = await import("./index-
|
|
2138
|
+
const { startTui } = await import("./index-e97991ve.js");
|
|
2109
2139
|
await startTui(options);
|
|
2110
2140
|
}
|
|
2111
2141
|
} else if (hasFlag("-p") || command === "--prompt") {
|
|
@@ -2125,37 +2155,37 @@ try {
|
|
|
2125
2155
|
await runTargetedPentest();
|
|
2126
2156
|
} else if (command === "login" || command === "auth") {
|
|
2127
2157
|
process.argv = [process.argv[0], process.argv[1], ...args.slice(1)];
|
|
2128
|
-
await import("./auth-
|
|
2158
|
+
await import("./auth-bxkn5pcb.js");
|
|
2129
2159
|
} else if (command === "uninstall") {
|
|
2130
2160
|
process.argv = [process.argv[0], process.argv[1], ...args.slice(1)];
|
|
2131
|
-
await import("./uninstall-
|
|
2161
|
+
await import("./uninstall-ctv33v8j.js");
|
|
2132
2162
|
} else if (command === "apps") {
|
|
2133
2163
|
process.argv = [process.argv[0], process.argv[1], ...args.slice(1)];
|
|
2134
|
-
await import("./apps-
|
|
2164
|
+
await import("./apps-v4jc7eqb.js");
|
|
2135
2165
|
} else if (command === "pentests") {
|
|
2136
2166
|
process.argv = [process.argv[0], process.argv[1], ...args.slice(1)];
|
|
2137
|
-
await import("./pentests-
|
|
2167
|
+
await import("./pentests-577n3x75.js");
|
|
2138
2168
|
} else if (command === "agent-runs") {
|
|
2139
|
-
const { runAgentRunsCommand } = await import("./agent-runs-
|
|
2169
|
+
const { runAgentRunsCommand } = await import("./agent-runs-hhjzsysf.js");
|
|
2140
2170
|
await runAgentRunsCommand(args.slice(1));
|
|
2141
2171
|
} else if (command === "targets") {
|
|
2142
2172
|
process.argv = [process.argv[0], process.argv[1], ...args.slice(1)];
|
|
2143
|
-
await import("./targets-
|
|
2173
|
+
await import("./targets-3vjxv3yj.js");
|
|
2144
2174
|
} else if (command === "issues") {
|
|
2145
2175
|
process.argv = [process.argv[0], process.argv[1], ...args.slice(1)];
|
|
2146
|
-
await import("./issues-
|
|
2176
|
+
await import("./issues-sq3zya6y.js");
|
|
2147
2177
|
} else if (command === "knowledge") {
|
|
2148
2178
|
process.argv = [process.argv[0], process.argv[1], ...args.slice(1)];
|
|
2149
|
-
await import("./knowledge-
|
|
2179
|
+
await import("./knowledge-kzd0cgcm.js");
|
|
2150
2180
|
} else if (command === "fixes") {
|
|
2151
2181
|
process.argv = [process.argv[0], process.argv[1], ...args.slice(1)];
|
|
2152
|
-
await import("./fixes-
|
|
2182
|
+
await import("./fixes-c51d83b4.js");
|
|
2153
2183
|
} else if (command === "logs") {
|
|
2154
2184
|
process.argv = [process.argv[0], process.argv[1], ...args.slice(1)];
|
|
2155
|
-
await import("./logs-
|
|
2185
|
+
await import("./logs-yk8dk6aa.js");
|
|
2156
2186
|
} else if (command === "config") {
|
|
2157
2187
|
process.argv = [process.argv[0], process.argv[1], ...args.slice(1)];
|
|
2158
|
-
await import("./config-
|
|
2188
|
+
await import("./config-gpxx6m5z.js");
|
|
2159
2189
|
} else if (command === "threat-model") {
|
|
2160
2190
|
await runThreatModel();
|
|
2161
2191
|
} else if (command === "doctor") {
|