@pensar/apex 2.6.1 → 2.7.0-canary.1572d9a4
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-ayreaj6z.js → agent-3g1b578v.js} +6 -5
- package/build/{agent-yby11zaq.js → agent-p8cezgbb.js} +7 -6
- package/build/{agent-runs-g37vkrjr.js → agent-runs-f86emmgg.js} +23 -20
- package/build/agent-vaq31je6.js +14 -0
- package/build/agent-vvdqga09.js +14 -0
- package/build/{apps-xn6km9yn.js → apps-3stwnmen.js} +16 -13
- package/build/{auth-d105wc64.js → auth-7md9kwda.js} +16 -13
- package/build/blackboxAgent-ct8bejef.js +14 -0
- package/build/{blackboxPentest-ps78v3w7.js → blackboxPentest-w2nr4md3.js} +21 -15
- package/build/{cli-c05y640n.js → cli-1j28cbhy.js} +1 -1
- package/build/{cli-d37a42dc.js → cli-2jz2jz06.js} +206 -90
- package/build/{cli-az3xq70v.js → cli-4a8dsz2k.js} +4 -4
- package/build/{cli-qgz1q9g5.js → cli-58781vcf.js} +1192 -1473
- package/build/{cli-gx71jcke.js → cli-7067zzeb.js} +1 -1
- package/build/{cli-3sp6nd8d.js → cli-81smmd5w.js} +5 -5
- package/build/{cli-k2nwxta0.js → cli-8b25dhky.js} +2 -2
- package/build/{cli-fy6vh2a7.js → cli-8sw5zpqz.js} +1 -1
- package/build/{cli-709rvekb.js → cli-cg3ypx5n.js} +14 -7
- package/build/{cli-dpsw2fe6.js → cli-e9v6zg6h.js} +40941 -40172
- package/build/cli-fjxmphg1.js +36 -0
- package/build/{cli-7eea4e2y.js → cli-gzb6qrzh.js} +31 -60
- package/build/{cli-65g6rcat.js → cli-khnf5xrf.js} +2 -1
- package/build/{cli-1ve18npr.js → cli-mdzt2e8j.js} +4 -2
- package/build/{cli-n2en7j5b.js → cli-n8mmw4c4.js} +1 -1
- package/build/cli-pndb7mh9.js +1193 -0
- package/build/cli-px6ehzqx.js +54 -0
- package/build/{cli-xtc2t6me.js → cli-qs4msn6x.js} +111 -47
- package/build/{cli-kb21qhvm.js → cli-rvybdhgn.js} +4 -3
- package/build/{cli-ae8jqxqr.js → cli-v739h7hb.js} +2 -2
- package/build/{cli-ngq9dr8n.js → cli-wm8ech0x.js} +3 -3
- package/build/cli.js +170 -51
- package/build/{config-zpqkd5cz.js → config-e5v1bkh1.js} +1 -1
- package/build/{fastStrike-mcjdvwez.js → fastStrike-efp0rjs3.js} +74 -17
- package/build/{fixes-kytx5dmj.js → fixes-926cw1ej.js} +16 -13
- package/build/{index-n65z6v7b.js → index-3t41p258.js} +7 -6
- package/build/{index-qv4cc65p.js → index-bv09af6g.js} +19 -15
- package/build/{index-je6hcsqr.js → index-bv6dtwse.js} +1 -1
- package/build/{index-4vqdgb42.js → index-jt52ffgn.js} +1657 -1400
- package/build/{index-ns4m4s01.js → index-np405b9e.js} +11 -7
- package/build/{index-r9yjkfrv.js → index-qys178kp.js} +5 -4
- package/build/{index-wqetp6gq.js → index-tpyzq2wq.js} +42 -11
- package/build/{index-fv64eb32.js → index-vrcdyebh.js} +2 -2
- package/build/{index-dr3tg1w3.js → index-z1g8vbtm.js} +1 -1
- package/build/{issues-eb3q9d3a.js → issues-sncyqh14.js} +16 -13
- package/build/{knowledge-fqsvtx0f.js → knowledge-esgvy5ws.js} +16 -13
- package/build/lance-sacfgs1z.js +232 -0
- package/build/lib/{chunk-9yksqgzr.js → chunk-4aevegnc.js} +77 -45
- package/build/lib/{chunk-9tt2021m.js → chunk-4kf4a15q.js} +13 -13
- package/build/lib/{chunk-fy3bbbqy.js → chunk-5avnedwm.js} +7 -1
- package/build/lib/{chunk-bb0ekhkw.js → chunk-5nz5tk3p.js} +76 -22
- package/build/lib/{chunk-4hwzqthr.js → chunk-7s8e5wrd.js} +3 -2
- package/build/lib/{chunk-yrnrbjes.js → chunk-85kpxwzs.js} +4 -2
- package/build/lib/{chunk-mg03jdmt.js → chunk-9jkzk9nc.js} +1 -1
- package/build/lib/{chunk-r4j8ybn9.js → chunk-9wwts6r6.js} +824 -77
- package/build/lib/{chunk-nhfax4gb.js → chunk-bxznzxdy.js} +5 -1
- package/build/lib/{chunk-r2dkp4tb.js → chunk-cqxm95md.js} +1 -1
- package/build/lib/{chunk-w66ce82a.js → chunk-e3agqspc.js} +12 -4
- package/build/lib/{chunk-ba41jh41.js → chunk-eh5yw385.js} +1137 -333
- package/build/lib/{chunk-1azdancq.js → chunk-ewc9r84m.js} +5 -1
- package/build/lib/{chunk-2njv7wz3.js → chunk-hbyxyxdc.js} +4 -0
- package/build/lib/{chunk-e8yy2k73.js → chunk-jhhwts6w.js} +28 -2
- package/build/lib/{chunk-1jvwqnem.js → chunk-kbxbd1kn.js} +108 -44
- package/build/lib/{chunk-7pwa92rn.js → chunk-mph5fvk7.js} +1 -1
- package/build/lib/chunk-psc23epq.js +107 -0
- package/build/lib/{chunk-acgbyf5h.js → chunk-qxad7qjd.js} +4 -2
- package/build/lib/{chunk-3c00n0cy.js → chunk-r0v3vvgm.js} +54 -33
- package/build/lib/{chunk-1yct6cra.js → chunk-rt13120a.js} +1 -1
- package/build/lib/{chunk-v3dk9j7k.js → chunk-sgya016v.js} +93 -22
- package/build/lib/{chunk-1fy8azee.js → chunk-txef92hq.js} +1 -1
- package/build/lib/{chunk-2qsq76xq.js → chunk-vcd90qrn.js} +189 -90
- package/build/lib/{chunk-7gjdygcx.js → chunk-vwr9w3ab.js} +2 -0
- package/build/lib/{chunk-z137x08b.js → chunk-wf6ak0m3.js} +92 -70
- package/build/lib/{chunk-xhdpgpkm.js → chunk-xft0ms9j.js} +2 -2
- package/build/lib/core/agents/agentRuntime.d.ts +3 -1
- package/build/lib/core/agents/defineAgent.d.ts +3 -2
- package/build/lib/core/agents/lance.d.ts +153 -0
- package/build/lib/core/agents/lanceJudge.d.ts +3 -0
- package/build/lib/core/agents/offSecAgent/index.d.ts +3 -1
- package/build/lib/core/agents/offSecAgent/index.js +16 -14
- package/build/lib/core/agents/offSecAgent/offensiveSecurityAgent.d.ts +4 -0
- package/build/lib/core/agents/offSecAgent/prompt.d.ts +3 -1
- package/build/lib/core/agents/offSecAgent/subagentSpawner.d.ts +18 -2
- package/build/lib/core/agents/offSecAgent/subagentSpawner.js +10 -8
- package/build/lib/core/agents/offSecAgent/toolExecutionContext.d.ts +3 -0
- package/build/lib/core/agents/offSecAgent/toolLifecycle.d.ts +1 -0
- package/build/lib/core/agents/offSecAgent/tools/index.js +10 -6
- 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 +6 -3
- package/build/lib/core/agents/offSecAgent/tools/whiteboxCandidates.d.ts +2 -2
- package/build/lib/core/agents/offSecAgent/types.d.ts +19 -3
- package/build/lib/core/agents/specialized/attackSurface/blackboxAgent.js +13 -13
- package/build/lib/core/agents/specialized/attackSurface/schemas.js +12 -12
- package/build/lib/core/agents/specialized/authenticationAgent/index.js +14 -14
- package/build/lib/core/agents/specialized/codeAgent/agent.js +13 -13
- package/build/lib/core/agents/specialized/codeAgent/prompts.d.ts +1 -0
- package/build/lib/core/agents/specialized/cvssScorer/index.d.ts +2 -1
- package/build/lib/core/agents/specialized/findingJudge/agent.js +11 -11
- package/build/lib/core/agents/specialized/findingJudge/index.d.ts +2 -1
- package/build/lib/core/agents/specialized/findingJudge/index.js +4 -4
- package/build/lib/core/agents/specialized/patching/index.js +14 -14
- package/build/lib/core/agents/specialized/pentest/agent.d.ts +18 -4
- package/build/lib/core/agents/specialized/pentest/agent.js +15 -13
- package/build/lib/core/agents/specialized/whiteboxAttackSurface/endpointDocumentationAgent.d.ts +2 -1
- package/build/lib/core/agents/specialized/whiteboxAttackSurface/index.js +13 -13
- package/build/lib/core/ai/ai.d.ts +29 -70
- package/build/lib/core/ai/ai.js +5 -3
- package/build/lib/core/ai/index.d.ts +1 -0
- package/build/lib/core/ai/index.js +16 -4
- package/build/lib/core/ai/models/claude-capabilities.d.ts +3 -2
- package/build/lib/core/ai/models/concentrate.d.ts +1 -0
- package/build/lib/core/ai/models/index.d.ts +1 -1
- package/build/lib/core/ai/providers/concentrate.d.ts +1 -0
- package/build/lib/core/ai/reasoning.d.ts +44 -0
- package/build/lib/core/ai/utils.d.ts +2 -0
- package/build/lib/core/ai/utils.js +5 -3
- package/build/lib/core/api/index.d.ts +6 -0
- package/build/lib/core/api/index.js +32 -23
- package/build/lib/core/api/lance.d.ts +6 -0
- package/build/lib/core/api/offesecAgent.d.ts +1 -0
- package/build/lib/core/api/reasoning.d.ts +12 -0
- package/build/lib/core/api/targetedPentest.d.ts +1 -0
- package/build/lib/core/api/targetedPentest.js +14 -14
- package/build/lib/core/cli/reasoning.d.ts +4 -0
- package/build/lib/core/config/config.d.ts +10 -2
- package/build/lib/core/config/customProviders.d.ts +11 -0
- package/build/lib/core/config/index.js +1 -1
- package/build/lib/core/eventBus.js +1 -1
- package/build/lib/core/findings/registry.d.ts +3 -1
- package/build/lib/core/findings/registry.js +4 -4
- package/build/lib/core/observability/index.js +1 -1
- package/build/lib/core/observability/telemetry.d.ts +4 -0
- package/build/lib/core/session/index.d.ts +47 -0
- package/build/lib/core/session/index.js +6 -4
- package/build/lib/core/session/persistence.d.ts +7 -0
- package/build/lib/core/session/persistence.js +8 -4
- package/build/lib/core/tools/backends/index.js +1 -1
- package/build/lib/core/tools/backends/resolve.d.ts +1 -0
- package/build/lib/core/workflows/fastStrike.d.ts +3 -1
- package/build/lib/core/workflows/pentest.d.ts +12 -2
- package/build/lib/core/workflows/pentest.js +19 -19
- package/build/lib/core/workflows/seams.js +5 -5
- package/build/lib/core/workflows/threatModel.d.ts +1 -0
- package/build/lib/core/workflows/whiteboxAttackSurface.d.ts +6 -4
- package/build/lib/core/workflows/whiteboxAttackSurface.js +15 -15
- package/build/lib/index.js +25 -25
- package/build/{logs-x62b7hk1.js → logs-bcbjpjp6.js} +16 -13
- package/build/{native-rollout-evidence-c9yhfqcs.js → native-rollout-evidence-rph1774m.js} +5 -5
- package/build/offesecAgent-81h1p6ee.js +32 -0
- package/build/pentest-2q20q6n1.js +23 -0
- package/build/{pentests-e0f32aqx.js → pentests-jgw031mc.js} +16 -13
- package/build/recordedRunClient-6axj6fba.js +11 -0
- package/build/subagentSpawner-a861gvt0.js +12 -0
- package/build/targetedPentest-6yxznt7s.js +91 -0
- package/build/{targets-xj9g3q0z.js → targets-bjah19dp.js} +16 -13
- package/build/threatModel-739kpexm.js +24 -0
- package/build/{uninstall-7s784q4a.js → uninstall-yxrn9edt.js} +1 -1
- package/build/{upload-4gvhwmvr.js → upload-34ewrjp5.js} +4 -4
- package/build/{utils-cjrz64pc.js → utils-fzm66efw.js} +5 -5
- package/package.json +2 -1
- package/src/cli/issues.test.ts +17 -1
- package/src/cli/lance-verifier.test.ts +57 -0
- package/src/cli/lance-verifier.ts +73 -0
- package/src/cli/lance.test.ts +71 -0
- package/src/cli/lance.ts +48 -0
- package/src/cli.ts +109 -19
- package/src/core/agents/agentRuntime.test.ts +42 -0
- package/src/core/agents/agentRuntime.ts +7 -2
- package/src/core/agents/defineAgent.ts +3 -1
- package/src/core/agents/lance.test.ts +421 -0
- package/src/core/agents/lance.ts +701 -0
- package/src/core/agents/lanceJudge.test.ts +166 -0
- package/src/core/agents/lanceJudge.ts +115 -0
- package/src/core/agents/offSecAgent/index.ts +3 -0
- package/src/core/agents/offSecAgent/interruptedStepFinalization.test.ts +51 -0
- package/src/core/agents/offSecAgent/lance.test.ts +188 -0
- package/src/core/agents/offSecAgent/offensiveSecurityAgent.test.ts +92 -5
- package/src/core/agents/offSecAgent/offensiveSecurityAgent.ts +244 -41
- 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.hooks.test.ts +11 -3
- package/src/core/agents/offSecAgent/subagentSpawner.reasoning.test.ts +167 -0
- package/src/core/agents/offSecAgent/subagentSpawner.ts +82 -28
- package/src/core/agents/offSecAgent/toolExecutionContext.test.ts +230 -0
- package/src/core/agents/offSecAgent/toolExecutionContext.ts +56 -0
- package/src/core/agents/offSecAgent/toolLifecycle.ts +2 -0
- package/src/core/agents/offSecAgent/tools/delegateAuth.ts +4 -2
- package/src/core/agents/offSecAgent/tools/documentFinding.test.ts +9 -4
- package/src/core/agents/offSecAgent/tools/documentFinding.ts +10 -9
- 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 +7 -4
- package/src/core/agents/offSecAgent/tools/runPentestWorkflow.test.ts +57 -0
- package/src/core/agents/offSecAgent/tools/runPentestWorkflow.ts +21 -1
- package/src/core/agents/offSecAgent/tools/runWhiteboxScan.ts +5 -2
- package/src/core/agents/offSecAgent/tools/spawnCodingAgent.ts +50 -67
- package/src/core/agents/offSecAgent/tools/spawnPentestAgent.test.ts +79 -3
- package/src/core/agents/offSecAgent/tools/spawnPentestAgent.ts +36 -16
- package/src/core/agents/offSecAgent/tools/spawnPentestSwarm.ts +28 -5
- package/src/core/agents/offSecAgent/tools/threatModelGenerator.ts +4 -3
- package/src/core/agents/offSecAgent/tools/types.ts +12 -2
- 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 +22 -1
- 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/cvssScorer/index.test.ts +2 -1
- package/src/core/agents/specialized/cvssScorer/index.ts +3 -0
- package/src/core/agents/specialized/findingJudge/index.ts +6 -0
- package/src/core/agents/specialized/pentest/agent.test.ts +155 -0
- package/src/core/agents/specialized/pentest/agent.ts +181 -52
- package/src/core/agents/specialized/pentest/results.test.ts +59 -4
- package/src/core/agents/specialized/whiteboxAttackSurface/endpointDocumentationAgent.concurrency.test.ts +59 -2
- package/src/core/agents/specialized/whiteboxAttackSurface/endpointDocumentationAgent.hooks.test.ts +127 -0
- package/src/core/agents/specialized/whiteboxAttackSurface/endpointDocumentationAgent.ts +74 -68
- package/src/core/ai/ai.durability-hooks.test.ts +25 -7
- package/src/core/ai/ai.lance.test.ts +581 -0
- package/src/core/ai/ai.operator-context.bench.test.ts +1390 -0
- package/src/core/ai/ai.recorded-context.test.ts +89 -8
- package/src/core/ai/ai.test.ts +81 -59
- package/src/core/ai/ai.ts +453 -327
- package/src/core/ai/compactionTelemetry.test.ts +69 -17
- package/src/core/ai/index.ts +11 -0
- 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/concentrate.ts +52 -0
- package/src/core/ai/models/index.ts +25 -4
- package/src/core/ai/models/models.test.ts +179 -7
- package/src/core/ai/models/openrouter-reasoning.json +219 -0
- package/src/core/ai/models/openrouter.ts +43 -1
- 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/concentrate.test.ts +31 -0
- package/src/core/ai/providers/concentrate.ts +11 -0
- package/src/core/ai/providers/custom.test.ts +74 -0
- package/src/core/ai/providers/custom.ts +3 -1
- package/src/core/ai/providers/gateway-models.test.ts +16 -6
- package/src/core/ai/providers/pensarFormatters.ts +8 -1
- package/src/core/ai/reasoning.test.ts +313 -0
- package/src/core/ai/reasoning.ts +500 -0
- package/src/core/ai/streamIdleTimeout.test.ts +21 -0
- package/src/core/ai/utils.native-rollout-evidence.test.ts +21 -8
- package/src/core/ai/utils.ts +269 -163
- package/src/core/api/attackSurface.ts +1 -0
- package/src/core/api/blackboxPentest.ts +9 -1
- package/src/core/api/index.ts +17 -0
- package/src/core/api/lance.ts +23 -0
- package/src/core/api/offesecAgent.test.ts +51 -0
- package/src/core/api/offesecAgent.ts +15 -1
- package/src/core/api/reasoning.test.ts +213 -0
- package/src/core/api/reasoning.ts +44 -0
- package/src/core/api/recordedRun.loop.test.ts +5 -1
- package/src/core/api/targetedPentest.test.ts +14 -2
- package/src/core/api/targetedPentest.ts +52 -5
- package/src/core/cli/reasoning.test.ts +149 -0
- package/src/core/cli/reasoning.ts +95 -0
- package/src/core/config/config.test.ts +35 -0
- package/src/core/config/config.ts +11 -0
- package/src/core/config/customProviders.ts +21 -2
- package/src/core/eventBus.ts +1 -0
- package/src/core/findings/registry.test.ts +9 -1
- package/src/core/findings/registry.ts +6 -0
- package/src/core/observability/telemetry.test.ts +131 -79
- package/src/core/observability/telemetry.ts +5 -0
- package/src/core/runtime/sqliteRunObservation.test.ts +1 -1
- package/src/core/session/index.ts +38 -0
- package/src/core/session/persistence.test.ts +62 -0
- package/src/core/session/persistence.ts +56 -0
- package/src/core/tools/backends/resolve.ts +7 -0
- package/src/core/tools/backends/whiteboxJobs.test.ts +9 -8
- 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 +106 -11
- package/src/core/workflows/pentest.test.ts +104 -0
- package/src/core/workflows/pentest.ts +128 -7
- package/src/core/workflows/seams.test.ts +13 -0
- package/src/core/workflows/seams.ts +5 -1
- package/src/core/workflows/threatModel.ts +2 -0
- package/src/core/workflows/whiteboxAttackSurface.test.ts +74 -2
- package/src/core/workflows/whiteboxAttackSurface.ts +102 -73
- package/src/tui/command-registry.test.ts +12 -0
- package/src/tui/command-registry.ts +10 -0
- package/src/tui/components/chat/config-view.tsx +6 -10
- package/src/tui/components/chat/home-view.tsx +2 -2
- package/src/tui/components/chat/input-area.tsx +2 -2
- 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 +164 -0
- package/src/tui/components/commands/advanced-settings.test.ts +34 -0
- package/src/tui/components/commands/advanced-settings.tsx +220 -31
- package/src/tui/components/commands/models-display.tsx +7 -1
- package/src/tui/components/model-picker/ModelPicker.tsx +65 -103
- package/src/tui/components/model-picker/ModelPickerDialog.tsx +8 -14
- package/src/tui/components/model-picker/__tests__/reasoning-control.tsx +162 -0
- package/src/tui/components/model-picker/reasoning-control.test.ts +15 -0
- package/src/tui/components/operator-dashboard/index.tsx +166 -50
- package/src/tui/components/operator-dashboard/logic.test.ts +144 -2
- package/src/tui/components/operator-dashboard/logic.ts +54 -3
- 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/agent.tsx +32 -79
- package/src/tui/context/route.tsx +2 -0
- package/src/tui/index.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/blackboxAgent-s56sgx9b.js +0 -13
- package/build/cli-g06s7edq.js +0 -11
- package/build/lib/chunk-z96pbjhd.js +0 -56
- package/build/offesecAgent-5whnpeta.js +0 -22
- package/build/pentest-e61hc38s.js +0 -22
- package/build/recordedRunClient-dp032c32.js +0 -11
- package/build/targetedPentest-rcbs4nvp.js +0 -57
- package/build/threatModel-jkxfa40s.js +0 -21
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import {
|
|
2
|
+
OffensiveSecurityAgent
|
|
3
|
+
} from "./cli-58781vcf.js";
|
|
4
|
+
import {
|
|
5
|
+
startAgentExecution,
|
|
6
|
+
resolveRootReasoning,
|
|
7
|
+
persistRootReasoningOverride
|
|
8
|
+
} from "./cli-fjxmphg1.js";
|
|
9
|
+
|
|
10
|
+
// src/core/api/offesecAgent.ts
|
|
11
|
+
async function runOffensiveSecurityAgent2(input) {
|
|
12
|
+
const resolved = resolveRootReasoning(input);
|
|
13
|
+
const persisted = persistRootReasoningOverride(input);
|
|
14
|
+
input = persisted ? { ...resolved, session: await persisted } : resolved;
|
|
15
|
+
const agent = input.session ? new OffensiveSecurityAgent(input) : await OffensiveSecurityAgent.create(input);
|
|
16
|
+
input.onSessionReady?.(agent.session);
|
|
17
|
+
await startAgentExecution(agent).result;
|
|
18
|
+
return {
|
|
19
|
+
streamResult: agent.streamResult,
|
|
20
|
+
session: agent.session,
|
|
21
|
+
...agent.lanceRuntime ? { lance: agent.lanceRuntime.metrics(input.model) } : {}
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
function createOffensiveSecurityAgentClient2() {
|
|
25
|
+
const controller = new AbortController;
|
|
26
|
+
let started = false;
|
|
27
|
+
return {
|
|
28
|
+
run(input) {
|
|
29
|
+
if (started) {
|
|
30
|
+
throw new Error("Offensive security agent client already started a run — create a new client per run");
|
|
31
|
+
}
|
|
32
|
+
started = true;
|
|
33
|
+
return runOffensiveSecurityAgent2({
|
|
34
|
+
...input,
|
|
35
|
+
abortSignal: controller.signal
|
|
36
|
+
});
|
|
37
|
+
},
|
|
38
|
+
abort() {
|
|
39
|
+
controller.abort();
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// src/core/api/lance.ts
|
|
45
|
+
async function runLance(input) {
|
|
46
|
+
const result = await runOffensiveSecurityAgent2({
|
|
47
|
+
...input,
|
|
48
|
+
mode: "lance",
|
|
49
|
+
activeTools: []
|
|
50
|
+
});
|
|
51
|
+
return { session: result.session, result: result.lance };
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export { runOffensiveSecurityAgent2, createOffensiveSecurityAgentClient2, runLance };
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
|
-
collectCommand,
|
|
3
|
-
windowsProgramInvocation,
|
|
4
|
-
SANDBOX_ARTIFACTS_ROOT,
|
|
5
2
|
isMemoryEnabled,
|
|
6
3
|
readPlan,
|
|
4
|
+
collectCommand,
|
|
5
|
+
windowsProgramInvocation,
|
|
6
|
+
sandboxArtifactsRoot,
|
|
7
7
|
REPORT_ERROR_TOOL_NAME,
|
|
8
8
|
createReportErrorTool,
|
|
9
9
|
PentestReportedError
|
|
10
|
-
} from "./cli-
|
|
10
|
+
} from "./cli-58781vcf.js";
|
|
11
11
|
import {
|
|
12
12
|
GOOGLE_SIGNIN_PROMPT_GUIDANCE,
|
|
13
13
|
browserEngineForGoogleSignIn
|
|
@@ -18,15 +18,15 @@ import {
|
|
|
18
18
|
import {
|
|
19
19
|
AgentRuntime,
|
|
20
20
|
defineAgent
|
|
21
|
-
} from "./cli-
|
|
21
|
+
} from "./cli-mdzt2e8j.js";
|
|
22
22
|
import {
|
|
23
23
|
hasToolCall,
|
|
24
24
|
init_dist,
|
|
25
|
-
scopedLogger,
|
|
26
|
-
init_lazyLogger,
|
|
27
25
|
createLogger,
|
|
28
|
-
init_structured
|
|
29
|
-
|
|
26
|
+
init_structured,
|
|
27
|
+
scopedLogger,
|
|
28
|
+
init_lazyLogger
|
|
29
|
+
} from "./cli-e9v6zg6h.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
|
-
const findingsPath = sandboxed ? `${
|
|
140
|
-
const findings = sandboxed && opts.backends ? await loadSandboxFindings(opts.backends, findingsPath, opts.abortSignal) : loadFindings(findingsPath);
|
|
157
|
+
const findingsPath = sandboxed ? `${sandboxArtifactsRoot(opts.session)}/findings` : opts.session.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
|
-
pocsPath: sandboxed ? `${
|
|
162
|
+
pocsPath: sandboxed ? `${sandboxArtifactsRoot(opts.session)}/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"] : [],
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
AgentRuntime,
|
|
3
3
|
defineAgent
|
|
4
|
-
} from "./cli-
|
|
4
|
+
} from "./cli-mdzt2e8j.js";
|
|
5
5
|
import {
|
|
6
6
|
stepCountIs2,
|
|
7
7
|
init_dist
|
|
8
|
-
} from "./cli-
|
|
8
|
+
} from "./cli-e9v6zg6h.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,10 +4,10 @@ import {
|
|
|
4
4
|
openSqliteRunStore,
|
|
5
5
|
resolveWorkerEndpoint,
|
|
6
6
|
workerRequest
|
|
7
|
-
} from "./cli-
|
|
7
|
+
} from "./cli-gzb6qrzh.js";
|
|
8
8
|
import {
|
|
9
9
|
launchLocalWorker
|
|
10
|
-
} from "./cli-
|
|
10
|
+
} from "./cli-7067zzeb.js";
|
|
11
11
|
|
|
12
12
|
// src/core/runtime/recordedRunClient.ts
|
|
13
13
|
import { setTimeout as delay } from "node:timers/promises";
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
EndpointTransportEnum,
|
|
3
3
|
GrpcEndpointMetadataSchema
|
|
4
|
-
} from "./cli-
|
|
4
|
+
} from "./cli-58781vcf.js";
|
|
5
5
|
import {
|
|
6
6
|
AgentRuntime,
|
|
7
7
|
defineAgent
|
|
8
|
-
} from "./cli-
|
|
8
|
+
} from "./cli-mdzt2e8j.js";
|
|
9
9
|
import {
|
|
10
10
|
stepCountIs2,
|
|
11
11
|
init_dist
|
|
12
|
-
} from "./cli-
|
|
12
|
+
} from "./cli-e9v6zg6h.js";
|
|
13
13
|
import {
|
|
14
14
|
tool
|
|
15
15
|
} from "./cli-pwm29ks7.js";
|