pwn 0.5.682 → 0.5.684

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 (74) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +11 -10
  3. data/documentation/Agent-Tool-Registry.md +13 -9
  4. data/documentation/CLI-Drivers.md +27 -28
  5. data/documentation/Configuration.md +7 -5
  6. data/documentation/Contributing.md +2 -2
  7. data/documentation/Cron.md +11 -7
  8. data/documentation/Diagrams.md +2 -2
  9. data/documentation/General-PWN-Usage.md +1 -1
  10. data/documentation/Home.md +7 -6
  11. data/documentation/How-PWN-Works.md +9 -9
  12. data/documentation/Installation.md +1 -1
  13. data/documentation/Persistence.md +2 -1
  14. data/documentation/Plugins.md +3 -3
  15. data/documentation/Reinforcement-Learning.md +103 -101
  16. data/documentation/SAST.md +1 -1
  17. data/documentation/Session-Workflow.md +152 -0
  18. data/documentation/Sessions.md +2 -1
  19. data/documentation/Troubleshooting.md +2 -2
  20. data/documentation/What-is-PWN.md +3 -3
  21. data/documentation/diagrams/agent-tool-registry.svg +152 -152
  22. data/documentation/diagrams/cron-scheduling.svg +141 -121
  23. data/documentation/diagrams/dot/agent-tool-registry.dot +4 -4
  24. data/documentation/diagrams/dot/cron-scheduling.dot +10 -7
  25. data/documentation/diagrams/dot/driver-framework.dot +1 -1
  26. data/documentation/diagrams/dot/overall-pwn-architecture.dot +4 -4
  27. data/documentation/diagrams/dot/persistence-filesystem.dot +1 -1
  28. data/documentation/diagrams/dot/plugin-ecosystem.dot +2 -2
  29. data/documentation/diagrams/dot/task-summarizer.dot +18 -16
  30. data/documentation/diagrams/driver-framework.svg +1 -1
  31. data/documentation/diagrams/overall-pwn-architecture.svg +93 -93
  32. data/documentation/diagrams/persistence-filesystem.svg +4 -4
  33. data/documentation/diagrams/plugin-ecosystem.svg +101 -100
  34. data/documentation/diagrams/task-summarizer.svg +166 -156
  35. data/documentation/pwn-ai-Agent.md +9 -4
  36. data/lib/pwn/ai/agent/dispatch.rb +52 -1
  37. data/lib/pwn/ai/agent/loop.rb +198 -159
  38. data/lib/pwn/ai/agent/open_goal.rb +83 -0
  39. data/lib/pwn/ai/agent/policy.rb +2 -3
  40. data/lib/pwn/ai/agent/prompt_builder.rb +16 -13
  41. data/lib/pwn/ai/agent/registry.rb +6 -9
  42. data/lib/pwn/ai/agent/tools/sessions.rb +32 -0
  43. data/lib/pwn/ai/agent/tools/skills.rb +56 -0
  44. data/lib/pwn/ai/agent.rb +1 -0
  45. data/lib/pwn/ai/anthropic.rb +0 -1
  46. data/lib/pwn/ai/gemini.rb +0 -1
  47. data/lib/pwn/ai/grok.rb +0 -1
  48. data/lib/pwn/ai/ollama.rb +0 -1
  49. data/lib/pwn/ai/open_ai.rb +0 -1
  50. data/lib/pwn/ai/open_web_ui.rb +0 -1
  51. data/lib/pwn/config.rb +2 -2
  52. data/lib/pwn/cron.rb +18 -5
  53. data/lib/pwn/plugins/repl.rb +43 -1
  54. data/lib/pwn/plugins/tty_spinner.rb +109 -13
  55. data/lib/pwn/sessions.rb +82 -0
  56. data/lib/pwn/version.rb +1 -1
  57. data/spec/integration/persistence_roundtrip_spec.rb +2 -1
  58. data/spec/integration/prompt_builder_spec.rb +3 -3
  59. data/spec/integration/reinforced_feedback_loop_spec.rb +6 -11
  60. data/spec/lib/pwn/ai/agent/dispatch_spec.rb +38 -82
  61. data/spec/lib/pwn/ai/agent/loop_spec.rb +284 -11
  62. data/spec/lib/pwn/ai/agent/open_goal_spec.rb +37 -0
  63. data/spec/lib/pwn/ai/agent/prompt_builder_spec.rb +7 -3
  64. data/spec/lib/pwn/ai/agent/registry_spec.rb +16 -9
  65. data/spec/lib/pwn/ai/agent/tools/sessions_spec.rb +5 -0
  66. data/spec/lib/pwn/ai/agent/tools/skills_spec.rb +16 -0
  67. data/spec/lib/pwn/ai/red_team/test_case_engine_spec.rb +20 -0
  68. data/spec/lib/pwn/cron_spec.rb +13 -3
  69. data/spec/lib/pwn/plugins/repl_spec.rb +26 -0
  70. data/spec/lib/pwn/plugins/tty_spinner_spec.rb +44 -0
  71. data/spec/lib/pwn/sessions_spec.rb +29 -0
  72. data/spec/spec_helper.rb +6 -0
  73. data/third_party/pwn_rdoc.jsonl +28 -1
  74. metadata +4 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8f46629cb3abad0974a4fe9bd5d2936bb42c90e304986261cf0106775ffb8de9
4
- data.tar.gz: 56fc226ba599b541c47e66c38f7e3a6d142c019442a00707db8f9d8d12caee74
3
+ metadata.gz: ea35094f56adb31f1af096c634b0a027aa16825fe596ed34165b1efc0627c279
4
+ data.tar.gz: 42bedb6ce050206f988a3df3d99c84d39896e63ec54d453aa0d625e763600b9e
5
5
  SHA512:
6
- metadata.gz: aadc0dad32c3ac362ee269637c0308a1f89e400c311dd5b69d9a7c2e944cc57698799c85b97c51ea3024207f18703b32735faacf394a7d2e3f91e6945efb724e
7
- data.tar.gz: 748bedcea767a060882928c3697cc96a3ffa5f316cbca209d7e4dc870bcbaef6737ebb582d86b76dcd9c5f6624cd46c6d646b94dec8f0dbcd20af9a1cc0bbdf9
6
+ metadata.gz: da7066b555f86266d022850351074fd8ce266254e746c80f13a84fd631a71040d7e122c6fb1ccbd9ef5c93225b40c22a99651bfb35a05ae26bd60dd56d0208b7
7
+ data.tar.gz: de4d5212171f9bb84122a9141203851245a8fa4e4ca01eb127992b9fce505de4aeb15ed7812cd03bc6aaf71248cfa389fdb41ee280460f24ed7f56b8245b1d77
data/README.md CHANGED
@@ -33,9 +33,9 @@ can run those same methods for you.
33
33
  Red teamers, pentesters, and vulnerability researchers get one place to script
34
34
  and automate instead of gluing together a pile of separate CLIs.
35
35
 
36
- **In numbers:** 66 `PWN::Plugins` · 48 `PWN::SAST` rules · 90 `PWN::AWS`
37
- service wrappers · 22 `PWN::WWW` site drivers · 53 `bin/pwn_*` CLI drivers ·
38
- 6 LLM engines · 13 agent toolsets · 85 LLM-callable tools.
36
+ **In numbers:** 67 `PWN::Plugins` · 48 `PWN::SAST` modules · 90 `PWN::AWS`
37
+ service wrappers · 22 `PWN::WWW` site drivers · 54 executables (`pwn` + 53 `bin/pwn_*`) ·
38
+ 6 LLM engines · 13 agent toolsets · 87 LLM-callable tools.
39
39
 
40
40
  Full page: [What is PWN](documentation/What-is-PWN.md)
41
41
 
@@ -119,11 +119,12 @@ message bus:
119
119
  ![Swarm Multi-Agent](documentation/diagrams/swarm-multi-agent.svg)
120
120
 
121
121
  Long-running turns also show **executive task briefs** (not raw commands) via
122
- `TaskSummarizer`. Every request is first classified as a **general statement**,
123
- a **question**, or an **autonomous goal**. Only autonomous goals get a multi-step
124
- breakdown on submit (`emit_plan!`); statements and questions stay single-turn.
125
- Per-batch `about_to` lines use `tool_counts_phrase` + `intent_phrase` with
126
- `last_brief_fp` duplicate suppression. When recent turns keep hitting the iteration ceiling, the Loop tightens the remaining runway (lower `max_iters` on local engines, text-only tail, no counterfactual fork) so the agent still finishes instead of thrashing.
122
+ `TaskSummarizer`. There is no request type. Every request gets an English
123
+ task compass (`emit_plan!` on submit, `about_to` as `task k/n` before each
124
+ tool batch). Duplicate briefs are suppressed. Budget-hot turns skip extra
125
+ counterfactual forks and only strip tools on the last iteration when the
126
+ original request is already satisfied. Yesterday's scars do not lower this
127
+ request's `max_iters` (default 777).
127
128
 
128
129
  Full pages: [How PWN Works](documentation/How-PWN-Works.md) ·
129
130
  [All data-flow diagrams](documentation/Diagrams.md)
@@ -136,9 +137,9 @@ The complete wiki lives in this repo at **[`documentation/Home.md`](documentatio
136
137
 
137
138
  | Start Here | Entry Points | AI Subsystem | Capabilities |
138
139
  |---|---|---|---|
139
- | [What is PWN](documentation/What-is-PWN.md) | [`pwn` REPL](documentation/pwn-REPL.md) | [AI / LLM Integration](documentation/AI-Integration.md) | [Plugins (66)](documentation/Plugins.md) |
140
+ | [What is PWN](documentation/What-is-PWN.md) | [`pwn` REPL](documentation/pwn-REPL.md) | [AI / LLM Integration](documentation/AI-Integration.md) | [Plugins (67)](documentation/Plugins.md) |
140
141
  | [Why PWN](documentation/Why-PWN.md) | [`pwn-ai` Agent](documentation/pwn-ai-Agent.md) | [Agent Tool Registry](documentation/Agent-Tool-Registry.md) | [SAST (48)](documentation/SAST.md) |
141
- | [How PWN Works](documentation/How-PWN-Works.md) | [CLI Drivers (53)](documentation/CLI-Drivers.md) | [Memory · Skills · Learning](documentation/Skills-Memory-Learning.md) | [AWS (90)](documentation/AWS.md) |
142
+ | [How PWN Works](documentation/How-PWN-Works.md) | [CLI Drivers (54)](documentation/CLI-Drivers.md) | [Memory · Skills · Learning](documentation/Skills-Memory-Learning.md) | [AWS (90)](documentation/AWS.md) |
142
143
  | [Installation](documentation/Installation.md) | [Build a Driver](documentation/Drivers.md) | [Mistakes (neg-feedback)](documentation/Mistakes.md) | [WWW (22)](documentation/WWW.md) |
143
144
  | [General Usage](documentation/General-PWN-Usage.md) | | [Reinforcement Learning](documentation/Reinforcement-Learning.md) | [SDR / Radio](documentation/SDR.md) |
144
145
  | [Configuration](documentation/Configuration.md) | | [Extrospection](documentation/Extrospection.md) | [Hardware](documentation/Hardware.md) |
@@ -6,15 +6,15 @@ toolsets; the JSON-Schema for each tool is what the model actually sees.
6
6
 
7
7
  ![Tool registry](diagrams/agent-tool-registry.svg)
8
8
 
9
- ## Toolsets to tools (13 toolsets · 85 tools)
9
+ ## Toolsets to tools (13 toolsets · 87 tools)
10
10
 
11
11
  | Toolset | Tools | Backed by |
12
12
  |---|---|---|
13
13
  | `terminal` | `shell` | `Open3.capture3` on the host, after `PWN::AI::Agent::ToolGuard` |
14
14
  | `pwn` | `pwn_eval` | `TOPLEVEL_BINDING.eval` in the live REPL process, after `ToolGuard` |
15
15
  | `memory` | `memory_remember` · `memory_recall` · `memory_forget` · `memory_clear` · **`memory_lean`** | `PWN::Memory` → `~/.pwn/memory.json` |
16
- | `skills` | `skill_list` · `skill_view` · `skill_create` · `skill_add_reference` · `skill_delete` · `skill_migrate_legacy` | `~/.pwn/skills/<name>/SKILL.md` (**[agentskills.io](https://agentskills.io) spec**; legacy flat `*.md` auto-migrated) |
17
- | `sessions` | `sessions_list` · `sessions_view` · `sessions_current` · `sessions_delete` · `sessions_stats` · **`sessions_lean`** | `PWN::Sessions` → `~/.pwn/sessions/` |
16
+ | `skills` | **`skills_recall`** · `skill_list` · `skill_view` · `skill_create` · `skill_add_reference` · `skill_delete` · `skill_migrate_legacy` | `~/.pwn/skills/<name>/SKILL.md` (**[agentskills.io](https://agentskills.io) spec**; legacy flat `*.md` auto-migrated) |
17
+ | `sessions` | **`session_recall`** · `sessions_list` · `sessions_view` · `sessions_current` · `sessions_delete` · `sessions_stats` · **`sessions_lean`** | `PWN::Sessions` → `~/.pwn/sessions/` |
18
18
  | `learning` | `learning_note_outcome` · `learning_reflect` · `learning_distill_skill` · `learning_stats` · `learning_outcomes` · `learning_consolidate` · `learning_reset` · `learning_auto_introspect_toggle` · **`learning_gc_stores`** · **`learning_purge_noise`** · **`mistakes_list`** · **`mistakes_record`** · **`mistakes_resolve`** · **`mistakes_reset`** · **`mistakes_lean`** · **`reward_judge`** · **`reward_prm`** · **`reward_sentinel`** · **`reward_preferences`** · **`reward_export_dpo`** · **`reward_warm_sentinel`** · **`reward_scrub_preferences`** · **`reward_preference_balance`** · **`curriculum_practice`** · **`curriculum_train`** · **`curriculum_hindsight`** · **`curriculum_offline_judge`** · **`curriculum_preference_balance`** | `PWN::AI::Agent::Learning` + `Mistakes` + `Reward` + `Curriculum` → `~/.pwn/learning.jsonl` + `~/.pwn/mistakes.json` + `~/.pwn/preferences.jsonl` + `~/.pwn/curriculum/` + `~/.pwn/finetune/` |
19
19
  | `reward` | **`reward_generator_mix`** | `PWN::AI::Agent::Reward.generator_mix` → online preference source-mix controller (`preferences.jsonl`) |
20
20
  | `curriculum` | **`curriculum_practice_kpi`** | `PWN::AI::Agent::Curriculum.practice_kpi` → `~/.pwn/curriculum_kpi.jsonl` |
@@ -56,8 +56,9 @@ user request through as `relevance:`, `Registry.definitions` shrinks the
56
56
  pool to:
57
57
 
58
58
  ```text
59
- CORE_TOOLS = shell · pwn_eval · memory_remember · memory_recall
60
- mistakes_record · mistakes_resolve · learning_note_outcome
59
+ CORE_TOOLS / DEFAULT_PREFERENCE (same list):
60
+ memory_recall · session_recall · skills_recall · pwn_eval · shell
61
+ mistakes_record · mistakes_resolve · learning_note_outcome · memory_remember
61
62
  + top-K keyword-ranked matches for THIS request
62
63
  (ties break on Metrics per-engine success_rate, then
63
64
  ai.agent.tool_preference)
@@ -68,7 +69,7 @@ PWN::AI::Agent::Registry.definitions(relevance: 'nmap sweep 10.0.0.0/8', top_k:
68
69
  PWN::AI::Agent::Registry.rank(query: 'run a shell command') # inspect ranking
69
70
  PWN::AI::Agent::Registry.preference_order # Env / DEFAULT_PREFERENCE
70
71
  PWN::AI::Agent::Registry.toolsets # -> the 13 names above
71
- PWN::AI::Agent::Registry.all.count # -> 85
72
+ PWN::AI::Agent::Registry.all.count # -> 87
72
73
  ```
73
74
 
74
75
  Frontier engines leave `tool_router` off (unless you set it) and receive the
@@ -80,7 +81,7 @@ When keyword fit and other rank scores tie, the registry prefers this
80
81
  default order:
81
82
 
82
83
  ```text
83
- memory_recall · pwn_eval · shell
84
+ memory_recall · session_recall · skills_recall · pwn_eval · shell
84
85
  mistakes_record · mistakes_resolve · learning_note_outcome · memory_remember
85
86
  ```
86
87
 
@@ -88,9 +89,12 @@ Set `ai.agent.tool_preference` in `~/.pwn/pwn.yaml`, or pass `order:` /
88
89
  `preference:` into `Registry.definitions`, `.rank`, or `.apply_preference`.
89
90
  An explicit empty list turns preference off (no Env / default fallback).
90
91
 
92
+ Learned facts and this session are injected (MEMORY / RECENT TURNS), not
93
+ first tools. Preference then lists `pwn_eval` before `shell`. `sessions_view`
94
+ is not a CORE tool. There is no separate ACT_PREFERENCE.
95
+
91
96
  Keyword fit stays the primary signal. Preference is a smaller bonus plus a
92
- stable sort after the router slims the pool, so `memory_recall` wins a
93
- tie against `shell` without hiding a better keyword match.
97
+ stable sort after the router slims the pool.
94
98
 
95
99
  `Policy` uses the same list when it suggests a next action in the prompt.
96
100
 
@@ -9,34 +9,33 @@ without a REPL or an LLM.
9
9
  ## Full list
10
10
 
11
11
  ```text
12
- pwn pwn_mail_agent
13
- pwn_android_war_dialer pwn_msf_postgres_login
14
- pwn_autoinc_version pwn_nessus_cloud_scan_crud
15
- pwn_aws_describe_resources pwn_nessus_cloud_vulnscan
16
- pwn_bdba_groups pwn_nexpose
17
- pwn_bdba_scan pwn_nmap_discover_tcp_udp
18
- pwn_burp_suite_pro_active_rest_api_scan pwn_openvas_vulnscan
19
- pwn_burp_suite_pro_active_scan pwn_pastebin_sample_filter
20
- pwn_char_base64_encoding pwn_phone
21
- pwn_char_dec_encoding pwn_rdoc_to_jsonl
22
- pwn_char_hex_escaped_encoding pwn_sast
23
- pwn_char_html_entity_encoding pwn_serial_check_voicemail
24
- pwn_char_unicode_escaped_encoding pwn_serial_msr206
25
- pwn_char_url_encoding pwn_serial_qualcomm_commands
26
- pwn_crt_sh pwn_serial_son_micro_sm132_rfid
27
- pwn_defectdojo_engagement_create pwn_setup
28
- pwn_defectdojo_importscan pwn_shodan_graphql_introspection
29
- pwn_defectdojo_reimportscan pwn_shodan_search
30
- pwn_diff_csv_files_w_column_exclude pwn_simple_http_server
31
- pwn_domain_reversewhois pwn_web_cache_deception
32
- pwn_fuzz_net_app_proto pwn_www_checkip
33
- pwn_gqrx_scanner pwn_www_uri_buster
34
- pwn_jenkins_create_job pwn_xss_dom_vectors
35
- pwn_jenkins_create_view pwn_zaproxy_active_rest_api_scan
36
- pwn_jenkins_install_plugin pwn_zaproxy_active_scan
37
- pwn_jenkins_thinBackup_aws_s3
38
- pwn_jenkins_update_plugins
39
- pwn_jenkins_useradd
12
+ pwn pwn_jenkins_update_plugins
13
+ pwn_ai_red_team pwn_jenkins_useradd
14
+ pwn_android_war_dialer pwn_mail_agent
15
+ pwn_autoinc_version pwn_msf_postgres_login
16
+ pwn_aws_describe_resources pwn_nessus_cloud_scan_crud
17
+ pwn_bdba_groups pwn_nessus_cloud_vulnscan
18
+ pwn_bdba_scan pwn_nexpose
19
+ pwn_burp_suite_pro_active_rest_api_scan pwn_nmap_discover_tcp_udp
20
+ pwn_burp_suite_pro_active_scan pwn_openvas_vulnscan
21
+ pwn_char_base64_encoding pwn_pastebin_sample_filter
22
+ pwn_char_dec_encoding pwn_phone
23
+ pwn_char_hex_escaped_encoding pwn_rdoc_to_jsonl
24
+ pwn_char_html_entity_encoding pwn_sast
25
+ pwn_char_unicode_escaped_encoding pwn_serial_check_voicemail
26
+ pwn_char_url_encoding pwn_serial_msr206
27
+ pwn_crt_sh pwn_serial_qualcomm_commands
28
+ pwn_defectdojo_engagement_create pwn_serial_son_micro_sm132_rfid
29
+ pwn_defectdojo_importscan pwn_setup
30
+ pwn_defectdojo_reimportscan pwn_shodan_graphql_introspection
31
+ pwn_diff_csv_files_w_column_exclude pwn_shodan_search
32
+ pwn_domain_reversewhois pwn_simple_http_server
33
+ pwn_fuzz_net_app_proto pwn_web_cache_deception
34
+ pwn_gqrx_scanner pwn_www_checkip
35
+ pwn_jenkins_create_job pwn_www_uri_buster
36
+ pwn_jenkins_create_view pwn_xss_dom_vectors
37
+ pwn_jenkins_install_plugin pwn_zaproxy_active_rest_api_scan
38
+ pwn_jenkins_thinBackup_aws_s3 pwn_zaproxy_active_scan
40
39
  ```
41
40
 
42
41
  Run any with `--help` for its flags.
@@ -118,7 +118,7 @@ ai:
118
118
 
119
119
  agent:
120
120
  native_tools: true # Use provider-native tool_calls / function-calling. false → legacy text-parsed tool protocol.
121
- max_iters: 75 # Hard cap on tool-call rounds per user turn. Local engines tighten under budget pressure.
121
+ max_iters: 777 # Hard cap on tool-call rounds per user turn. Scars do not lower it.
122
122
  task_summary: true # Executive task briefs via TaskSummarizer (plan + about_to). false disables.
123
123
  task_summary_every: 5 # When task_summary_verbose: emit Progress every N completed tools.
124
124
  task_summary_interval_s: 8.0 # When verbose: also emit when this many seconds elapsed.
@@ -133,8 +133,10 @@ ai:
133
133
  shell_bash: false # true -> run shell via bash -lc. Default is /bin/sh.
134
134
  plan_first: ~ # Plan-then-act pre-pass. nil = auto (true when ai.active is ollama or openwebui).
135
135
  tool_router: ~ # Dynamic tool-set slimming. nil = auto (true for ollama / openwebui).
136
- tool_preference: # Operator-tunable tool order. Rank bonus + Policy suggested-action list.
136
+ tool_preference: # Same order as CORE_TOOLS: memory_recall, session_recall, skills_recall, pwn_eval, shell, mistakes_record, mistakes_resolve, learning_note_outcome, memory_remember. Current session is injected separately.
137
137
  - memory_recall
138
+ - session_recall
139
+ - skills_recall
138
140
  - pwn_eval
139
141
  - shell
140
142
  - mistakes_record
@@ -251,7 +253,7 @@ targets: # Optional - engagement-scope URLs/hosts. Mer
251
253
 
252
254
  ```ruby
253
255
  PWN::Env[:ai][:active] # => :grok
254
- PWN::Env.dig(:ai, :agent, :max_iters) # => 75
256
+ PWN::Env.dig(:ai, :agent, :max_iters) # => 777
255
257
  PWN::EnvRedacted[:ai][:grok][:key] # => ">>> REDACTED >>> ..."
256
258
 
257
259
  # Edit + re-encrypt + reload without leaving the REPL:
@@ -301,7 +303,7 @@ PWN::Config.refresh_env
301
303
  | Key path | Type | Default | Consumed by | Purpose |
302
304
  |---|---|---|---|---|
303
305
  | `ai.agent.native_tools` | Boolean | `true` | `PWN::Plugins::REPL` (`pwn-ai` cmd) | Use provider-native `tool_calls` / function-calling. `false` falls back to the legacy text-parsed tool protocol. |
304
- | `ai.agent.max_iters` | Integer | `75` | `PWN::AI::Agent::Loop.run`, `PWN::AI::Agent::Swarm` | Hard cap on tool-call rounds per user turn before a forced final answer. When recent turns keep hitting the ceiling, the effective cap is tightened (stricter on local engines than remote) so long multi-step goals keep a usable runway without thrashing. |
306
+ | `ai.agent.max_iters` | Integer | `777` | `PWN::AI::Agent::Loop.run`, `PWN::AI::Agent::Swarm` | Hard cap on tool-call rounds per user turn. Budget-hot scars and overconfidence do not lower this request's runway. |
305
307
  | `ai.agent.task_summary` | Boolean | `true` | `PWN::AI::Agent::TaskSummarizer`, `Loop` | Master switch for executive task briefs (`emit_plan!` / `about_to`). |
306
308
  | `ai.agent.task_summary_every` | Integer | `5` | `TaskSummarizer.every_n` | Verbose progress cadence (tools). |
307
309
  | `ai.agent.task_summary_interval_s` | Float | `8.0` | `TaskSummarizer.interval_s` | Verbose progress cadence (seconds). |
@@ -315,7 +317,7 @@ PWN::Config.refresh_env
315
317
  | `ai.agent.shell_bash` | Boolean | `false` | `PWN::AI::Agent::ToolGuard.shell_bash?` | When true, `shell` runs via `bash -lc` so bash-only syntax is allowed. Default is POSIX `/bin/sh` and bashisms are rejected with a rewrite hint. |
316
318
  | `ai.agent.plan_first` | Boolean \| `nil` | `nil` (auto: `true` when `ai.active` is `ollama` or `openwebui`) | `PWN::AI::Agent::Loop.plan_first` | Plan-then-act pre-pass: the model must emit a numbered tool plan (as an assistant message) *before* it may dispatch anything. Cheap chain-of-thought scaffolding for local models. |
317
319
  | `ai.agent.tool_router` | Boolean \| `nil` | `nil` (auto: `true` for `ollama` / `openwebui`) | `PWN::AI::Agent::Registry.definitions` | Dynamic tool-set slimming: expose only `Registry::CORE_TOOLS` + the top-K keyword-relevant schemas for *this* request. Ties break on historical `Metrics` success rate, then `ai.agent.tool_preference`. |
318
- | `ai.agent.tool_preference` | Array\<String\> | `memory_recall`, `pwn_eval`, `shell`, `mistakes_record`, `mistakes_resolve`, `learning_note_outcome`, `memory_remember` | `PWN::AI::Agent::Registry.preference_order` / `.rank` / `.apply_preference`, `Policy` | Operator-tunable tool order. Keyword fit stays primary; act/recon kinds lead with `shell`/`pwn_eval`. Explicit empty list disables preference. |
320
+ | `ai.agent.tool_preference` | Array\<String\> | `memory_recall`, `session_recall`, `skills_recall`, `pwn_eval`, `shell`, `mistakes_record`, `mistakes_resolve`, `learning_note_outcome`, `memory_remember` | `PWN::AI::Agent::Registry.preference_order` / `.rank` / `.apply_preference`, `Policy` | Same order as `CORE_TOOLS`. Current session is injected as RECENT TURNS. Explicit empty list disables preference. |
319
321
  | `ai.agent.defer_introspect` | Boolean | `true` | `PWN::AI::Agent::TurnFinalizer` | Run `Learning.auto_introspect` on a background thread after the user-visible reply. Specs and cron stay inline. |
320
322
  | `ai.agent.prompt_cache` | Boolean | `true` | `PWN::AI::Agent::PromptCache` | Engine-native prefix cache. Anthropic uses `cache_control`; OpenAI uses `prompt_cache_key`; Grok uses `x-grok-conv-id`; Gemini splits `systemInstruction`. Ollama and Open WebUI have no native prefix-cache field. |
321
323
  | `ai.agent.local_introspect` | Symbol | `failure_only` | `PWN::AI::Agent::Learning.auto_introspect` | End-of-turn introspect policy for local engines: `always` · `failure_only` · `every_n` (with `introspect_every_n`). |
@@ -6,10 +6,10 @@
6
6
  lib/pwn/ # all namespaces
7
7
  lib/pwn/setup.rb # PWN::Setup - doctor/provisioner data tables
8
8
  lib/pwn/migrate.rb # PWN::Migrate - ~/.pwn state doctor / auto-migrator
9
- lib/pwn/plugins/ # 66 plugin modules
9
+ lib/pwn/plugins/ # 67 plugin modules
10
10
  lib/pwn/ai/agent/ # agent core
11
11
  lib/pwn/ai/agent/tools/ # LLM tool registrations
12
- bin/ # 53 pwn_* drivers + pwn (incl. pwn_setup)
12
+ bin/ # 54 executables: 53 pwn_* drivers + pwn (incl. pwn_setup)
13
13
  spec/ # RSpec (incl. conventions_spec)
14
14
  documentation/ # this wiki + diagrams
15
15
  ```
@@ -36,15 +36,19 @@ does not remove existing per-job lines.
36
36
 
37
37
  ## Seeded self-improvement jobs (`PWN::Cron.install_defaults`)
38
38
 
39
- `pwn setup --migrate` (schema `v1`) seeds four jobs into every fresh
39
+ `pwn setup --migrate` (schema `v1`) seeds five jobs into every fresh
40
40
  `~/.pwn/cron/jobs.yml` via `PWN::Cron.install_defaults`:
41
41
 
42
- | Name | Schedule | Ruby |
43
- |---|---|---|
44
- | `curriculum_practice_nightly` | `0 3 * * *` | `PWN::AI::Agent::Curriculum.practice(limit: 3)` |
45
- | `curriculum_offline_judge` | `30 3 * * *` | `PWN::AI::Agent::Curriculum.offline_judge(since_hours: 24, limit: 40)` |
46
- | `curriculum_train_weekly` | `0 4 * * 0` | `PWN::AI::Agent::Curriculum.train_and_gate(dry_run: true)` |
47
- | `learning_consolidate_nightly` | `0 5 * * *` | `PWN::AI::Agent::Learning.consolidate` |
42
+ | Name | Schedule | Enabled | Ruby |
43
+ |---|---|---|---|
44
+ | `curriculum_practice_nightly` | `0 3 * * *` | **no** | `Curriculum.practice(limit: 3)` - opt-in; runs `Loop.run` with real tools |
45
+ | `curriculum_offline_judge` | `30 3 * * *` | **no** | `Curriculum.offline_judge(...)` - opt-in; spends API tokens |
46
+ | `curriculum_train_weekly` | `0 4 * * 0` | **no** | `Curriculum.train_and_gate(dry_run: true)` - opt-in; needs trainer+GPU to actually train |
47
+ | `learning_consolidate_nightly` | `0 5 * * *` | **yes** | `Learning.consolidate` - memory GC |
48
+ | `pwn_stores_lean_nightly` | `15 5 * * *` | **yes** | `Learning.gc_stores!` - lean memory, learning.jsonl, mistakes, policy, sessions |
49
+
50
+ - **practice / judge / train** ship **disabled**. Practice self-plays via `Loop.run` (shell, browsers). Judge hits the live model. Train is a no-op without a LoRA trainer. Enable with `cron_enable` when you want that loop.
51
+ - **consolidate + lean** stay on: they only touch `~/.pwn` files so the injected MEMORY / LEARNING / session tail stays high-signal.
48
52
 
49
53
  - **practice** - top unresolved `Mistakes` under `Reward.judge`; auto-`resolve` with ≥2 holdouts
50
54
  - **offline_judge** - backfill outcome/process labels + plan calibration from PLAN `p(success)=` so `:failure_only` local introspect does not starve the corpus; also runs `Reward.warm_sentinel` so the reward-sentinel window can fill on local hosts
@@ -23,7 +23,7 @@ groups) so lines never criss-cross.
23
23
  [source](diagrams/dot/persistence-filesystem.dot) · doc: [Persistence](Persistence.md)
24
24
  ![persistence-filesystem](diagrams/persistence-filesystem.svg)
25
25
 
26
- ### Plugin Ecosystem (66 modules)
26
+ ### Plugin Ecosystem (67 modules)
27
27
  [source](diagrams/dot/plugin-ecosystem.dot) · doc: [Plugins](Plugins.md)
28
28
  ![plugin-ecosystem](diagrams/plugin-ecosystem.svg)
29
29
 
@@ -68,7 +68,7 @@ groups) so lines never criss-cross.
68
68
  [source](diagrams/dot/ai-integration-tool-calling.dot) · doc: [AI Integration](AI-Integration.md)
69
69
  ![ai-integration-tool-calling](diagrams/ai-integration-tool-calling.svg)
70
70
 
71
- ### Agent Tool Registry (13 toolsets · 85 tools)
71
+ ### Agent Tool Registry (13 toolsets · 87 tools)
72
72
  [source](diagrams/dot/agent-tool-registry.dot) · doc: [Agent Tool Registry](Agent-Tool-Registry.md)
73
73
  ![agent-tool-registry](diagrams/agent-tool-registry.svg)
74
74
 
@@ -24,7 +24,7 @@ See [Installation](Installation.md) for every flag and the
24
24
 
25
25
  ```ruby
26
26
  PWN.help # top-level help
27
- PWN::Plugins.constants.sort # list all 66 plugins
27
+ PWN::Plugins.constants.sort # list all 67 plugins
28
28
  PWN::Plugins::NmapIt.help # per-plugin usage
29
29
  PWN::Setup.check # capability doctor from inside the REPL
30
30
  PWN::Migrate.status # ~/.pwn state-file compatibility rows
@@ -2,8 +2,8 @@
2
2
 
3
3
  > **PWN** (/pōn/) - an open-source offensive-security automation framework and
4
4
  > continuous-security-integration platform written in Ruby.
5
- > 66 plugins · 48 SAST rules · 90 AWS wrappers · 22 WWW drivers · 53 CLI
6
- > drivers · 6 LLM engines · a self-improving multi-agent AI · one REPL.
5
+ > 67 plugins · 48 SAST modules · 90 AWS wrappers · 22 WWW drivers · 54 CLI
6
+ > executables · 6 LLM engines · a self-improving multi-agent AI · one REPL.
7
7
 
8
8
  **Repo root:** `/opt/pwn` · **This wiki:** `/opt/pwn/documentation/` ·
9
9
  **Rebuild diagrams:** `documentation/diagrams/build.sh`
@@ -28,7 +28,7 @@
28
28
  |---|---|
29
29
  | [The `pwn` REPL](pwn-REPL.md) | Pry shell with the whole `PWN::` namespace pre-loaded |
30
30
  | [`pwn-ai` Autonomous Agent](pwn-ai-Agent.md) | Natural-language TUI + `pwn --ai PROMPT` one-shot · **TaskSummarizer** briefs · iteration budget guard |
31
- | [CLI Drivers `bin/pwn_*`](CLI-Drivers.md) | 53 `pwn_*` + `pwn` headless executables for CI/CD |
31
+ | [CLI Drivers `bin/pwn_*`](CLI-Drivers.md) | 54 headless executables (`pwn` + 53 `pwn_*`) for CI/CD |
32
32
  | [Drivers (build your own)](Drivers.md) | Turn a REPL session into a shipped binary |
33
33
 
34
34
  ## 🤖 AI Subsystem (`PWN::AI`)
@@ -36,20 +36,21 @@
36
36
  | | |
37
37
  |---|---|
38
38
  | [AI / LLM Integration](AI-Integration.md) | OpenAI · Anthropic · Grok (OAuth) · Gemini · Ollama · Open WebUI |
39
- | [Agent Tool Registry](Agent-Tool-Registry.md) | 13 toolsets · **85** LLM-callable tools |
39
+ | [Agent Tool Registry](Agent-Tool-Registry.md) | 13 toolsets · **87** LLM-callable tools |
40
40
  | [Memory · Skills · Learning](Skills-Memory-Learning.md) | Introspection - the self-improvement loop |
41
41
  | [Mistakes](Mistakes.md) | **Negative feedback** - fingerprint failures · do-NOT-repeat · `[REPEATING]`/`[REGRESSED]` · inline self-correction |
42
42
  | [Reinforcement Learning](Reinforcement-Learning.md) | **`Reward` + `Curriculum` + `Policy`** - outcome/process judges · preference ledger · self-play practice · live Q / REINFORCE (advisory) · export-ready LoRA gate |
43
43
  | [Extrospection](Extrospection.md) | World-awareness - snapshot · drift · intel · **watch** · **verify** · **rf_tune** · **osint** · serial · telecomm · packet · vision · voice · correlate |
44
44
  | [Swarm (Multi-Agent)](Swarm.md) | Personas · ask · debate · broadcast · shared bus |
45
45
  | [Sessions](Sessions.md) | Transcript persistence + reflection |
46
- | [Cron](Cron.md) | Scheduled autonomous jobs (nightly self-play + weekly weight-loop seeded by default) |
46
+ | [Session Workflow](Session-Workflow.md) | Keywords: `continue` / last session / write-then-read / recon scope |
47
+ | [Cron](Cron.md) | Scheduled jobs. Hygiene seeds on; curriculum practice/judge/train ship off |
47
48
 
48
49
  ## 🧩 Capability Namespaces (`lib/pwn/*`)
49
50
 
50
51
  | | |
51
52
  |---|---|
52
- | [Plugins (66)](Plugins.md) | Every `PWN::Plugins::*` module by category |
53
+ | [Plugins (67)](Plugins.md) | Every `PWN::Plugins::*` module by category |
53
54
  | &nbsp;&nbsp;↳ [BurpSuite](BurpSuite.md) ⭐ | Preferred web proxy / scanner |
54
55
  | &nbsp;&nbsp;↳ [TransparentBrowser](Transparent-Browser.md) | Headless / visible browser automation |
55
56
  | &nbsp;&nbsp;↳ [NmapIt](NmapIt.md) | Network discovery |
@@ -20,16 +20,16 @@ hardware).
20
20
  | `pwn-ai` | `lib/pwn/ai/agent/loop.rb` | Agent TUI inside the REPL |
21
21
  | `pwn --ai PROMPT` | `bin/pwn` | Headless one-shot agent (CI-friendly) |
22
22
  | `pwn setup` | `lib/pwn/setup.rb` · `bin/pwn_setup` | Post-install doctor + capability provisioner + `--migrate` state doctor (also `pwn --setup[=PROFILE]`) |
23
- | `bin/pwn_*` | 53 files | Thin OptionParser wrappers over one plugin each |
24
- | `PWN::Cron` | `lib/pwn/cron.rb` | Scheduled jobs any of the above (nightly self-play + weekly weight-loop seeded by default) |
23
+ | `bin/pwn_*` + `pwn` | 54 files | Thin OptionParser wrappers plus the `pwn` REPL / one-shot agent |
24
+ | `PWN::Cron` | `lib/pwn/cron.rb` | Scheduled jobs. Fresh install seeds hygiene on (`learning_consolidate_nightly`, `pwn_stores_lean_nightly`) and curriculum practice/judge/train off |
25
25
 
26
26
  ## L2 - AI agent core (`lib/pwn/ai/agent/`)
27
27
 
28
28
  | Module | Role |
29
29
  |---|---|
30
- | `Loop` | plan → **TaskSummarizer** briefs → dispatch tool_calls → observe → repeat until final answer; tightens runway when recent turns exhausted the budget |
31
- | **`TaskSummarizer`** | Executive UX: every request gets an English task compass (`emit_plan!` · `about_to` as `task k/n`) no statement/question/goal type |
32
- | `Registry` | JSON-Schema function definitions grouped into 13 **toolsets** · **85 tools** · `CORE_TOOLS` default pool · kind-aware `tool_preference` |
30
+ | `Loop` | plan → **TaskSummarizer** briefs → dispatch tool_calls → observe → repeat until final answer. Scars do not lower `max_iters` (default 777). Last-iter strips tools only when the original request is already satisfied |
31
+ | **`TaskSummarizer`** | Executive UX: every request gets an English task compass (`emit_plan!` · `about_to` as `task k/n`) - no statement/question/goal type |
32
+ | `Registry` | JSON-Schema function definitions grouped into 13 **toolsets** · **87 tools** · `CORE_TOOLS` = `DEFAULT_PREFERENCE` (`memory_recall` · `session_recall` · `skills_recall` · `pwn_eval` · `shell` · `mistakes_record` · `mistakes_resolve` · `learning_note_outcome` · `memory_remember`) |
33
33
  | `Dispatch` / `Result` | execute a tool, capture stdout/value/error/duration |
34
34
  | `PromptBuilder` | inject MEMORY / SKILLS / LEARNING / **KNOWN MISTAKES + FIXES** / METRICS / **POLICY** / EXTROSPECTION / RECENT TURNS |
35
35
  | `Metrics` · `Learning` · `Reflect` · **`Policy`** | **introspection** - how well am I doing? (Policy is live Q / REINFORCE, advisory rank only) |
@@ -45,7 +45,7 @@ call, and [Reinforcement Learning](Reinforcement-Learning.md) for how
45
45
 
46
46
  ## L3 - Capability namespaces (`lib/pwn/*`)
47
47
 
48
- `Plugins` (66) · `SAST` (48) · `WWW` (22) · `AWS` (90) · `SDR` · `Blockchain` ·
48
+ `Plugins` (67) · `SAST` (48) · `WWW` (22) · `AWS` (90) · `SDR` · `Blockchain` ·
49
49
  `Bounty` · `Reports` · `FFI` · `Banner` · **`Setup`** · **`Migrate`**. Each is
50
50
  a plain module of `public_class_method def self.x(opts = {})` methods -
51
51
  callable the same way from the REPL, from `pwn_eval`, or from a driver.
@@ -75,9 +75,9 @@ Q / REINFORCE when the judge scores the turn, and **the prompt blocks**
75
75
  (MEMORY · SKILLS · LEARNING · KNOWN MISTAKES/FIXES · TOOL EFFECTIVENESS ·
76
76
  POLICY · EXTROSPECTION · RECENT TURNS) are re-injected into the next system
77
77
  prompt.
78
- Nightly cron practices the top unresolved Mistakes; weekly cron builds a
79
- LoRA and only promotes it if it beats the previous adapter on that same
80
- mistake set:
78
+ Nightly hygiene cron trims `~/.pwn` stores. Curriculum practice, offline
79
+ judge, and weekly LoRA train ship seeded but disabled; turn them on with
80
+ `cron_enable` when you want that loop:
81
81
 
82
82
  ![Self-improvement loop](diagrams/pwn-ai-feedback-learning-loop.svg)
83
83
 
@@ -293,7 +293,7 @@ Vagrant, CI) picks it up automatically.
293
293
  ```ruby
294
294
  pwn[CURRENT_VERSION]:001 >>> PWN::Setup.check[:ok] # => true
295
295
  pwn[CURRENT_VERSION]:002 >>> PWN::Migrate.needed? # => false
296
- pwn[CURRENT_VERSION]:003 >>> PWN::Plugins.constants.count # => 66
296
+ pwn[CURRENT_VERSION]:003 >>> PWN::Plugins.constants.count # => 67
297
297
  pwn[CURRENT_VERSION]:004 >>> PWN::SAST.constants.count # => 48
298
298
  pwn[CURRENT_VERSION]:005 >>> pwn-ai # launches agent TUI
299
299
  ```
@@ -24,7 +24,8 @@ Every byte PWN remembers between processes lives here.
24
24
  | `extrospection/packet/*.pcap` | `Extrospection` | pcap | `rm -rf` | bounded captures from `extro_packet(action: :capture)` |
25
25
  | `extrospection/voice/*` | `Extrospection` | wav / txt | `rm -rf` | TTS/STT artifacts from `extro_voice` |
26
26
  | `sessions/*.jsonl` | `PWN::Sessions` | JSON-per-line | `sessions_delete` | full transcript per pwn-ai run (with per-step `step_reward` from `Reward.prm`) |
27
- | `cron/jobs.yml` | `PWN::Cron` | YAML | `cron_remove` | scheduled prompt/ruby/script jobs (**seeded** with `curriculum_practice_nightly` + `curriculum_train_weekly`) |
27
+ | `open_goal.json` | `PWN::AI::Agent::OpenGoal` | JSON | delete the file | unfinished host-work request so `continue` / `resume` picks it up |
28
+ | `cron/jobs.yml` | `PWN::Cron` | YAML | `cron_remove` | scheduled jobs. Fresh install seeds hygiene (`learning_consolidate_nightly` + `pwn_stores_lean_nightly` **on**) and curriculum practice/judge/train **off** |
28
29
  | `cron/log/*.log` | `PWN::Cron` | text | rm | last_run output |
29
30
  | `agents.yml` | `PWN::AI::Agent::Swarm` | YAML | edit / `agent_spawn` | persona registry |
30
31
  | `swarm/<id>/bus.jsonl` | `Swarm` | JSON-per-line | rm -rf | append-only multi-agent chat |
@@ -1,4 +1,4 @@
1
- # `PWN::Plugins` - All 66 Modules
1
+ # `PWN::Plugins` - All 67 Modules
2
2
 
3
3
  Every plugin is a plain Ruby module of `public_class_method def self.x(opts = {})`
4
4
  methods with self-documenting `.help`. Source: `lib/pwn/plugins/*.rb`.
@@ -93,7 +93,7 @@ show-source PWN::Plugins::Fuzz.generate
93
93
 
94
94
  ### Utility
95
95
  `FileFu` · `ThreadPool` · `Log` · `PWNLogger` · `Char` · `XXD` · `DetectOS` ·
96
- `CreditCard` · `SSN` · `EIN` · `VIN` · `PS` · `MonkeyPatch` · `REPL`
96
+ `CreditCard` · `SSN` · `EIN` · `VIN` · `PS` · `MonkeyPatch` · `REPL` · `TTYSpinner`
97
97
 
98
98
  ## Full alphabetical list
99
99
 
@@ -104,6 +104,6 @@ HackerOne Hunter IPInfo IRC Jenkins JiraDataCenter JSONPathify Log MailAgent
104
104
  Metasploit MonkeyPatch MSR206 NessusCloud NexposeVulnScan NmapIt OAuth2 OCR
105
105
  OpenAPI OpenVAS Packet PDFParse Pony PS PWNLogger RabbitMQ REPL ScannableCodes
106
106
  Serial Shodan SlackClient Sock Spider SSN ThreadPool Tor TransparentBrowser
107
- TwitterAPI URIScheme Vault VIN Voice Vsphere XXD Zaproxy`
107
+ TTYSpinner TwitterAPI URIScheme Vault VIN Voice Vsphere XXD Zaproxy`
108
108
 
109
109
  [← Home](Home.md) · [Diagrams](Diagrams.md)