@pensar/apex 2.6.1 → 2.7.0-canary.21cb83dc

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.
Files changed (226) hide show
  1. package/build/{agent-yby11zaq.js → agent-68t2wzmc.js} +6 -6
  2. package/build/agent-jhekpern.js +13 -0
  3. package/build/{agent-ayreaj6z.js → agent-qvreg8a4.js} +5 -5
  4. package/build/{agent-runs-g37vkrjr.js → agent-runs-30dvbvmm.js} +18 -18
  5. package/build/agent-vybw255f.js +13 -0
  6. package/build/{apps-xn6km9yn.js → apps-na0y0992.js} +13 -13
  7. package/build/{auth-d105wc64.js → auth-dz2c5thx.js} +13 -13
  8. package/build/{blackboxAgent-s56sgx9b.js → blackboxAgent-2mwvaajb.js} +6 -6
  9. package/build/{blackboxPentest-ps78v3w7.js → blackboxPentest-s2mfze9p.js} +17 -12
  10. package/build/{cli-kb21qhvm.js → cli-1pmfnz1a.js} +4 -3
  11. package/build/{cli-ae8jqxqr.js → cli-563yntrb.js} +2 -2
  12. package/build/{cli-7eea4e2y.js → cli-5ab346kd.js} +6 -6
  13. package/build/{cli-1ve18npr.js → cli-72y76bpg.js} +3 -2
  14. package/build/{cli-fy6vh2a7.js → cli-98wmmphf.js} +1 -1
  15. package/build/{cli-c05y640n.js → cli-9jscnhtg.js} +1 -1
  16. package/build/{cli-3sp6nd8d.js → cli-9kk9tm58.js} +2 -2
  17. package/build/{cli-d37a42dc.js → cli-9pz9wjt2.js} +101 -18
  18. package/build/{cli-dpsw2fe6.js → cli-a6x4jm5a.js} +476 -193
  19. package/build/{cli-az3xq70v.js → cli-cfrdr25z.js} +1 -1
  20. package/build/{cli-ngq9dr8n.js → cli-fdrrbb9p.js} +3 -3
  21. package/build/{cli-k2nwxta0.js → cli-t09zj814.js} +2 -2
  22. package/build/{cli-qgz1q9g5.js → cli-t4q4t4dx.js} +223 -76
  23. package/build/{cli-xtc2t6me.js → cli-vdd1s3x9.js} +103 -39
  24. package/build/{cli-gx71jcke.js → cli-vn4cwac3.js} +1 -1
  25. package/build/{cli-65g6rcat.js → cli-w9nw2a4z.js} +1 -1
  26. package/build/{cli-n2en7j5b.js → cli-z7ysyrr4.js} +1 -1
  27. package/build/{cli-709rvekb.js → cli-zbbtr4sb.js} +4 -2
  28. package/build/cli.js +70 -40
  29. package/build/{config-zpqkd5cz.js → config-nkzm9arw.js} +1 -1
  30. package/build/{fastStrike-mcjdvwez.js → fastStrike-16jw1s61.js} +67 -15
  31. package/build/{fixes-kytx5dmj.js → fixes-6wxk22v5.js} +13 -13
  32. package/build/{index-4vqdgb42.js → index-36p56pcf.js} +1473 -1217
  33. package/build/{index-je6hcsqr.js → index-6nejymsc.js} +1 -1
  34. package/build/{index-fv64eb32.js → index-asm4y7e4.js} +2 -2
  35. package/build/{index-n65z6v7b.js → index-bfmn52za.js} +6 -6
  36. package/build/{index-qv4cc65p.js → index-bt4r13q7.js} +13 -13
  37. package/build/{index-dr3tg1w3.js → index-gfq1rp1q.js} +1 -1
  38. package/build/{index-wqetp6gq.js → index-j9pxgrzd.js} +12 -7
  39. package/build/{index-r9yjkfrv.js → index-n9kapn1x.js} +4 -4
  40. package/build/{index-ns4m4s01.js → index-tr6evhyg.js} +4 -4
  41. package/build/{issues-eb3q9d3a.js → issues-7rmf4ker.js} +13 -13
  42. package/build/{knowledge-fqsvtx0f.js → knowledge-s2sxh8nb.js} +13 -13
  43. package/build/lib/{chunk-1azdancq.js → chunk-0dnx79b1.js} +1 -1
  44. package/build/lib/{chunk-4hwzqthr.js → chunk-161ak2am.js} +3 -2
  45. package/build/lib/{chunk-z137x08b.js → chunk-1rqbhx4b.js} +7 -5
  46. package/build/lib/{chunk-1yct6cra.js → chunk-3hjvdf67.js} +1 -1
  47. package/build/lib/{chunk-r2dkp4tb.js → chunk-5j8pp0xf.js} +1 -1
  48. package/build/lib/{chunk-3c00n0cy.js → chunk-77se1d35.js} +8 -3
  49. package/build/lib/{chunk-yrnrbjes.js → chunk-7tft4b8b.js} +4 -2
  50. package/build/lib/{chunk-w66ce82a.js → chunk-8njjwwcw.js} +4 -2
  51. package/build/lib/{chunk-v3dk9j7k.js → chunk-aq9eyxas.js} +80 -21
  52. package/build/lib/{chunk-9tt2021m.js → chunk-d05cvnv8.js} +9 -9
  53. package/build/lib/{chunk-e8yy2k73.js → chunk-f3sq4896.js} +28 -2
  54. package/build/lib/{chunk-1fy8azee.js → chunk-fasqtjq1.js} +1 -1
  55. package/build/lib/{chunk-1jvwqnem.js → chunk-gm3b9j4y.js} +104 -40
  56. package/build/lib/{chunk-r4j8ybn9.js → chunk-hys7nemr.js} +87 -36
  57. package/build/lib/{chunk-7pwa92rn.js → chunk-j9668h16.js} +1 -1
  58. package/build/lib/{chunk-ba41jh41.js → chunk-kcw4cpr3.js} +418 -133
  59. package/build/lib/{chunk-z96pbjhd.js → chunk-m4swxy5r.js} +13 -6
  60. package/build/lib/{chunk-xhdpgpkm.js → chunk-mbsde9d0.js} +2 -2
  61. package/build/lib/{chunk-9yksqgzr.js → chunk-mpvjfvz0.js} +20 -13
  62. package/build/lib/{chunk-2qsq76xq.js → chunk-qkz5sm0d.js} +128 -34
  63. package/build/lib/{chunk-nhfax4gb.js → chunk-rfyjqybp.js} +1 -1
  64. package/build/lib/{chunk-mg03jdmt.js → chunk-vsnwzne5.js} +1 -1
  65. package/build/lib/{chunk-acgbyf5h.js → chunk-ydxhkgjw.js} +3 -2
  66. package/build/lib/{chunk-bb0ekhkw.js → chunk-z8kej0sp.js} +69 -18
  67. package/build/lib/core/agents/agentRuntime.d.ts +2 -1
  68. package/build/lib/core/agents/defineAgent.d.ts +3 -2
  69. package/build/lib/core/agents/offSecAgent/index.d.ts +3 -1
  70. package/build/lib/core/agents/offSecAgent/index.js +10 -8
  71. package/build/lib/core/agents/offSecAgent/prompt.d.ts +3 -1
  72. package/build/lib/core/agents/offSecAgent/subagentSpawner.d.ts +2 -1
  73. package/build/lib/core/agents/offSecAgent/subagentSpawner.js +5 -5
  74. package/build/lib/core/agents/offSecAgent/tools/index.js +4 -4
  75. package/build/lib/core/agents/offSecAgent/tools/listMemories.d.ts +11 -1
  76. package/build/lib/core/agents/offSecAgent/tools/reportError.d.ts +2 -1
  77. package/build/lib/core/agents/offSecAgent/tools/runPentestWorkflow.d.ts +20 -1
  78. package/build/lib/core/agents/offSecAgent/tools/spawnPentestAgent.d.ts +4 -7
  79. package/build/lib/core/agents/offSecAgent/tools/spawnPentestSwarm.d.ts +7 -1
  80. package/build/lib/core/agents/offSecAgent/tools/types.d.ts +2 -1
  81. package/build/lib/core/agents/offSecAgent/types.d.ts +7 -1
  82. package/build/lib/core/agents/specialized/attackSurface/blackboxAgent.js +9 -9
  83. package/build/lib/core/agents/specialized/attackSurface/schemas.js +9 -9
  84. package/build/lib/core/agents/specialized/authenticationAgent/index.js +10 -10
  85. package/build/lib/core/agents/specialized/codeAgent/agent.js +9 -9
  86. package/build/lib/core/agents/specialized/codeAgent/prompts.d.ts +1 -0
  87. package/build/lib/core/agents/specialized/findingJudge/agent.js +8 -8
  88. package/build/lib/core/agents/specialized/findingJudge/index.js +3 -3
  89. package/build/lib/core/agents/specialized/patching/index.js +10 -10
  90. package/build/lib/core/agents/specialized/pentest/agent.d.ts +18 -4
  91. package/build/lib/core/agents/specialized/pentest/agent.js +11 -9
  92. package/build/lib/core/agents/specialized/whiteboxAttackSurface/index.js +9 -9
  93. package/build/lib/core/ai/ai.d.ts +23 -6
  94. package/build/lib/core/ai/ai.js +2 -2
  95. package/build/lib/core/ai/index.js +2 -2
  96. package/build/lib/core/ai/models/claude-capabilities.d.ts +3 -2
  97. package/build/lib/core/ai/models/concentrate.d.ts +1 -0
  98. package/build/lib/core/ai/models/index.d.ts +1 -1
  99. package/build/lib/core/ai/providers/concentrate.d.ts +1 -0
  100. package/build/lib/core/ai/utils.d.ts +2 -0
  101. package/build/lib/core/ai/utils.js +4 -2
  102. package/build/lib/core/api/index.d.ts +3 -0
  103. package/build/lib/core/api/index.js +22 -19
  104. package/build/lib/core/api/targetedPentest.d.ts +1 -0
  105. package/build/lib/core/api/targetedPentest.js +10 -10
  106. package/build/lib/core/config/config.d.ts +3 -0
  107. package/build/lib/core/config/index.js +1 -1
  108. package/build/lib/core/findings/registry.js +3 -3
  109. package/build/lib/core/session/index.d.ts +12 -0
  110. package/build/lib/core/session/index.js +2 -2
  111. package/build/lib/core/session/persistence.d.ts +7 -0
  112. package/build/lib/core/session/persistence.js +7 -3
  113. package/build/lib/core/workflows/fastStrike.d.ts +3 -1
  114. package/build/lib/core/workflows/pentest.d.ts +8 -1
  115. package/build/lib/core/workflows/pentest.js +15 -15
  116. package/build/lib/core/workflows/seams.js +4 -4
  117. package/build/lib/core/workflows/whiteboxAttackSurface.js +11 -11
  118. package/build/lib/index.js +22 -22
  119. package/build/{logs-x62b7hk1.js → logs-70fyr848.js} +13 -13
  120. package/build/{native-rollout-evidence-c9yhfqcs.js → native-rollout-evidence-ntensvzb.js} +3 -3
  121. package/build/{offesecAgent-5whnpeta.js → offesecAgent-kk62tf60.js} +4 -4
  122. package/build/pentest-4jgznn7h.js +22 -0
  123. package/build/{pentests-e0f32aqx.js → pentests-3e41hj08.js} +13 -13
  124. package/build/recordedRunClient-w34kcch1.js +11 -0
  125. package/build/{targetedPentest-rcbs4nvp.js → targetedPentest-t9snxcj2.js} +18 -11
  126. package/build/{targets-xj9g3q0z.js → targets-1pyf21c7.js} +13 -13
  127. package/build/threatModel-48y5qjze.js +21 -0
  128. package/build/{uninstall-7s784q4a.js → uninstall-fbydd9t6.js} +1 -1
  129. package/build/{upload-4gvhwmvr.js → upload-sbhwe2fq.js} +4 -4
  130. package/build/{utils-cjrz64pc.js → utils-23903gcj.js} +3 -3
  131. package/package.json +1 -1
  132. package/src/cli.ts +48 -14
  133. package/src/core/agents/agentRuntime.test.ts +38 -0
  134. package/src/core/agents/agentRuntime.ts +5 -2
  135. package/src/core/agents/defineAgent.ts +3 -1
  136. package/src/core/agents/offSecAgent/index.ts +3 -0
  137. package/src/core/agents/offSecAgent/offensiveSecurityAgent.test.ts +92 -5
  138. package/src/core/agents/offSecAgent/offensiveSecurityAgent.ts +70 -31
  139. package/src/core/agents/offSecAgent/prompt.test.ts +46 -0
  140. package/src/core/agents/offSecAgent/prompt.ts +52 -8
  141. package/src/core/agents/offSecAgent/selectiveConstruction.publicPath.test.ts +38 -0
  142. package/src/core/agents/offSecAgent/selectiveConstruction.test.ts +64 -0
  143. package/src/core/agents/offSecAgent/subagentSpawner.ts +12 -1
  144. package/src/core/agents/offSecAgent/tools/delegateAuth.ts +1 -0
  145. package/src/core/agents/offSecAgent/tools/listMemories.test.ts +230 -0
  146. package/src/core/agents/offSecAgent/tools/listMemories.ts +73 -6
  147. package/src/core/agents/offSecAgent/tools/reportError.test.ts +6 -0
  148. package/src/core/agents/offSecAgent/tools/reportError.ts +10 -2
  149. package/src/core/agents/offSecAgent/tools/runAttackSurface.ts +2 -0
  150. package/src/core/agents/offSecAgent/tools/runPentestWorkflow.test.ts +57 -0
  151. package/src/core/agents/offSecAgent/tools/runPentestWorkflow.ts +19 -1
  152. package/src/core/agents/offSecAgent/tools/runWhiteboxScan.ts +5 -2
  153. package/src/core/agents/offSecAgent/tools/spawnCodingAgent.ts +1 -0
  154. package/src/core/agents/offSecAgent/tools/spawnPentestAgent.test.ts +72 -2
  155. package/src/core/agents/offSecAgent/tools/spawnPentestAgent.ts +32 -11
  156. package/src/core/agents/offSecAgent/tools/spawnPentestSwarm.ts +25 -5
  157. package/src/core/agents/offSecAgent/tools/threatModelGenerator.ts +1 -0
  158. package/src/core/agents/offSecAgent/tools/types.ts +6 -1
  159. package/src/core/agents/offSecAgent/tools/updateTask.ts +5 -1
  160. package/src/core/agents/offSecAgent/tools/whiteboxCandidates.ts +11 -4
  161. package/src/core/agents/offSecAgent/types.ts +9 -0
  162. package/src/core/agents/specialized/codeAgent/agent.test.ts +7 -0
  163. package/src/core/agents/specialized/codeAgent/agent.ts +9 -2
  164. package/src/core/agents/specialized/codeAgent/prompts.ts +6 -0
  165. package/src/core/agents/specialized/pentest/agent.test.ts +116 -0
  166. package/src/core/agents/specialized/pentest/agent.ts +178 -49
  167. package/src/core/agents/specialized/pentest/results.test.ts +59 -4
  168. package/src/core/agents/specialized/whiteboxAttackSurface/endpointDocumentationAgent.ts +1 -0
  169. package/src/core/ai/ai.operator-context.bench.test.ts +1408 -0
  170. package/src/core/ai/ai.recorded-context.test.ts +74 -0
  171. package/src/core/ai/ai.test.ts +54 -0
  172. package/src/core/ai/ai.ts +312 -82
  173. package/src/core/ai/compactionTelemetry.test.ts +2 -2
  174. package/src/core/ai/models/anthropic.ts +6 -0
  175. package/src/core/ai/models/bedrock.ts +18 -0
  176. package/src/core/ai/models/claude-capabilities.ts +29 -8
  177. package/src/core/ai/models/concentrate.ts +52 -0
  178. package/src/core/ai/models/index.ts +25 -4
  179. package/src/core/ai/models/models.test.ts +154 -0
  180. package/src/core/ai/models/openrouter.ts +43 -1
  181. package/src/core/ai/providers/anthropic-models.test.ts +60 -1
  182. package/src/core/ai/providers/bedrock-models.test.ts +81 -0
  183. package/src/core/ai/providers/concentrate.test.ts +31 -0
  184. package/src/core/ai/providers/concentrate.ts +11 -0
  185. package/src/core/ai/providers/gateway-models.test.ts +16 -6
  186. package/src/core/ai/utils.native-rollout-evidence.test.ts +1 -0
  187. package/src/core/ai/utils.ts +189 -143
  188. package/src/core/api/blackboxPentest.ts +9 -1
  189. package/src/core/api/index.ts +9 -0
  190. package/src/core/api/targetedPentest.ts +19 -5
  191. package/src/core/config/config.test.ts +35 -0
  192. package/src/core/config/config.ts +5 -0
  193. package/src/core/observability/telemetry.test.ts +2 -3
  194. package/src/core/session/index.ts +5 -0
  195. package/src/core/session/persistence.test.ts +62 -0
  196. package/src/core/session/persistence.ts +56 -0
  197. package/src/core/workflows/fastStrike.seams.test.ts +149 -0
  198. package/src/core/workflows/fastStrike.test.ts +18 -1
  199. package/src/core/workflows/fastStrike.ts +103 -11
  200. package/src/core/workflows/pentest.test.ts +104 -0
  201. package/src/core/workflows/pentest.ts +110 -7
  202. package/src/core/workflows/seams.test.ts +13 -0
  203. package/src/core/workflows/seams.ts +5 -1
  204. package/src/core/workflows/whiteboxAttackSurface.ts +1 -0
  205. package/src/tui/components/chat/loading-indicator.tsx +20 -4
  206. package/src/tui/components/chat/message-list.tsx +1 -0
  207. package/src/tui/components/commands/__tests__/advanced-settings-lifecycle.tsx +176 -0
  208. package/src/tui/components/commands/advanced-settings.test.ts +28 -0
  209. package/src/tui/components/commands/advanced-settings.tsx +237 -19
  210. package/src/tui/components/operator-dashboard/index.tsx +46 -9
  211. package/src/tui/components/operator-dashboard/logic.test.ts +106 -0
  212. package/src/tui/components/operator-dashboard/logic.ts +42 -2
  213. package/src/tui/components/operator-dashboard/run-events.test.ts +3 -1
  214. package/src/tui/components/shared/__tests__/tool-renderer-lifecycle.tsx +18 -0
  215. package/src/tui/components/shared/action-label.test.ts +9 -0
  216. package/src/tui/components/shared/compacting-icon.tsx +18 -0
  217. package/src/tui/components/shared/index.ts +1 -0
  218. package/src/tui/components/shared/tool-registry.ts +1 -0
  219. package/src/tui/components/shared/tool-renderer.tsx +21 -7
  220. package/src/tui/context/route.tsx +1 -0
  221. package/src/tui/keybindings/registry.ts +2 -0
  222. package/build/agent-6w7egcf1.js +0 -13
  223. package/build/agent-9zx75feh.js +0 -13
  224. package/build/pentest-e61hc38s.js +0 -22
  225. package/build/recordedRunClient-dp032c32.js +0 -11
  226. package/build/threatModel-jkxfa40s.js +0 -21
@@ -1,12 +1,12 @@
1
1
  import"./chunk-7gjdygcx.js";
2
- import"./chunk-w66ce82a.js";
2
+ import"./chunk-8njjwwcw.js";
3
3
  import"./chunk-jdjagvgr.js";
4
4
  import"./chunk-2njv7wz3.js";
5
- import"./chunk-ba41jh41.js";
5
+ import"./chunk-kcw4cpr3.js";
6
6
  import"./chunk-8vhr65w3.js";
7
7
  import {
8
8
  OffensiveSecurityAgent2
9
- } from "./chunk-r4j8ybn9.js";
9
+ } from "./chunk-hys7nemr.js";
10
10
  import"./chunk-fy3bbbqy.js";
11
11
  import"./chunk-mv74mq5n.js";
12
12
  import {
@@ -14,14 +14,14 @@ import {
14
14
  withFindingPersistedHook2,
15
15
  assertDepth2,
16
16
  inProcessSeams2
17
- } from "./chunk-yrnrbjes.js";
17
+ } from "./chunk-7tft4b8b.js";
18
18
  import"./chunk-b8eq85d2.js";
19
19
  import {
20
20
  FindingsRegistry2
21
- } from "./chunk-1azdancq.js";
22
- import"./chunk-3c00n0cy.js";
21
+ } from "./chunk-0dnx79b1.js";
22
+ import"./chunk-77se1d35.js";
23
23
  import"./chunk-t5bt5vn1.js";
24
- import"./chunk-2qsq76xq.js";
24
+ import"./chunk-qkz5sm0d.js";
25
25
  import"./chunk-eb4h4k1f.js";
26
26
  import"./chunk-vx228eeq.js";
27
27
  import"./chunk-bx94rwt5.js";
@@ -36,7 +36,7 @@ import {
36
36
  REPORT_FILENAME_MD,
37
37
  REPORT_FILENAME_JSON,
38
38
  createThreatModelPrompt
39
- } from "./chunk-v3dk9j7k.js";
39
+ } from "./chunk-aq9eyxas.js";
40
40
 
41
41
  // src/core/workflows/fastStrike.ts
42
42
  import { writeFileSync } from "node:fs";
@@ -46,7 +46,18 @@ var FastStrikeResult = z.object({
46
46
  solved: z.boolean().describe("True if the objective was achieved — a vulnerability was confirmed and, where applicable, the flag or sensitive data was extracted."),
47
47
  summary: z.string().describe("Concise account of the vulnerability exploited, the exact steps that worked, and any flag or sensitive data recovered.")
48
48
  });
49
- var FAST_STRIKE_SYSTEM_PROMPT = `You are an elite offensive security operator running a fast strike against a single target. You work ALONE and finish the job yourself — there is no team to hand off to, no swarm to spawn, no plan to file. Your edge is discipline and observation, not volume.
49
+ var FastStrikeExternalResult = z.object({
50
+ solved: z.boolean().describe("True if the supplied objective was met."),
51
+ summary: z.string().describe("Concise account of security findings and the evidence observed, including any flag or sensitive data extracted for an exfiltration objective."),
52
+ reportedFindings: z.array(z.string()).describe("One concise evidence-backed description per discovered vulnerability."),
53
+ submissionJson: z.string().describe("The exact task-defined JSON submission as a string, or an empty string when no JSON submission was requested. Do not invent fields.")
54
+ });
55
+ function buildFastStrikeSystemPrompt(findingPolicy = "native") {
56
+ const external = findingPolicy === "external";
57
+ const objectiveStep = external ? "5. FOLLOW THE OBJECTIVE — Determine whether the observed behavior establishes a security weakness. For a detection-only objective, stop once the requested evidence is sufficient; develop an exploit or pivot only when the objective requires it." : "5. EXPLOIT — When a vulnerability is confirmed, exploit it: capture the flag, extract the sensitive data, and pivot through it if the objective requires more. Preserve viable primitives and build on them. Prefer extending a working script into an end-to-end exploit over rebuilding the chain with repeated one-off tool calls or stopping at the next network or protocol boundary.";
58
+ const finishStep = external ? "6. REPORT & FINISH — Include each credible finding and its supporting observations in the caller's requested output. If the caller requested a JSON submission, include the exact JSON text in the response tool's submissionJson field as well; otherwise use an empty string. The caller evaluates findings after the run. Once the objective is met or credible leads are exhausted, call the response tool with the correct solved value and a concise summary." : "6. DOCUMENT & FINISH — Record each confirmed vulnerability with the document_vulnerability tool as you go. Before concluding that every credible lead is exhausted, account for each viable primitive and pursue any concrete path that could still close the objective. After this check, whether the objective was met or every credible lead was genuinely exhausted, call the response tool with the correct solved value and a concise summary.";
59
+ const evidenceRule = external ? "- Bias toward the shortest path that satisfies the assigned objective. Distinguish observed evidence from hypotheses, and avoid separate in-run finding review." : "- Bias toward the shortest path that proves impact. Speed comes from picking the right lead, not from skipping verification — always confirm a finding before you claim it.";
60
+ return `You are an elite offensive security operator running a fast strike against a single target. You work ALONE and finish the job yourself — there is no team to hand off to, no swarm to spawn, no plan to file. Your edge is discipline and observation, not volume.
50
61
 
51
62
  Run this loop, tightly:
52
63
 
@@ -54,15 +65,17 @@ Run this loop, tightly:
54
65
  2. HYPOTHESIZE — From that signal and your deep knowledge of web/app vulnerability classes, name the single most likely vulnerability and why the evidence points to it. Rank leads by signal strength and go for the strongest first. A disabled form field, an ID in a URL or JWT, advertised demo creds, an exposed schema — these are tells; read them.
55
66
  3. ACT — Test that one hypothesis with the strongest available technique. Use direct tools for quick probes, but treat the shell as a working environment rather than merely a way to issue one-off commands. When the work becomes stateful, repetitive, concurrent, protocol-heavy, or multi-stage, externalize it into an editable script in the session scratchpad directory identified in the workspace instructions. Never create a scratchpad/ directory inside the target repository. Run the script, inspect the results, modify it, and rerun it as the attack develops. For blind/out-of-band testing (SSRF, blind RCE, XSS callbacks), start_callback_listener gives you a nonce-correlated listener that survives intervening commands: embed the returned callback URL (only an address you know the target can reach — never a guessed one) in the payload, then poll_callback_listener for hits. Listener readiness and the tool's own self-test never count as target evidence; stop_callback_listener when done.
56
67
  4. PRUNE — If the evidence disproves a lead, drop it and move to the next-strongest. Do NOT re-run a disproven approach or grind a dead end. Do NOT enumerate, brute-force, or run wordlists unless a specific signal demands it — choose techniques from evidence, not from a checklist.
57
- 5. EXPLOIT — When a vulnerability is confirmed, exploit it: capture the flag, extract the sensitive data, and pivot through it if the objective requires more. Preserve viable primitives and build on them. Prefer extending a working script into an end-to-end exploit over rebuilding the chain with repeated one-off tool calls or stopping at the next network or protocol boundary.
58
- 6. DOCUMENT & FINISH — Record each confirmed vulnerability with the document_vulnerability tool as you go. Before concluding that every credible lead is exhausted, account for each viable primitive and pursue any concrete path that could still close the objective. After this check, whether the objective was met or every credible lead was genuinely exhausted, call the response tool with the correct solved value and a concise summary.
68
+ ${objectiveStep}
69
+ ${finishStep}
59
70
 
60
71
  Rules:
61
72
  - You are one operator. Plan in your head and in short text notes — never via planning tools, task lists, or sub-agents.
62
73
  - Recon and exploitation are the same loop. Do just enough recon to form the first hypothesis, then start testing. Do not map the entire surface before acting.
63
74
  - Spend your reasoning on choosing techniques and interpreting evidence; use scripts for deterministic mechanics, iteration, and chain execution.
64
- - Bias toward the shortest path that proves impact. Speed comes from picking the right lead, not from skipping verification — always confirm a finding before you claim it.
75
+ ${evidenceRule}
65
76
  - Stay in scope. Only touch the target you were given and hosts it legitimately depends on.`;
77
+ }
78
+ var FAST_STRIKE_SYSTEM_PROMPT = buildFastStrikeSystemPrompt();
66
79
  async function runFastStrike(input) {
67
80
  const {
68
81
  target,
@@ -75,6 +88,7 @@ async function runFastStrike(input) {
75
88
  onStepFinish,
76
89
  onCacheMetrics,
77
90
  enableThinking,
91
+ thinkingEffort,
78
92
  openAIReasoningEffort,
79
93
  prompt,
80
94
  threatModel,
@@ -115,6 +129,7 @@ async function runFastStrike(input) {
115
129
  ${combined}` : combined;
116
130
  }
117
131
  const operatorGuidance = session.config?.prompt;
132
+ const findingPolicy = input.hooks?.findingPolicy ?? input.findingPolicy;
118
133
  const mode = cwd ? "whitebox" : "blackbox";
119
134
  eventBus?.emit("workflow-phase-start", {
120
135
  phase: "pentesting",
@@ -125,14 +140,17 @@ ${combined}` : combined;
125
140
  const promptParts = [`Target: ${target}`];
126
141
  if (operatorGuidance)
127
142
  promptParts.push(operatorGuidance);
128
- promptParts.push("Run the fast strike: find and exploit the vulnerability, complete the objective, and report what worked.");
143
+ promptParts.push(findingPolicy === "external" ? "Run the fast strike: investigate the target, identify security weaknesses, and submit the findings in the requested output. Stop when the supplied objective is met." : "Run the fast strike: find and exploit the vulnerability, complete the objective, and report what worked.");
144
+ if (findingPolicy === "external" && session.config?.exfilMode) {
145
+ promptParts.push("Exfiltration goal: locate and extract FLAG{...} or the assigned sensitive data through a confirmed weakness. Do not stop at discovery; include the extraction result in the final summary.");
146
+ }
129
147
  const agent = new OffensiveSecurityAgent2({
130
148
  subagentSpawner: input.subagentSpawner,
131
149
  languageModelMiddleware: input.languageModelMiddleware,
132
150
  usageRecorder: input.usageRecorder,
133
151
  streamIdFactory: input.streamIdFactory,
134
152
  ...input.hooks,
135
- system: FAST_STRIKE_SYSTEM_PROMPT,
153
+ system: buildFastStrikeSystemPrompt(findingPolicy),
136
154
  prompt: promptParts.join(`
137
155
 
138
156
  `),
@@ -140,8 +158,9 @@ ${combined}` : combined;
140
158
  session,
141
159
  target,
142
160
  mode: "fast-strike",
161
+ findingPolicy,
143
162
  activeTools: [],
144
- responseSchema: FastStrikeResult,
163
+ responseSchema: findingPolicy === "external" ? FastStrikeExternalResult : FastStrikeResult,
145
164
  findingsRegistry,
146
165
  subagentId: "fast-strike",
147
166
  authConfig,
@@ -150,6 +169,7 @@ ${combined}` : combined;
150
169
  onStepFinish,
151
170
  onCacheMetrics,
152
171
  enableThinking,
172
+ thinkingEffort,
153
173
  openAIReasoningEffort
154
174
  });
155
175
  eventBus?.emit("subagent-spawn", {
@@ -162,14 +182,23 @@ ${combined}` : combined;
162
182
  subagentName: "Fast Strike",
163
183
  target
164
184
  });
165
- let strikeResult;
185
+ let completed;
166
186
  try {
167
- strikeResult = await agent.consume();
187
+ const strikeResult = await agent.consume();
188
+ if (findingPolicy === "external") {
189
+ const parsed = FastStrikeExternalResult.safeParse(strikeResult);
190
+ if (!parsed.success) {
191
+ throw new Error("Externally graded Fast Strike ended without a structured findings response");
192
+ }
193
+ completed = { policy: "external", outcome: parsed.data };
194
+ } else {
195
+ completed = { policy: "native", outcome: strikeResult };
196
+ }
168
197
  eventBus?.emit("subagent-complete", {
169
198
  subagentId: "fast-strike",
170
199
  status: "completed"
171
200
  });
172
- await seams.hooks.onEndpointDone?.({ subagentId: "fast-strike", subagentName: "Fast Strike", target }, strikeResult);
201
+ await seams.hooks.onEndpointDone?.({ subagentId: "fast-strike", subagentName: "Fast Strike", target }, completed.outcome);
173
202
  } catch (e) {
174
203
  eventBus?.emit("subagent-complete", {
175
204
  subagentId: "fast-strike",
@@ -181,8 +210,30 @@ ${combined}` : combined;
181
210
  if (abortSignal?.aborted) {
182
211
  throw new DOMException("Pentest aborted by user", "AbortError");
183
212
  }
213
+ if (completed.policy === "external") {
214
+ const strikeResult = completed.outcome;
215
+ eventBus?.emit("workflow-phase-complete", {
216
+ phase: "pentesting",
217
+ summary: {
218
+ findingsCount: strikeResult.reportedFindings.length,
219
+ solved: strikeResult.solved,
220
+ operatorSummary: strikeResult.summary
221
+ }
222
+ });
223
+ return {
224
+ findings: [],
225
+ findingsPath: session.findingsPath,
226
+ pocsPath: session.pocsPath,
227
+ reportPath: null,
228
+ reportedFindings: strikeResult.reportedFindings,
229
+ submissionJson: strikeResult.submissionJson,
230
+ solved: strikeResult.solved,
231
+ summary: strikeResult.summary
232
+ };
233
+ }
184
234
  await findingsRegistry.groupByRootCause();
185
235
  const findings = [...findingsRegistry.getFindings()];
236
+ const strikeResult = completed.outcome;
186
237
  const report = buildPentestReport(findings, {
187
238
  target,
188
239
  model,
@@ -9,7 +9,7 @@ import type { SubagentSpawner } from "./offSecAgent/subagentSpawner";
9
9
  import type { EmailAdapterResolver } from "./offSecAgent/tools/email/adapters";
10
10
  import type { UnifiedSandbox } from "./offSecAgent/tools/sandbox";
11
11
  import type { SmsInbox } from "./offSecAgent/tools/smsInbox";
12
- import type { StreamIdFactory } from "./offSecAgent/types";
12
+ import type { FindingPolicy, StreamIdFactory } from "./offSecAgent/types";
13
13
  /**
14
14
  * {@link AgentHooks} with every key required (value types keep their
15
15
  * `| undefined`). Hand-listed, not mapped from {@link AgentHooks}, so that
@@ -18,6 +18,7 @@ import type { StreamIdFactory } from "./offSecAgent/types";
18
18
  * "dropping a hook is a type error".
19
19
  */
20
20
  export interface RequiredAgentHooks {
21
+ findingPolicy: FindingPolicy | undefined;
21
22
  backends: ToolBackends | undefined;
22
23
  subagentSpawner: SubagentSpawner | undefined;
23
24
  languageModelMiddleware: LanguageModelMiddleware | LanguageModelMiddleware[] | undefined;
@@ -37,8 +37,9 @@ export interface AgentDefinition<TOpts extends SpecializedAgentInput, TResult =
37
37
  stopWhen?: (opts: TOpts, state: TState) => StopCondition<ToolSet> | StopCondition<ToolSet>[] | undefined;
38
38
  /** Extra tools this definition injects, merged on top of `opts.extraTools`. */
39
39
  extraTools?: (opts: TOpts, state: TState) => ToolSet | undefined;
40
- /** Produces `consume()`'s typed result from the finished stream. */
41
- resolveResult?: (opts: TOpts, state: TState, streamResult: StreamTextResult<ToolSet, never>) => TResult | Promise<TResult>;
40
+ /** Produces `consume()`'s typed result from the finished stream and, when
41
+ * the response tool executes, its schema-validated result. */
42
+ resolveResult?: (opts: TOpts, state: TState, streamResult: StreamTextResult<ToolSet, never>, validatedResponse?: unknown) => TResult | Promise<TResult>;
42
43
  /** Target URL/host, when this definition derives one instead of taking it verbatim from `opts`. */
43
44
  target?: (opts: TOpts, state: TState) => string | undefined;
44
45
  /** gRPC context forwarded to `spawn_pentest_agent` workers. */
@@ -1,9 +1,11 @@
1
1
  export type { AgentEventMap } from "../../eventBus";
2
2
  export { AgentEventBus } from "../../eventBus";
3
3
  export { OffensiveSecurityAgent } from "./offensiveSecurityAgent";
4
+ /** Runtime marker for hosts that require Apex's externally graded finding policy. */
5
+ export declare const EXTERNAL_FINDING_POLICY_CAPABILITY: "v1";
4
6
  export { BASE_SYSTEM_PROMPT, type BaseSystemPromptOptions, buildBaseSystemPrompt, buildProvidedFilesSection, buildSessionWorkspaceSection, } from "./prompt";
5
7
  export type { AskUserQuestion, AskUserQuestionAnswer, AskUserQuestionsResult, BrowserClickResult, BrowserConsoleResult, BrowserEngine, BrowserEvaluateResult, BrowserFillResult, BrowserNavigateResult, BrowserScreenshotResult, BrowserStorageState, BrowserToolMode, ReportedError, SandboxExecuteOptions, SandboxExecutionResult, SandboxType, ShellExecuteResult, ToolContext, ToolName, UnifiedSandbox, } from "./tools";
6
8
  export { ALL_TOOL_NAMES, ASK_USER_QUESTIONS_TOOL_NAME, AskUserQuestionSchema, addMemory, assertCommandInScope, assertUrlInScope, BROWSER_TOOL_NAMES, checkpointState, checkSandboxPlaywright, completeAuthentication, crawlAuthenticated, createAllTools, createAttackSurfaceReport, createBrowserTools, createBrowserToolset, createEmailToolset, createFile, createReportErrorTool, createResponseTool, createSandboxBrowserTools, createTask, createToolsForNames, createWorkspaceApp, createWorkspaceDomain, createWorkspaceEndpoint, delegateAuth, detectAuthScheme, documentApp, documentEndpoint, documentVulnerability, EMAIL_TOOL_NAMES, EMAIL_TOOL_NAMES_ACTIVE, ensureSandboxBrowser, ensureSandboxPlaywright, executeCommand, extractHostname, extractHostsFromCommand, extractJsEndpoints, FAST_STRIKE_EXCLUDED_TOOL_NAMES, getAllowedHosts, getMemory, getPage, grep, httpRequest, installSandboxPlaywright, isHostAllowed, listFiles, listMemories, listTasksTool, listToolRegistryNames, listWorkspaceApps, listWorkspaceDomains, listWorkspaceEndpoints, PentestReportedError, PerCommandShell, PLAN_MODE_TOOL_NAMES, PlaywrightMcpSession, parseStorageStateResult, probeAuthEndpoints, provideComparisonResults, REPORT_ERROR_TOOL_NAME, RESPONSE_TOOL_NAME, ReportErrorReasonSchema, readFile, readSkill, runAttackSurface, runPentestWorkflow, SandboxBrowserBackend, ScopeViolationError, SEND_EMAIL_TOOL_NAME, SKILL_TOOL_NAMES, SMS_LIST_MESSAGES_TOOL_NAME, SMS_TOOL_NAMES, SMS_TOOL_NAMES_ACTIVE, sessionHasSmsPasswordless, setHeadlessMode, setUserAgent, setViewportSize, spawnCodingAgent, spawnPentestAgent, spawnPentestSwarm, submitPlan, testEndpointVariations, transformScriptToFunction, updateFile, updateTask, updateWorkspaceApp, updateWorkspaceEndpoint, validateDiscovery, webSearch, writePlan, } from "./tools";
7
9
  export type { CheckpointInput, InitRecord, StateCheckpoint, StepRecord, StepTraceWriterOpts, ToolOutputType, TraceRecord, } from "./trace";
8
10
  export { StepTraceWriter } from "./trace";
9
- export { type AgentHooks, type AgentMode, ApexFindingObject, type CommandCancelHandle, type CreateAgentInput, type Finding, type OffensiveSecurityAgentInput, type SpecializedAgentInput, type SystemPentestScope, } from "./types";
11
+ export { type AgentHooks, type AgentMode, ApexFindingObject, type CommandCancelHandle, type CreateAgentInput, type Finding, type FindingPolicy, type OffensiveSecurityAgentInput, type SpecializedAgentInput, type SystemPentestScope, } from "./types";
@@ -4,10 +4,11 @@ import {
4
4
  buildBaseSystemPrompt2,
5
5
  BASE_SYSTEM_PROMPT2,
6
6
  StepTraceWriter2,
7
- OffensiveSecurityAgent2
8
- } from "../../../chunk-r4j8ybn9.js";
9
- import"../../../chunk-3c00n0cy.js";
10
- import"../../../chunk-yrnrbjes.js";
7
+ OffensiveSecurityAgent2,
8
+ EXTERNAL_FINDING_POLICY_CAPABILITY2
9
+ } from "../../../chunk-hys7nemr.js";
10
+ import"../../../chunk-77se1d35.js";
11
+ import"../../../chunk-7tft4b8b.js";
11
12
  import {
12
13
  AgentEventBus2
13
14
  } from "../../../chunk-7gjdygcx.js";
@@ -81,7 +82,7 @@ import {
81
82
  FAST_STRIKE_EXCLUDED_TOOL_NAMES2,
82
83
  PLAN_MODE_TOOL_NAMES2,
83
84
  SKILL_TOOL_NAMES2
84
- } from "../../../chunk-2qsq76xq.js";
85
+ } from "../../../chunk-qkz5sm0d.js";
85
86
  import"../../../chunk-ja7j565c.js";
86
87
  import"../../../chunk-3q89v4xv.js";
87
88
  import {
@@ -107,15 +108,15 @@ import {
107
108
  SandboxBrowserBackend2,
108
109
  createSandboxBrowserTools2
109
110
  } from "../../../chunk-fy3bbbqy.js";
110
- import"../../../chunk-1azdancq.js";
111
+ import"../../../chunk-0dnx79b1.js";
111
112
  import"../../../chunk-t5bt5vn1.js";
112
113
  import"../../../chunk-eb4h4k1f.js";
113
114
  import"../../../chunk-vx228eeq.js";
114
- import"../../../chunk-ba41jh41.js";
115
+ import"../../../chunk-kcw4cpr3.js";
115
116
  import"../../../chunk-8vhr65w3.js";
116
117
  import"../../../chunk-2njv7wz3.js";
117
118
  import"../../../chunk-jdjagvgr.js";
118
- import"../../../chunk-w66ce82a.js";
119
+ import"../../../chunk-8njjwwcw.js";
119
120
  import"../../../chunk-zrbqn62x.js";
120
121
  import"../../../chunk-mv74mq5n.js";
121
122
  import {
@@ -132,6 +133,7 @@ export {
132
133
  BROWSER_TOOL_NAMES2 as BROWSER_TOOL_NAMES,
133
134
  EMAIL_TOOL_NAMES2 as EMAIL_TOOL_NAMES,
134
135
  EMAIL_TOOL_NAMES2 as EMAIL_TOOL_NAMES_ACTIVE,
136
+ EXTERNAL_FINDING_POLICY_CAPABILITY2 as EXTERNAL_FINDING_POLICY_CAPABILITY,
135
137
  FAST_STRIKE_EXCLUDED_TOOL_NAMES2 as FAST_STRIKE_EXCLUDED_TOOL_NAMES,
136
138
  OffensiveSecurityAgent2 as OffensiveSecurityAgent,
137
139
  PLAN_MODE_TOOL_NAMES2 as PLAN_MODE_TOOL_NAMES,
@@ -1,3 +1,4 @@
1
+ import type { FindingPolicy } from "./types";
1
2
  interface SessionPaths {
2
3
  rootPath: string;
3
4
  findingsPath: string;
@@ -20,11 +21,12 @@ interface SessionPaths {
20
21
  * `README.md` manifest.
21
22
  */
22
23
  export declare function buildProvidedFilesSection(sessionRootPath: string, fileWorkspaceRoot?: string): string;
23
- export declare function buildSessionWorkspaceSection(session: SessionPaths, agentCwd: string, activeTools?: readonly string[], fileWorkspaceRoot?: string): string;
24
+ export declare function buildSessionWorkspaceSection(session: SessionPaths, agentCwd: string, activeTools?: readonly string[], fileWorkspaceRoot?: string, findingPolicy?: FindingPolicy): string;
24
25
  /** Options for building the base system prompt. */
25
26
  export interface BaseSystemPromptOptions {
26
27
  /** When true, include the "Stay in the session folder" instruction. Defaults to true. */
27
28
  sandboxMode?: boolean;
29
+ findingPolicy?: FindingPolicy;
28
30
  }
29
31
  export declare function buildBaseSystemPrompt(options?: BaseSystemPromptOptions): string;
30
32
  /**
@@ -13,7 +13,7 @@ import type { AuthenticationAgentInput } from "../specialized/authenticationAgen
13
13
  import type { FindingJudgeInput } from "../specialized/findingJudge";
14
14
  import type { PentestResult, TargetedPentestAgent } from "../specialized/pentest/agent";
15
15
  import type { PlaywrightMcpSession, UnifiedSandbox } from "./tools";
16
- import type { AgentHooks, StreamIdFactory, SystemPentestScope } from "./types";
16
+ import type { AgentHooks, FindingPolicy, StreamIdFactory, SystemPentestScope } from "./types";
17
17
  /** Registry key selecting which child agent {@link SubagentSpawner.spawn} builds. */
18
18
  export type SubagentType = "pentest" | "code" | "whitebox-attack-surface" | "blackbox-attack-surface" | "authentication" | "finding-judge";
19
19
  /** Type-specific construction fields; the `type` also selects the registry entry. */
@@ -61,6 +61,7 @@ export type SubagentSpec = {
61
61
  * @public Consumed by Console's durable subagent runtime.
62
62
  */
63
63
  export interface SpawnRuntime {
64
+ findingPolicy?: FindingPolicy;
64
65
  session: SessionInfo;
65
66
  model: AIModel;
66
67
  authConfig?: AIAuthConfig;
@@ -2,16 +2,16 @@ import {
2
2
  runSpawnedPentestWorker2,
3
3
  inProcessSubagentSpawner2,
4
4
  createInProcessSubagentSpawner2
5
- } from "../../../chunk-3c00n0cy.js";
6
- import"../../../chunk-yrnrbjes.js";
5
+ } from "../../../chunk-77se1d35.js";
6
+ import"../../../chunk-7tft4b8b.js";
7
7
  import"../../../chunk-7gjdygcx.js";
8
8
  import"../../../chunk-b8eq85d2.js";
9
- import"../../../chunk-1azdancq.js";
10
- import"../../../chunk-ba41jh41.js";
9
+ import"../../../chunk-0dnx79b1.js";
10
+ import"../../../chunk-kcw4cpr3.js";
11
11
  import"../../../chunk-8vhr65w3.js";
12
12
  import"../../../chunk-2njv7wz3.js";
13
13
  import"../../../chunk-jdjagvgr.js";
14
- import"../../../chunk-w66ce82a.js";
14
+ import"../../../chunk-8njjwwcw.js";
15
15
  export {
16
16
  createInProcessSubagentSpawner2 as createInProcessSubagentSpawner,
17
17
  inProcessSubagentSpawner2 as inProcessSubagentSpawner,
@@ -92,7 +92,7 @@ import {
92
92
  FAST_STRIKE_EXCLUDED_TOOL_NAMES2,
93
93
  PLAN_MODE_TOOL_NAMES2,
94
94
  SKILL_TOOL_NAMES2
95
- } from "../../../../chunk-2qsq76xq.js";
95
+ } from "../../../../chunk-qkz5sm0d.js";
96
96
  import"../../../../chunk-ja7j565c.js";
97
97
  import"../../../../chunk-3q89v4xv.js";
98
98
  import {
@@ -124,15 +124,15 @@ import {
124
124
  SandboxBrowserBackend2,
125
125
  createSandboxBrowserTools2
126
126
  } from "../../../../chunk-fy3bbbqy.js";
127
- import"../../../../chunk-1azdancq.js";
127
+ import"../../../../chunk-0dnx79b1.js";
128
128
  import"../../../../chunk-t5bt5vn1.js";
129
129
  import"../../../../chunk-eb4h4k1f.js";
130
130
  import"../../../../chunk-vx228eeq.js";
131
- import"../../../../chunk-ba41jh41.js";
131
+ import"../../../../chunk-kcw4cpr3.js";
132
132
  import"../../../../chunk-8vhr65w3.js";
133
133
  import"../../../../chunk-2njv7wz3.js";
134
134
  import"../../../../chunk-jdjagvgr.js";
135
- import"../../../../chunk-w66ce82a.js";
135
+ import"../../../../chunk-8njjwwcw.js";
136
136
  import"../../../../chunk-zrbqn62x.js";
137
137
  import"../../../../chunk-mv74mq5n.js";
138
138
  import"../../../../chunk-bx94rwt5.js";
@@ -1,13 +1,23 @@
1
1
  import { type MemorySummary } from "../../../memory";
2
2
  import type { ToolContext } from "./types";
3
+ type MemoryCursor = Pick<MemorySummary, "createdAt" | "category" | "id">;
3
4
  export type ListMemoriesResult = {
4
5
  success: boolean;
5
6
  error: string;
6
- memories: MemorySummary[];
7
+ memories: Array<MemorySummary & {
8
+ truncated?: true;
9
+ }>;
7
10
  count: number;
11
+ nextCursor: MemoryCursor | null;
8
12
  };
9
13
  export declare function listMemories(ctx: ToolContext): import("ai").Tool<{
10
14
  toolCallDescription: string;
11
15
  category?: "framework" | "app" | "general" | undefined;
12
16
  tag?: string | undefined;
17
+ cursor?: {
18
+ createdAt: string;
19
+ category: "framework" | "app" | "general";
20
+ id: string;
21
+ } | undefined;
13
22
  }, ListMemoriesResult>;
23
+ export {};
@@ -1,4 +1,5 @@
1
1
  import { z } from "zod";
2
+ import type { FindingPolicy } from "../types";
2
3
  export declare const REPORT_ERROR_TOOL_NAME: "report_error";
3
4
  /** Coarse classification of why the agent cannot proceed. */
4
5
  export declare const ReportErrorReasonSchema: z.ZodEnum<{
@@ -17,7 +18,7 @@ export type ReportedError = {
17
18
  * of a successful result it surfaces a blocking error so the caller can turn
18
19
  * the run into a failure (e.g. mark a scan endpoint failed with this message).
19
20
  */
20
- export declare function createReportErrorTool(onError: (error: ReportedError) => void): import("ai").Tool<{
21
+ export declare function createReportErrorTool(onError: (error: ReportedError) => void, findingPolicy?: FindingPolicy): import("ai").Tool<{
21
22
  reason: "other" | "blocked" | "authentication_failed" | "target_unreachable";
22
23
  message: string;
23
24
  }, {
@@ -15,10 +15,27 @@ export declare function runPentestWorkflow(ctx: ToolContext): import("ai").Tool<
15
15
  success: boolean;
16
16
  message: string;
17
17
  totalFindings?: undefined;
18
+ reportedFindings?: undefined;
19
+ objectiveResults?: undefined;
20
+ duration?: undefined;
21
+ findingsPath?: undefined;
22
+ pocsPath?: undefined;
23
+ reportPath?: undefined;
24
+ findingsBySeverity?: undefined;
25
+ } | {
26
+ success: boolean;
27
+ totalFindings: number;
28
+ reportedFindings: string[];
29
+ objectiveResults: {
30
+ objective: string;
31
+ completed: boolean;
32
+ result?: string | undefined;
33
+ }[];
34
+ duration: string;
35
+ message: string;
18
36
  findingsPath?: undefined;
19
37
  pocsPath?: undefined;
20
38
  reportPath?: undefined;
21
- duration?: undefined;
22
39
  findingsBySeverity?: undefined;
23
40
  } | {
24
41
  success: boolean;
@@ -29,4 +46,6 @@ export declare function runPentestWorkflow(ctx: ToolContext): import("ai").Tool<
29
46
  duration: string;
30
47
  findingsBySeverity: Record<string, number>;
31
48
  message: string;
49
+ reportedFindings?: undefined;
50
+ objectiveResults?: undefined;
32
51
  }>;
@@ -30,22 +30,19 @@ export declare function spawnPentestAgent(ctx: ToolContext): import("ai").Tool<{
30
30
  success: boolean;
31
31
  message: string;
32
32
  subagentId?: undefined;
33
- findingsCount?: undefined;
34
- objectiveResults?: undefined;
35
33
  } | {
36
- success: boolean;
37
- subagentId: string;
38
- findingsCount: number;
39
34
  objectiveResults: {
40
35
  objective: string;
41
36
  completed: boolean;
42
37
  result?: string | undefined;
43
38
  }[] | undefined;
44
39
  message: string;
40
+ reportedFindings?: string[] | undefined;
41
+ success: boolean;
42
+ subagentId: string;
43
+ findingsCount: number;
45
44
  } | {
46
45
  success: boolean;
47
46
  subagentId: string;
48
47
  message: string;
49
- findingsCount?: undefined;
50
- objectiveResults?: undefined;
51
48
  }>;
@@ -44,9 +44,15 @@ export declare function spawnPentestSwarm(ctx: ToolContext): import("ai").Tool<{
44
44
  totalFindings: number;
45
45
  failedTargets: number;
46
46
  results: {
47
+ error: string | undefined;
48
+ reportedFindings?: string[] | undefined;
49
+ objectiveResults?: {
50
+ objective: string;
51
+ completed: boolean;
52
+ result?: string | undefined;
53
+ }[] | undefined;
47
54
  target: string;
48
55
  findingsCount: number;
49
- error: string | undefined;
50
56
  }[];
51
57
  message: string;
52
58
  }>;
@@ -11,7 +11,7 @@ import type { ToolBackends } from "../../../tools/backends/types";
11
11
  import type { GrpcPentestContext } from "../../specialized/attackSurface/grpcSchema";
12
12
  import type { SubagentSpawner } from "../subagentSpawner";
13
13
  import type { StepTraceWriter } from "../trace";
14
- import type { StreamIdFactory, SystemPentestScope } from "../types";
14
+ import type { FindingPolicy, StreamIdFactory, SystemPentestScope } from "../types";
15
15
  import type { CallbackListenerRegistry } from "./callbackListener";
16
16
  import type { EmailAdapterResolver } from "./email/adapters";
17
17
  import type { PerCommandShell } from "./perCommandShell";
@@ -26,6 +26,7 @@ import type { SmsInbox } from "./smsInbox";
26
26
  * session or agent internals directly.
27
27
  */
28
28
  export type ToolContext = {
29
+ findingPolicy?: FindingPolicy;
29
30
  attackSurfaceArtifactsPath?: string;
30
31
  /** Session providing paths for findings, POCs, logs, scratchpad, etc. */
31
32
  session: SessionInfo;
@@ -76,6 +76,8 @@ export type Finding = Omit<z.infer<typeof ApexFindingObject>, "credentialIds"> &
76
76
  */
77
77
  /** Agent operating mode that controls which tools are available. */
78
78
  export type AgentMode = "default" | "plan" | "fast-strike";
79
+ /** Selects Apex's native finding judge or a caller-owned evaluation boundary. */
80
+ export type FindingPolicy = "native" | "external";
79
81
  /** Structured authorization envelope for a multi-application System pentest. */
80
82
  export type SystemPentestScope = {
81
83
  systemId: string;
@@ -108,6 +110,8 @@ export type StreamIdFactory = (context: StreamIdFactoryContext) => string;
108
110
  * by forgetting to list it in a hand-written constructor.
109
111
  */
110
112
  export interface AgentHooks {
113
+ /** External grading omits Apex's finding tool and leaves acceptance to the caller. */
114
+ findingPolicy?: FindingPolicy;
111
115
  /** Opt-in shared backend directory for incremental recon endpoint artifacts. */
112
116
  attackSurfaceArtifactsPath?: string;
113
117
  /** Execution backends for fs / command / http / browser / inbox. Unset means local execution. */
@@ -276,10 +280,12 @@ export type OffensiveSecurityAgentInput<TResult = void> = AgentHooks & {
276
280
  *
277
281
  * Receives the completed `StreamTextResult` — at this point all lazy
278
282
  * properties (`.steps`, `.text`, `.response`, etc.) are resolved.
283
+ * When the response tool executes, the optional second argument is its
284
+ * schema-validated result. It is absent if no response was submitted.
279
285
  *
280
286
  * If omitted, `consume()` returns `void`.
281
287
  */
282
- resolveResult?: (streamResult: StreamTextResult<ToolSet, never>) => TResult | Promise<TResult>;
288
+ resolveResult?: (streamResult: StreamTextResult<ToolSet, never>, validatedResponse?: unknown) => TResult | Promise<TResult>;
283
289
  /** The subagent ID if this agent is a subagent */
284
290
  subagentId?: string;
285
291
  /** Display label for the OTel span name / `gen_ai.agent.name`. */
@@ -2,26 +2,26 @@ import {
2
2
  blackboxAttackSurfaceDefinition2,
3
3
  BlackboxAttackSurfaceAgent2,
4
4
  buildBlackboxPrompt2
5
- } from "../../../../chunk-1fy8azee.js";
6
- import"../../../../chunk-acgbyf5h.js";
7
- import"../../../../chunk-r4j8ybn9.js";
8
- import"../../../../chunk-3c00n0cy.js";
9
- import"../../../../chunk-yrnrbjes.js";
5
+ } from "../../../../chunk-fasqtjq1.js";
6
+ import"../../../../chunk-ydxhkgjw.js";
7
+ import"../../../../chunk-hys7nemr.js";
8
+ import"../../../../chunk-77se1d35.js";
9
+ import"../../../../chunk-7tft4b8b.js";
10
10
  import"../../../../chunk-7gjdygcx.js";
11
11
  import"../../../../chunk-b8eq85d2.js";
12
- import"../../../../chunk-2qsq76xq.js";
12
+ import"../../../../chunk-qkz5sm0d.js";
13
13
  import"../../../../chunk-ja7j565c.js";
14
14
  import"../../../../chunk-3q89v4xv.js";
15
15
  import"../../../../chunk-fy3bbbqy.js";
16
- import"../../../../chunk-1azdancq.js";
16
+ import"../../../../chunk-0dnx79b1.js";
17
17
  import"../../../../chunk-t5bt5vn1.js";
18
18
  import"../../../../chunk-eb4h4k1f.js";
19
19
  import"../../../../chunk-vx228eeq.js";
20
- import"../../../../chunk-ba41jh41.js";
20
+ import"../../../../chunk-kcw4cpr3.js";
21
21
  import"../../../../chunk-8vhr65w3.js";
22
22
  import"../../../../chunk-2njv7wz3.js";
23
23
  import"../../../../chunk-jdjagvgr.js";
24
- import"../../../../chunk-w66ce82a.js";
24
+ import"../../../../chunk-8njjwwcw.js";
25
25
  import"../../../../chunk-zrbqn62x.js";
26
26
  import"../../../../chunk-mv74mq5n.js";
27
27
  import"../../../../chunk-q5e23acz.js";
@@ -1,18 +1,18 @@
1
1
  import"../../../../chunk-7gjdygcx.js";
2
- import"../../../../chunk-w66ce82a.js";
2
+ import"../../../../chunk-8njjwwcw.js";
3
3
  import"../../../../chunk-jdjagvgr.js";
4
4
  import"../../../../chunk-2njv7wz3.js";
5
- import"../../../../chunk-ba41jh41.js";
5
+ import"../../../../chunk-kcw4cpr3.js";
6
6
  import"../../../../chunk-8vhr65w3.js";
7
- import"../../../../chunk-r4j8ybn9.js";
7
+ import"../../../../chunk-hys7nemr.js";
8
8
  import"../../../../chunk-fy3bbbqy.js";
9
9
  import"../../../../chunk-mv74mq5n.js";
10
- import"../../../../chunk-yrnrbjes.js";
10
+ import"../../../../chunk-7tft4b8b.js";
11
11
  import"../../../../chunk-b8eq85d2.js";
12
- import"../../../../chunk-1azdancq.js";
13
- import"../../../../chunk-3c00n0cy.js";
12
+ import"../../../../chunk-0dnx79b1.js";
13
+ import"../../../../chunk-77se1d35.js";
14
14
  import"../../../../chunk-t5bt5vn1.js";
15
- import"../../../../chunk-2qsq76xq.js";
15
+ import"../../../../chunk-qkz5sm0d.js";
16
16
  import"../../../../chunk-eb4h4k1f.js";
17
17
  import {
18
18
  EndpointTransportEnum2,
@@ -24,12 +24,12 @@ import"../../../../chunk-ja7j565c.js";
24
24
  import"../../../../chunk-3q89v4xv.js";
25
25
  import"../../../../chunk-zrbqn62x.js";
26
26
  import"../../../../chunk-q5e23acz.js";
27
- import"../../../../chunk-r2dkp4tb.js";
27
+ import"../../../../chunk-5j8pp0xf.js";
28
28
  import {
29
29
  RiskScoreBreakdownSchema2,
30
30
  RiskScoreSchema2
31
31
  } from "../../../../chunk-xpfg2fbk.js";
32
- import"../../../../chunk-acgbyf5h.js";
32
+ import"../../../../chunk-ydxhkgjw.js";
33
33
 
34
34
  // src/core/agents/specialized/attackSurface/schemas.ts
35
35
  import { z } from "zod";