@vigolium/piolium 0.0.1

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 (271) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +117 -0
  3. package/agents/access-auditor.md +300 -0
  4. package/agents/assumption-breaker.md +154 -0
  5. package/agents/attack-designer.md +116 -0
  6. package/agents/code-scanner.md +139 -0
  7. package/agents/concurrency-auditor.md +238 -0
  8. package/agents/confirm-writer.md +257 -0
  9. package/agents/context-reviewer.md +274 -0
  10. package/agents/cross-verifier.md +165 -0
  11. package/agents/cve-scout.md +381 -0
  12. package/agents/env-builder.md +282 -0
  13. package/agents/env-profiler.md +205 -0
  14. package/agents/evidence-collector.md +140 -0
  15. package/agents/finding-grader.md +142 -0
  16. package/agents/finding-writer.md +148 -0
  17. package/agents/flow-tracer.md +106 -0
  18. package/agents/goal-backtracer.md +146 -0
  19. package/agents/history-miner.md +467 -0
  20. package/agents/independent-verifier.md +118 -0
  21. package/agents/intent-mapper.md +183 -0
  22. package/agents/longshot-collector.md +128 -0
  23. package/agents/longshot-prober.md +126 -0
  24. package/agents/patch-auditor.md +73 -0
  25. package/agents/poc-author.md +124 -0
  26. package/agents/poc-runner.md +194 -0
  27. package/agents/probe-lead.md +269 -0
  28. package/agents/red-challenger.md +101 -0
  29. package/agents/report-composer.md +208 -0
  30. package/agents/review-adjudicator.md +216 -0
  31. package/agents/spec-auditor.md +155 -0
  32. package/agents/taint-tracer.md +265 -0
  33. package/agents/test-locator.md +209 -0
  34. package/agents/threat-modeler.md +132 -0
  35. package/agents/variant-scanner.md +108 -0
  36. package/agents/variant-spotter.md +110 -0
  37. package/bin/piolium.mjs +376 -0
  38. package/extensions/piolium/_vendor/yaml.bundle.d.mts +6 -0
  39. package/extensions/piolium/_vendor/yaml.bundle.mjs +139 -0
  40. package/extensions/piolium/agent-runner.ts +322 -0
  41. package/extensions/piolium/agents.ts +266 -0
  42. package/extensions/piolium/audit-state.ts +522 -0
  43. package/extensions/piolium/bundled-resources.ts +97 -0
  44. package/extensions/piolium/candidate-scan.ts +966 -0
  45. package/extensions/piolium/command-target.ts +177 -0
  46. package/extensions/piolium/console-stream.ts +57 -0
  47. package/extensions/piolium/export-results.ts +380 -0
  48. package/extensions/piolium/findings.ts +448 -0
  49. package/extensions/piolium/heartbeat.ts +182 -0
  50. package/extensions/piolium/help.ts +234 -0
  51. package/extensions/piolium/index.ts +1865 -0
  52. package/extensions/piolium/longshot.ts +530 -0
  53. package/extensions/piolium/matcher-suggestions.ts +196 -0
  54. package/extensions/piolium/matcher-utils.ts +83 -0
  55. package/extensions/piolium/modes/balanced.ts +750 -0
  56. package/extensions/piolium/modes/confirm-bootstrap.ts +186 -0
  57. package/extensions/piolium/modes/confirm.ts +697 -0
  58. package/extensions/piolium/modes/deep.ts +917 -0
  59. package/extensions/piolium/modes/diff.ts +177 -0
  60. package/extensions/piolium/modes/lite.ts +540 -0
  61. package/extensions/piolium/modes/longshot.ts +595 -0
  62. package/extensions/piolium/modes/merge.ts +204 -0
  63. package/extensions/piolium/modes/phase-runner.ts +267 -0
  64. package/extensions/piolium/modes/reinvest.ts +546 -0
  65. package/extensions/piolium/modes/revisit.ts +279 -0
  66. package/extensions/piolium/modes.ts +48 -0
  67. package/extensions/piolium/phase-labels.ts +123 -0
  68. package/extensions/piolium/phase-status-strip.ts +92 -0
  69. package/extensions/piolium/prompt-prefix-editor.ts +39 -0
  70. package/extensions/piolium/providers/anthropic-vertex.ts +836 -0
  71. package/extensions/piolium/recon.ts +409 -0
  72. package/extensions/piolium/result-stats.ts +105 -0
  73. package/extensions/piolium/retry.ts +120 -0
  74. package/extensions/piolium/scheduler.ts +212 -0
  75. package/extensions/piolium/secrets.ts +368 -0
  76. package/extensions/piolium/tools/web-tools.ts +148 -0
  77. package/package.json +77 -0
  78. package/skills/agentic-actions-auditor/SKILL.md +327 -0
  79. package/skills/agentic-actions-auditor/references/action-profiles.md +186 -0
  80. package/skills/agentic-actions-auditor/references/cross-file-resolution.md +209 -0
  81. package/skills/agentic-actions-auditor/references/foundations.md +94 -0
  82. package/skills/agentic-actions-auditor/references/vector-a-env-var-intermediary.md +77 -0
  83. package/skills/agentic-actions-auditor/references/vector-b-direct-expression-injection.md +83 -0
  84. package/skills/agentic-actions-auditor/references/vector-c-cli-data-fetch.md +83 -0
  85. package/skills/agentic-actions-auditor/references/vector-d-pr-target-checkout.md +88 -0
  86. package/skills/agentic-actions-auditor/references/vector-e-error-log-injection.md +88 -0
  87. package/skills/agentic-actions-auditor/references/vector-f-subshell-expansion.md +82 -0
  88. package/skills/agentic-actions-auditor/references/vector-g-eval-of-ai-output.md +91 -0
  89. package/skills/agentic-actions-auditor/references/vector-h-dangerous-sandbox-configs.md +102 -0
  90. package/skills/agentic-actions-auditor/references/vector-i-wildcard-allowlists.md +88 -0
  91. package/skills/audit/SKILL.md +562 -0
  92. package/skills/audit/assets/icon.svg +7 -0
  93. package/skills/audit/hooks/scripts/validate_phase_output.py +550 -0
  94. package/skills/audit/references/adversarial-review.md +148 -0
  95. package/skills/audit/references/architecture-aware-sast.md +306 -0
  96. package/skills/audit/references/audit-workflow.md +737 -0
  97. package/skills/audit/references/chamber-protocol.md +384 -0
  98. package/skills/audit/references/creative-attack-modes.md +221 -0
  99. package/skills/audit/references/deep-analysis.md +273 -0
  100. package/skills/audit/references/domain-attack-playbooks.md +1129 -0
  101. package/skills/audit/references/knowledge-base-template.md +513 -0
  102. package/skills/audit/references/real-env-validation.md +191 -0
  103. package/skills/audit/references/report-templates.md +417 -0
  104. package/skills/audit/references/triage-and-prereqs.md +134 -0
  105. package/skills/audit/scripts/consolidate_drafts.py +554 -0
  106. package/skills/audit/scripts/partition_findings.py +152 -0
  107. package/skills/audit/scripts/rg-hotspots.sh +121 -0
  108. package/skills/audit/scripts/stamp_file_state.py +349 -0
  109. package/skills/code-reviewer/SKILL.md +65 -0
  110. package/skills/codeql/SKILL.md +281 -0
  111. package/skills/codeql/references/build-fixes.md +90 -0
  112. package/skills/codeql/references/diagnostic-query-templates.md +339 -0
  113. package/skills/codeql/references/extension-yaml-format.md +209 -0
  114. package/skills/codeql/references/important-only-suite.md +153 -0
  115. package/skills/codeql/references/language-details.md +207 -0
  116. package/skills/codeql/references/macos-arm64e-workaround.md +179 -0
  117. package/skills/codeql/references/performance-tuning.md +111 -0
  118. package/skills/codeql/references/quality-assessment.md +172 -0
  119. package/skills/codeql/references/ruleset-catalog.md +63 -0
  120. package/skills/codeql/references/run-all-suite.md +92 -0
  121. package/skills/codeql/references/sarif-processing.md +79 -0
  122. package/skills/codeql/references/threat-models.md +51 -0
  123. package/skills/codeql/workflows/build-database.md +280 -0
  124. package/skills/codeql/workflows/create-data-extensions.md +261 -0
  125. package/skills/codeql/workflows/run-analysis.md +301 -0
  126. package/skills/differential-review/SKILL.md +220 -0
  127. package/skills/differential-review/adversarial.md +203 -0
  128. package/skills/differential-review/methodology.md +234 -0
  129. package/skills/differential-review/patterns.md +300 -0
  130. package/skills/differential-review/reporting.md +369 -0
  131. package/skills/fp-check/SKILL.md +125 -0
  132. package/skills/fp-check/references/bug-class-verification.md +114 -0
  133. package/skills/fp-check/references/deep-verification.md +143 -0
  134. package/skills/fp-check/references/evidence-templates.md +91 -0
  135. package/skills/fp-check/references/false-positive-patterns.md +115 -0
  136. package/skills/fp-check/references/gate-reviews.md +27 -0
  137. package/skills/fp-check/references/standard-verification.md +78 -0
  138. package/skills/insecure-defaults/SKILL.md +117 -0
  139. package/skills/insecure-defaults/references/examples.md +409 -0
  140. package/skills/last30days/SKILL.md +444 -0
  141. package/skills/sarif-parsing/SKILL.md +483 -0
  142. package/skills/sarif-parsing/resources/jq-queries.md +162 -0
  143. package/skills/sarif-parsing/resources/sarif_helpers.py +331 -0
  144. package/skills/security-threat-model/LICENSE.txt +201 -0
  145. package/skills/security-threat-model/SKILL.md +81 -0
  146. package/skills/security-threat-model/agents/openai.yaml +4 -0
  147. package/skills/security-threat-model/references/prompt-template.md +255 -0
  148. package/skills/security-threat-model/references/security-controls-and-assets.md +32 -0
  149. package/skills/semgrep/SKILL.md +212 -0
  150. package/skills/semgrep/references/rulesets.md +162 -0
  151. package/skills/semgrep/references/scan-modes.md +110 -0
  152. package/skills/semgrep/references/scanner-task-prompt.md +140 -0
  153. package/skills/semgrep/scripts/merge_sarif.py +203 -0
  154. package/skills/semgrep/workflows/scan-workflow.md +311 -0
  155. package/skills/semgrep-rule-creator/SKILL.md +168 -0
  156. package/skills/semgrep-rule-creator/references/quick-reference.md +202 -0
  157. package/skills/semgrep-rule-creator/references/workflow.md +240 -0
  158. package/skills/semgrep-rule-variant-creator/SKILL.md +205 -0
  159. package/skills/semgrep-rule-variant-creator/references/applicability-analysis.md +250 -0
  160. package/skills/semgrep-rule-variant-creator/references/language-syntax-guide.md +324 -0
  161. package/skills/semgrep-rule-variant-creator/references/workflow.md +518 -0
  162. package/skills/sharp-edges/SKILL.md +292 -0
  163. package/skills/sharp-edges/references/auth-patterns.md +252 -0
  164. package/skills/sharp-edges/references/case-studies.md +274 -0
  165. package/skills/sharp-edges/references/config-patterns.md +333 -0
  166. package/skills/sharp-edges/references/crypto-apis.md +190 -0
  167. package/skills/sharp-edges/references/lang-c.md +205 -0
  168. package/skills/sharp-edges/references/lang-csharp.md +285 -0
  169. package/skills/sharp-edges/references/lang-go.md +270 -0
  170. package/skills/sharp-edges/references/lang-java.md +263 -0
  171. package/skills/sharp-edges/references/lang-javascript.md +269 -0
  172. package/skills/sharp-edges/references/lang-kotlin.md +265 -0
  173. package/skills/sharp-edges/references/lang-php.md +245 -0
  174. package/skills/sharp-edges/references/lang-python.md +274 -0
  175. package/skills/sharp-edges/references/lang-ruby.md +273 -0
  176. package/skills/sharp-edges/references/lang-rust.md +272 -0
  177. package/skills/sharp-edges/references/lang-swift.md +287 -0
  178. package/skills/sharp-edges/references/language-specific.md +588 -0
  179. package/skills/spec-to-code-compliance/SKILL.md +357 -0
  180. package/skills/spec-to-code-compliance/resources/COMPLETENESS_CHECKLIST.md +69 -0
  181. package/skills/spec-to-code-compliance/resources/IR_EXAMPLES.md +417 -0
  182. package/skills/spec-to-code-compliance/resources/OUTPUT_REQUIREMENTS.md +105 -0
  183. package/skills/supply-chain-risk-auditor/SKILL.md +67 -0
  184. package/skills/supply-chain-risk-auditor/resources/results-template.md +41 -0
  185. package/skills/variant-analysis/METHODOLOGY.md +327 -0
  186. package/skills/variant-analysis/SKILL.md +142 -0
  187. package/skills/variant-analysis/resources/codeql/cpp.ql +119 -0
  188. package/skills/variant-analysis/resources/codeql/go.ql +69 -0
  189. package/skills/variant-analysis/resources/codeql/java.ql +71 -0
  190. package/skills/variant-analysis/resources/codeql/javascript.ql +63 -0
  191. package/skills/variant-analysis/resources/codeql/python.ql +80 -0
  192. package/skills/variant-analysis/resources/semgrep/cpp.yaml +98 -0
  193. package/skills/variant-analysis/resources/semgrep/go.yaml +63 -0
  194. package/skills/variant-analysis/resources/semgrep/java.yaml +61 -0
  195. package/skills/variant-analysis/resources/semgrep/javascript.yaml +60 -0
  196. package/skills/variant-analysis/resources/semgrep/python.yaml +72 -0
  197. package/skills/variant-analysis/resources/variant-report-template.md +75 -0
  198. package/skills/vuln-report/SKILL.md +137 -0
  199. package/skills/vuln-report/agents/openai.yaml +4 -0
  200. package/skills/vuln-report/references/report-template.md +135 -0
  201. package/skills/wooyun-legacy/SKILL.md +367 -0
  202. package/skills/wooyun-legacy/references/bank-penetration.md +222 -0
  203. package/skills/wooyun-legacy/references/checklists/command-execution-checklist.md +119 -0
  204. package/skills/wooyun-legacy/references/checklists/csrf-checklist.md +74 -0
  205. package/skills/wooyun-legacy/references/checklists/file-upload-checklist.md +108 -0
  206. package/skills/wooyun-legacy/references/checklists/info-disclosure-checklist.md +114 -0
  207. package/skills/wooyun-legacy/references/checklists/logic-flaws-checklist.md +95 -0
  208. package/skills/wooyun-legacy/references/checklists/misconfig-checklist.md +124 -0
  209. package/skills/wooyun-legacy/references/checklists/path-traversal-checklist.md +87 -0
  210. package/skills/wooyun-legacy/references/checklists/rce-checklist.md +93 -0
  211. package/skills/wooyun-legacy/references/checklists/sql-injection-checklist.md +97 -0
  212. package/skills/wooyun-legacy/references/checklists/ssrf-checklist.md +99 -0
  213. package/skills/wooyun-legacy/references/checklists/unauthorized-access-checklist.md +89 -0
  214. package/skills/wooyun-legacy/references/checklists/weak-password-checklist.md +115 -0
  215. package/skills/wooyun-legacy/references/checklists/xss-checklist.md +103 -0
  216. package/skills/wooyun-legacy/references/checklists/xxe-checklist.md +130 -0
  217. package/skills/wooyun-legacy/references/info-disclosure.md +975 -0
  218. package/skills/wooyun-legacy/references/logic-flaws.md +721 -0
  219. package/skills/wooyun-legacy/references/path-traversal.md +1191 -0
  220. package/skills/wooyun-legacy/references/telecom-penetration.md +156 -0
  221. package/skills/wooyun-legacy/references/unauthorized-access.md +980 -0
  222. package/skills/wooyun-legacy/references/xss.md +746 -0
  223. package/skills/zeroize-audit/SKILL.md +371 -0
  224. package/skills/zeroize-audit/configs/c.yaml +21 -0
  225. package/skills/zeroize-audit/configs/default.yaml +128 -0
  226. package/skills/zeroize-audit/configs/rust.yaml +83 -0
  227. package/skills/zeroize-audit/prompts/report_template.md +238 -0
  228. package/skills/zeroize-audit/prompts/system.md +163 -0
  229. package/skills/zeroize-audit/prompts/task.md +97 -0
  230. package/skills/zeroize-audit/references/compile-commands.md +231 -0
  231. package/skills/zeroize-audit/references/detection-strategy.md +191 -0
  232. package/skills/zeroize-audit/references/ir-analysis.md +252 -0
  233. package/skills/zeroize-audit/references/mcp-analysis.md +221 -0
  234. package/skills/zeroize-audit/references/poc-generation.md +470 -0
  235. package/skills/zeroize-audit/references/rust-zeroization-patterns.md +867 -0
  236. package/skills/zeroize-audit/schemas/input.json +83 -0
  237. package/skills/zeroize-audit/schemas/output.json +140 -0
  238. package/skills/zeroize-audit/tools/analyze_asm.sh +202 -0
  239. package/skills/zeroize-audit/tools/analyze_cfg.py +381 -0
  240. package/skills/zeroize-audit/tools/analyze_heap.sh +211 -0
  241. package/skills/zeroize-audit/tools/analyze_ir_semantic.py +429 -0
  242. package/skills/zeroize-audit/tools/diff_ir.sh +135 -0
  243. package/skills/zeroize-audit/tools/diff_rust_mir.sh +189 -0
  244. package/skills/zeroize-audit/tools/emit_asm.sh +67 -0
  245. package/skills/zeroize-audit/tools/emit_ir.sh +77 -0
  246. package/skills/zeroize-audit/tools/emit_rust_asm.sh +178 -0
  247. package/skills/zeroize-audit/tools/emit_rust_ir.sh +150 -0
  248. package/skills/zeroize-audit/tools/emit_rust_mir.sh +158 -0
  249. package/skills/zeroize-audit/tools/extract_compile_flags.py +284 -0
  250. package/skills/zeroize-audit/tools/generate_poc.py +1329 -0
  251. package/skills/zeroize-audit/tools/mcp/apply_confidence_gates.py +113 -0
  252. package/skills/zeroize-audit/tools/mcp/check_mcp.sh +68 -0
  253. package/skills/zeroize-audit/tools/mcp/normalize_mcp_evidence.py +125 -0
  254. package/skills/zeroize-audit/tools/scripts/check_llvm_patterns.py +481 -0
  255. package/skills/zeroize-audit/tools/scripts/check_mir_patterns.py +554 -0
  256. package/skills/zeroize-audit/tools/scripts/check_rust_asm.py +424 -0
  257. package/skills/zeroize-audit/tools/scripts/check_rust_asm_aarch64.py +300 -0
  258. package/skills/zeroize-audit/tools/scripts/check_rust_asm_x86.py +283 -0
  259. package/skills/zeroize-audit/tools/scripts/find_dangerous_apis.py +375 -0
  260. package/skills/zeroize-audit/tools/scripts/semantic_audit.py +923 -0
  261. package/skills/zeroize-audit/tools/track_dataflow.sh +196 -0
  262. package/skills/zeroize-audit/tools/validate_rust_toolchain.sh +298 -0
  263. package/skills/zeroize-audit/workflows/phase-0-preflight.md +150 -0
  264. package/skills/zeroize-audit/workflows/phase-1-source-analysis.md +144 -0
  265. package/skills/zeroize-audit/workflows/phase-2-compiler-analysis.md +139 -0
  266. package/skills/zeroize-audit/workflows/phase-3-interim-report.md +46 -0
  267. package/skills/zeroize-audit/workflows/phase-4-poc-generation.md +46 -0
  268. package/skills/zeroize-audit/workflows/phase-5-poc-validation.md +136 -0
  269. package/skills/zeroize-audit/workflows/phase-6-final-report.md +44 -0
  270. package/skills/zeroize-audit/workflows/phase-7-test-generation.md +42 -0
  271. package/themes/piolium-srcery.json +94 -0
@@ -0,0 +1,562 @@
1
+ ---
2
+ name: audit
3
+ description: Use when running a full security audit of an arbitrary source code repository, especially large, complex, multi-component, distributed, or non-standard architectures. Defines a 10-phase security audit methodology combining advisory intelligence, patch bypass analysis, knowledge base construction, baseline and custom SAST, spec gap analysis, deep bug hunting, false positive elimination, variant analysis, and final reporting with realistic PoC construction. Triggers on "audit this repo", "run a full security audit", "find vulnerabilities in this codebase", "check for security issues", "is this secure?", "run the security agents", or any request combining advisory regression, SAST, and manual review.
4
+ ---
5
+
6
+ # Audit — Full Security Audit Methodology
7
+
8
+ 10-phase security audit methodology for arbitrary source code repositories. Each phase defines what to analyze and what to produce. Orchestration (branching, state management, agent dispatch) is handled by the plugin commands.
9
+
10
+ ## When to Apply
11
+
12
+ - Full security audit of a repository
13
+ - Advisory regression check combined with static analysis
14
+ - Deep vulnerability research on a specific codebase
15
+ - Large or unusual architectures where default SAST modeling is likely incomplete
16
+ - "Run the security agents" / "audit for vulnerabilities" / "is this secure?"
17
+
18
+ ## Idempotency & Resumption
19
+
20
+ Before executing any phase, apply these rules to avoid redundant work:
21
+
22
+ - **Skip completed phases**: if the expected KB sections already exist and neither the codebase nor
23
+ the threat-model inputs have fundamentally changed, reuse the existing content and mark the phase
24
+ skipped.
25
+ - **Re-audit as KB update**: for re-audits, `archon/attack-surface/knowledge-base-report.md` from the previous
26
+ run is the starting knowledge base. Do not regenerate it from scratch. Load it, diff the codebase
27
+ against the `commit` field of the last completed entry in `archon/audit-state.json`, and update
28
+ only the sections whose source inputs changed. Mark unchanged sections with
29
+ `[reused from <short-sha>]`. Documentation-only changes require no re-audit; changes to auth,
30
+ core business logic, or attack-surface components invalidate the Static Analysis Summary and
31
+ Phase 10 Addendum (`## Phase 10 Addendum`, written by the Review Chambers) sections at minimum.
32
+ - **Partial resumption (Phases 7-9)**: if `archon/findings-draft/` already contains draft files,
33
+ resume from the existing drafts rather than starting fresh.
34
+ - **State recording**: `archon/audit-state.json` is append-only. Before starting a new audit,
35
+ append a new entry to the `audits` array with `status: "in_progress"`. After each phase
36
+ completes or fails, update that entry's `phases` map in-place. Never overwrite or remove
37
+ earlier entries — they are the permanent audit history. See `references/report-templates.md`
38
+ for the full schema.
39
+
40
+ ## Setup
41
+
42
+ Before executing Phase 1, perform the following environment checks:
43
+
44
+ 1. **Security folder dirtiness check**: Run `git status archon/` to determine if `archon/` has
45
+ uncommitted changes or untracked files.
46
+
47
+ 2. **Concurrent agent detection**: Check whether another agent is actively writing to the source
48
+ code tree. Indicators include uncommitted modifications outside `archon/` in the working tree
49
+ (e.g., staged edits, new untracked source files) or the presence of `.claude/` task state that
50
+ suggests a live session.
51
+
52
+ 3. **Worktree isolation**: If BOTH conditions hold — `archon/` is dirty AND another agent is
53
+ actively modifying source code — create an isolated git worktree pinned to the current HEAD so
54
+ the audit analyses a stable snapshot and writes to a conflict-free path:
55
+
56
+ ```bash
57
+ AUDIT_WT="../audit-$(basename "$PWD")-$(date +%s)"
58
+ git worktree add --detach "$AUDIT_WT" HEAD
59
+ ```
60
+
61
+ Run the entire audit from inside `$AUDIT_WT`. All `archon/` output is written to the
62
+ worktree copy. At the end of Phase 15, merge the retained artifacts back and tear down the
63
+ worktree:
64
+
65
+ ```bash
66
+ cp -r "$AUDIT_WT/archon/attack-surface/" archon/
67
+ cp -r "$AUDIT_WT/archon/final-audit-report.md" archon/
68
+ cp -r "$AUDIT_WT/archon/findings/" archon/
69
+ git worktree remove --force "$AUDIT_WT"
70
+ ```
71
+
72
+ If only one condition holds (security is dirty but no concurrent agent, or a concurrent agent
73
+ exists but security is clean), proceed without a worktree — no isolation needed.
74
+
75
+ ## 10-Phase Workflow
76
+
77
+ ```mermaid
78
+ flowchart TD
79
+ Start["Audit Request"] --> Setup["Setup + reuse check"]
80
+ Setup --> P1["1. Intelligence Gathering"]
81
+ P1 --> P2["2. Patch Bypass Analysis (per-patch parallel)"]
82
+ P2 --> P3["3. Knowledge Base"]
83
+ P3 --> P4["4. Static Analysis (incl. inline Enrichment)"]
84
+ P3 --> P6["6. Spec Gap Analysis"]
85
+ P4 --> P7["7. Deep Bug Hunting"]
86
+ P6 --> P7
87
+ P7 --> P8["8. P11-LITE: FP Check + Cold Verification (CRITICAL/HIGH only)"]
88
+ P8 --> P9["9. Variant Analysis"]
89
+ P9 --> P10["10. Exploitation & Final Reporting"]
90
+ ```
91
+
92
+ ## Phase 1 — Intelligence Gathering
93
+
94
+ Use the cve-scout workflow to collect:
95
+
96
+ - advisories, CVEs, GHSAs, and patch commits
97
+ - coarse architecture inventory: components, transports, execution contexts, trust boundaries
98
+ - security-relevant dependencies, with runtime context noted for each one. Use the `supply-chain-risk-auditor` skill to systematically assess dependency risks.
99
+
100
+ Treat dependency findings as hypotheses until the audit proves the affected runtime path is reachable.
101
+
102
+ Write all findings to the `## Advisory Intelligence` section of `archon/attack-surface/knowledge-base-report.md`.
103
+
104
+ ## Phase 2 — Patch Bypass Analysis
105
+
106
+ For each advisory patch:
107
+
108
+ - fetch the full diff and surrounding callers
109
+ - test bypass hypotheses: alternate entry points, config-gated checks, default-state gaps, compatibility branches, parser differentials, missing normalization
110
+ - check whether a sibling or related path remains vulnerable even if the patched path is sound
111
+ - cluster duplicate advisories by the same upstream commit or PR so one fix is not re-audited as multiple distinct bugs
112
+
113
+ Write all findings to the `## Bypass Analysis` section of `archon/attack-surface/knowledge-base-report.md`.
114
+
115
+ ## Phase 3 — Knowledge Base
116
+
117
+ Build the project model from source:
118
+
119
+ - classify project type: web app, API, CLI, desktop, library, plugin, protocol, worker, CI action
120
+ - map attacker-controlled inputs, trust boundaries, and security-critical decisions
121
+ - build compact DFD/CFD slices only for the highest-risk flows
122
+ - record implemented specs and RFCs
123
+ - Use the `security-threat-model` skill to formally document the threat model.
124
+ - Run **Domain Attack Research** (Modes A, B, and C) to build a domain-specific attack playbook:
125
+ use `last30days`, `wooyun-legacy`, MCP tools, and web search. See
126
+ `references/domain-attack-playbooks.md` for the research action sequence and per-domain templates.
127
+
128
+ Before completing Phase 3, add a `## Phase 4 CodeQL Extraction Targets` section to the KB draft.
129
+ For each high-risk DFD slice, record the expected CodeQL source type (RemoteFlowSource,
130
+ LocalUserInput, EnvironmentVariable) and the expected sink kind (sql-execution, command-execution,
131
+ file-access, http-request, code-execution, deserialization). This is the data contract that tells
132
+ Phase 4's structural extractor which per-slice call graph queries to run. Leave the section blank
133
+ if no DFD slices were identified — structural extraction will run generic enumeration only.
134
+
135
+ Produce `archon/attack-surface/knowledge-base-report.md` with all Phase 3 sections populated. This is the
136
+ single knowledge base file for the entire audit. The threat model and attack surface content
137
+ live inside it as sections — no separate files.
138
+
139
+ The Phase 3 threat model is mandatory input for all later phases.
140
+
141
+ ## Phase 4 — Static Analysis
142
+
143
+ **CRITICAL ENFORCEMENT:** You MUST physically execute the SAST tools. Do not hallucinate results or skip execution. You must ensure `codeql` successfully runs and that `semgrep` uses the **Pro** engine (`--pro`) exclusively. Standard Semgrep is only permitted as a fallback when Pro is unavailable due to an authentication or licensing failure; document the fallback and its reason in the report.
144
+
145
+ ### Sub-step 4.1 — Structural Extraction (runs first, before security scan)
146
+
147
+ Before running any security suite, build the CodeQL database and store it at
148
+ `archon/codeql-artifacts/db/` (not a transient path). Do not delete it after this sub-step.
149
+
150
+ Follow the `## Structural Extraction Workflow` in `references/architecture-aware-sast.md` to produce:
151
+
152
+ - `archon/codeql-artifacts/entry-points.json`
153
+ - `archon/codeql-artifacts/sinks.json`
154
+ - `archon/codeql-artifacts/call-graph-slices.json`
155
+ - `archon/codeql-artifacts/flow-paths-raw.sarif` (git-ignored, retained until Phase 12)
156
+ - `archon/codeql-artifacts/flow-paths-all-severities.md`
157
+ - Machine-generated DFD and CFD Mermaid diagrams embedded in `archon/attack-surface/knowledge-base-report.md`
158
+
159
+ Populate the `## CodeQL Structural Analysis` section of `archon/attack-surface/knowledge-base-report.md`
160
+ after extraction completes.
161
+
162
+ ### Sub-step 4.2 — Security Scan
163
+
164
+ Baseline requirements:
165
+
166
+ - Delegate to the `codeql` skill to run built-in security suites against the database built in 4.1.
167
+ - Delegate to the `semgrep` skill with `--pro` enforced for **all passes** (baseline, language, framework, and custom). Fall back to standard Semgrep only if the Pro engine fails with an authentication or licensing error; document the fallback reason in the `## Static Analysis Summary` section of `archon/attack-surface/knowledge-base-report.md`.
168
+ - Explicitly output the list of CodeQL queries and Semgrep rules that you actually ran.
169
+ - For Java applications, run SpotBugs with the FindSecBugs plugin as a required baseline pass; treat this as additive to CodeQL and Semgrep.
170
+ - Run GitHub Actions review with `agentic-actions-auditor` when `.github/workflows/` exists; write results to the `## GitHub Actions Audit` section of `archon/attack-surface/knowledge-base-report.md`.
171
+
172
+ Custom Architecture Generalization (Dynamic Rules):
173
+
174
+ - Do not solely rely on generic or pre-baked rules. You MUST dynamically generate **custom CodeQL queries and Semgrep rules** specifically tailored to the ad-hoc architecture, framework, and threat model identified in Phase 3 (e.g., custom MCP protocols, specific custom RPC boundaries).
175
+ - Store all dynamically generated custom rules in `archon/codeql-queries/` and `archon/semgrep-rules/`.
176
+ - Document exactly what custom rules were created, why they match the Phase 3 architecture, and their execution results in the `## Static Analysis Summary` section of `archon/attack-surface/knowledge-base-report.md`.
177
+
178
+ Operational rules:
179
+
180
+ - Keep SAST concurrency low enough to avoid exhausting CPU/RAM.
181
+ - Merge SARIF outputs with `sarif-parsing` if needed.
182
+
183
+ ### Sub-step 4.3 — Inline Enrichment (Security Relevance Filter)
184
+
185
+ After SAST runs complete and before deep bug hunting, classify each candidate finding as one of:
186
+
187
+ - likely security
188
+ - likely correctness/robustness
189
+ - likely environment/tooling/admin-only
190
+
191
+ For every candidate, answer:
192
+
193
+ 1. What attacker controls the input?
194
+ 2. Which runtime executes the vulnerable path?
195
+ 3. What trust boundary is crossed?
196
+ 4. Is the effect cross-user, cross-tenant, cross-privilege, or only same-user?
197
+ 5. Is the vulnerable dependency/code path actually used in that runtime?
198
+ 6. Query `archon/codeql-artifacts/call-graph-slices.json` for the finding's source-to-sink slice.
199
+ If `reachable: true`, that strengthens the finding. If `reachable: false` and both source and
200
+ sink appear in the enumeration files, that is evidence to downgrade — document the discrepancy.
201
+ For findings without a pre-computed slice, run an on-demand query against
202
+ `archon/codeql-artifacts/db/`.
203
+
204
+ Downgrade or exclude by default when the issue is only:
205
+
206
+ - build-time, source-controlled, CI-only, test-only, or dev-only
207
+ - browser-only usage of a server-side CVE, or server-only usage of a browser-side CVE
208
+ - same-user state/cache/UI correctness without a broader data boundary break
209
+ - admin safety, migration robustness, retry/deadlock hardening, data-loss prevention, or workflow correctness
210
+ - local tooling behavior where the attacker already has equivalent code execution
211
+ - assessable as Low severity after answering the questions above — drop immediately; do not carry
212
+ forward to Phase 10
213
+
214
+ Write enrichment verdicts to the `## SAST Enrichment` section of `archon/attack-surface/knowledge-base-report.md`. In the
215
+ `## CodeQL Structural Analysis` section, note any entry points from `entry-points.json` not
216
+ present in the Phase 3 DFD slices, and any sinks from `sinks.json` mapping to unmodeled
217
+ high-risk flows.
218
+
219
+ ### Sub-step 4.4 — Cleanup
220
+
221
+ Delete Semgrep cache, `semgrep-res/`, and `codeql-res/`. Do **not** delete
222
+ `archon/codeql-artifacts/db/` — it is retained for Phases 7 and 9. Full database deletion
223
+ happens at the end of Phase 12.
224
+
225
+ ## Phase 9 — Spec Gap Analysis
226
+
227
+ If the repo implements specs or RFCs:
228
+
229
+ 1. Read the `## Domain Attack Research` section of `archon/attack-surface/knowledge-base-report.md` first —
230
+ it contains pre-computed domain attack patterns from Phase 3 that directly inform which spec
231
+ gaps to prioritize.
232
+ 2. Fetch the relevant documents using built-in web search or fetch tools (do not restrict yourself to MCP tools).
233
+ 3. Research the RFC for historical attacks, known edge cases, and common implementation failures.
234
+ Cross-reference against the domain attack playbook from Phase 3.
235
+ 4. Use `spec-to-code-compliance`.
236
+ 5. Focus on parsing, normalization, sanitization, canonicalization, and state-machine compliance.
237
+ 6. Identify gaps between the RFC spec and the codebase implementation clearly.
238
+ 7. Keep only medium-to-critical findings with a credible exploit path.
239
+
240
+ Write all findings to the `## Spec Gap Analysis` section of `archon/attack-surface/knowledge-base-report.md`.
241
+ If no specs or RFCs were identified in Phase 3, mark the section "None identified" and skip.
242
+
243
+ ## Phase 10 — Review Chamber Deep Bug Hunting
244
+
245
+ Phase 10 uses a **Review Chamber** multi-agent debate system. Instead of a single deep-reviewer
246
+ agent, four specialized roles collaborate through structured argumentation to produce findings
247
+ with higher creativity and lower false-positive rates.
248
+
249
+ ### Chamber Formation
250
+
251
+ After Phase 4 (SAST + inline enrichment) and Phase 9 (spec gap) complete:
252
+
253
+ 1. Read `## High-Risk DFD Slices` and `## High-Risk CFD Slices` from `archon/attack-surface/knowledge-base-report.md`
254
+ 2. Group slices by shared trust boundary or component affinity into **threat clusters**
255
+ 3. Each cluster becomes one Review Chamber (typical audit: 3-8 chambers)
256
+ 4. Priority: authentication/authorization first, then data ingestion, then API surface
257
+
258
+ Create `archon/chamber-workspace/` and `archon/attack-pattern-registry.json`.
259
+
260
+ ### Four Debate Roles
261
+
262
+ Each chamber spawns four agents that communicate through an append-only debate transcript at
263
+ `archon/chamber-workspace/<chamber-id>/debate.md`:
264
+
265
+ - **Attack Ideator** (Red Team Creative): generates 3-7 attack hypotheses per cluster by cycling
266
+ through 8 creative modes — vulnerability chaining, business logic abuse, race conditions/TOCTOU,
267
+ second-order/stored attacks, trust boundary confusion, parser/protocol differentials, state
268
+ machine attacks, and supply chain interaction. See `references/creative-attack-modes.md`.
269
+ Does NOT trace code or issue verdicts.
270
+
271
+ - **Code Tracer** (Technical Analyst): takes each hypothesis and traces it through actual code.
272
+ Uses Method 2.6 from `references/deep-analysis.md` (call-graph slices, entry-points.json,
273
+ sinks.json, flow-paths-all-severities.md, on-demand QL queries). Produces reachability verdicts
274
+ (REACHABLE / UNREACHABLE / PARTIAL) with file:line evidence chains.
275
+ Does NOT generate hypotheses or issue final verdicts.
276
+
277
+ - **Devil's Advocate** (Challenger): challenges EVERY finding. Searches 5 protection layers
278
+ (language, framework, middleware, application, documentation). Checks all 8 Claude-Specific FP
279
+ patterns from `references/triage-and-prereqs.md`. Must argue against even obvious vulnerabilities —
280
+ inability to construct credible defense is itself strong evidence.
281
+ Does NOT generate hypotheses or issue verdicts.
282
+
283
+ - **Chamber Synthesizer** (Coordinator + Judge): orchestrates debate rounds, reads all arguments,
284
+ resolves disputes, assigns calibrated severity per `references/triage-and-prereqs.md`, and writes
285
+ finding drafts. Only role that writes to `archon/findings-draft/`. Manages the attack pattern
286
+ registry. May request up to 2 follow-up investigation rounds per hypothesis.
287
+
288
+ Optional 5th role — **Variant Scout**: monitors debate for confirmed patterns and concurrently
289
+ searches for structural variants in sibling components, front-loading Phase 12 work.
290
+
291
+ ### Debate Protocol
292
+
293
+ Each chamber proceeds through structured rounds:
294
+
295
+ ```
296
+ Round 1 (Ideation): Ideator generates 3-7 hypotheses
297
+ Round 2 (Tracing): Tracer traces each hypothesis through code
298
+ Round 3 (Challenge): Advocate writes defense brief per hypothesis
299
+ Round 4 (Synthesis): Synthesizer evaluates arguments, issues verdicts
300
+ Round 5-6 (Optional): Focused re-investigation on unresolved hypotheses
301
+ ```
302
+
303
+ **Convergence criteria** — debate ends for a hypothesis when:
304
+ - Tracer: UNREACHABLE + Advocate confirms no alternate path → DROP
305
+ - Tracer: REACHABLE + Advocate cannot find blocking protection (2 attempts) → VALID
306
+ - Tracer: REACHABLE + Advocate finds blocking protection → FALSE POSITIVE
307
+ - 3 rounds without resolution → Synthesizer judgment call or INCONCLUSIVE
308
+ - Low severity after calibration → DROP (low severity)
309
+
310
+ **Limits**: max 7 hypotheses per batch, max 3 rounds per hypothesis, max 3 concurrent chambers.
311
+
312
+ See `references/chamber-protocol.md` for complete debate format, transcript template, and
313
+ convergence rules.
314
+
315
+ ### Pre-Finding Quality Gate
316
+
317
+ Before writing any finding draft, the Synthesizer applies this 5-point check:
318
+
319
+ 1. Attacker control verified by Tracer (not just inferred)?
320
+ 2. Framework protection searched by Advocate (all 5 layers)?
321
+ 3. Trust boundary crossing confirmed (not same-origin)?
322
+ 4. Exploitation requires normal attacker position (not admin)?
323
+ 5. Vulnerable code ships to production (not test/example)?
324
+
325
+ If any check fails, drop the finding. If ambiguous, add `Pre-FP-Flag: check-N-ambiguous` to the
326
+ draft for Phase 11 priority.
327
+
328
+ ### Cross-Chamber Intelligence
329
+
330
+ Chambers share a **pattern registry** at `archon/attack-pattern-registry.json`. When a
331
+ Synthesizer confirms a finding, it adds the root cause pattern with detection signatures
332
+ (CodeQL, grep, Semgrep). Other chambers read the registry before new ideation rounds,
333
+ enabling cross-domain pattern discovery.
334
+
335
+ ### Output
336
+
337
+ - Finding drafts: `archon/findings-draft/p7-<NNN>-<slug>.md` (Medium+ only, Low dropped)
338
+ - Debate transcripts: `archon/chamber-workspace/<chamber-id>/debate.md` (audit artifact)
339
+ - Variant candidates: `archon/chamber-workspace/<chamber-id>/variant-candidates/` (for Phase 12)
340
+ - Pattern registry: `archon/attack-pattern-registry.json` (for Phases 8, 9)
341
+
342
+ ### KB Feedback Loop
343
+
344
+ After all chambers close, append a `## Phase 10 Addendum` section to
345
+ `archon/attack-surface/knowledge-base-report.md` containing: newly discovered attack surfaces, revised trust
346
+ boundary assumptions, and additional DFD/CFD paths found during chamber debates. Forward-append
347
+ only — Phase 3 content preserved for auditability.
348
+
349
+ ### Specialized Skill Delegation
350
+
351
+ Chambers may delegate to specialized skills for scope NOT already covered by Phase 3 domain
352
+ attack research:
353
+
354
+ - `insecure-defaults` — fail-open configurations, weak auth defaults
355
+ - `sharp-edges` — API design issues, dangerous configurations
356
+ - `wooyun-legacy` — web vulnerability techniques
357
+ - `zeroize-audit` — C/C++/Rust secret handling
358
+
359
+ **Context**: Read `references/chamber-protocol.md`, `references/creative-attack-modes.md`,
360
+ `references/deep-analysis.md`, and `references/triage-and-prereqs.md`.
361
+
362
+ ## Phase 11 — P11-LITE: FP Elimination and Cold Verification
363
+
364
+ Phase 11 is reduced from full adversarial review to **P11-LITE** because the Devil's Advocate
365
+ already challenged every finding during the Phase 10 chamber debate.
366
+
367
+ ### Stage 1 — Analytical FP Check
368
+
369
+ Apply `fp-check` to all candidate findings with `Verdict: VALID` from Phase 10.
370
+
371
+ Retain only findings exploitable within the project's actual threat model.
372
+
373
+ - Judge the attack vector contextually against the project's threat model and attack surface.
374
+ - Check `SECURITY.md` to understand what maintainers consider a vulnerability vs. accepted risk.
375
+ - Apply the Bug Bounty Scope Gate and Claude-Specific FP Awareness checklist from
376
+ `references/triage-and-prereqs.md`.
377
+ - Prioritize findings with `Pre-FP-Flag` annotations from the chamber debate.
378
+
379
+ **CRITICAL**: Verify intended behavior vs. bug. Cross-reference framework documentation, user
380
+ guides, and inline comments to prove a finding is an unintended flaw, not a documented feature.
381
+
382
+ **CRITICAL**: Drop theoretical/unexploitable bugs — static IVs without key access, timing
383
+ side-channels without practical exploit, by-design behavior, informational findings,
384
+ defense-in-depth-only changes, correctness issues without trust boundary crossing, dependency
385
+ alerts without reachable runtime path.
386
+
387
+ **CRITICAL**: "Best practice" is not a valid FP verdict. A missing security control IS a
388
+ vulnerability if the threat model shows attacker-controlled input reaches a sensitive sink
389
+ without adequate protection.
390
+
391
+ Use verdicts: `VALID`, `FALSE POSITIVE`, `BY DESIGN`, `OUT OF SCOPE`,
392
+ `DROP (low severity)`.
393
+
394
+ Write each verdict back into the corresponding `archon/findings-draft/` file immediately.
395
+
396
+ ### Stage 2 — Cold Verification (CRITICAL and HIGH only)
397
+
398
+ **Medium findings skip Stage 2** — already challenged by the Devil's Advocate during the
399
+ chamber debate. This reduces Phase 11 cost by ~60%.
400
+
401
+ For each CRITICAL and HIGH finding with `Verdict: VALID` after Stage 1, spawn a **fresh agent**
402
+ per finding. The task description contains only the finding draft file path — no debate transcript,
403
+ no context, no Phase 10 reasoning.
404
+
405
+ Each cold verifier independently:
406
+
407
+ 1. Restates and decomposes the claim into testable sub-claims
408
+ 2. Traces the code path from scratch
409
+ 3. Attempts real-environment reproduction following `references/real-env-validation.md`
410
+ 4. Writes prosecution and defense briefs
411
+ 5. Challenges severity starting from MEDIUM
412
+ 6. Issues CONFIRMED or DISPROVED
413
+
414
+ Cold verifiers write verdicts back into finding drafts and produce
415
+ `archon/adversarial-reviews/<slug>-review.md`. DISPROVED findings have their `Verdict:`
416
+ updated to `FALSE POSITIVE (adversarial)`. Lower severity wins when challenged.
417
+
418
+ See `references/adversarial-review.md` for the cold verification protocol (scoped to
419
+ CRITICAL/HIGH only).
420
+
421
+ ## Phase 12 — Variant Analysis
422
+
423
+ For each confirmed finding rated **Medium or higher**, search for variants using the same flow
424
+ shape, not just the same syntax.
425
+
426
+ **Primary input**: `archon/attack-pattern-registry.json` — the structured registry of confirmed
427
+ patterns from Phase 10 Review Chambers. Each pattern includes `detection_signature` fields with
428
+ ready-made CodeQL, grep, and Semgrep queries for automated variant hunting, plus
429
+ `untested_candidates` identifying specific code locations to investigate.
430
+
431
+ Also read:
432
+ - `## Phase 10 Addendum` in `archon/attack-surface/knowledge-base-report.md` for attack surfaces discovered
433
+ during chamber debates
434
+ - `archon/chamber-workspace/*/variant-candidates/` for pre-identified candidates from Variant
435
+ Scouts
436
+ - `archon/codeql-artifacts/entry-points.json` and `sinks.json` for structurally similar
437
+ entry/sink combinations
438
+
439
+ Use:
440
+
441
+ - `variant-analysis` skill
442
+ - Detection signatures from the attack pattern registry
443
+ - DFD/CFD slices (including Phase 10 Addendum additions)
444
+ - Custom CodeQL queries and Semgrep rules when they help scale the variant hunt
445
+ - On-demand QL queries against `archon/codeql-artifacts/db/` for AST-level structural matches
446
+
447
+ **Incremental persistence**: Write each confirmed variant immediately to `archon/findings-draft/p9-<NNN>-<slug>.md` using the finding draft template. Only create drafts for variants rated Medium or higher.
448
+
449
+ **Database cleanup**: After all variant queries complete, delete the CodeQL database:
450
+
451
+ ```bash
452
+ rm -rf archon/codeql-artifacts/db/
453
+ ```
454
+
455
+ The extracted JSON and markdown summaries in `archon/codeql-artifacts/` are retained as
456
+ permanent audit record.
457
+
458
+ ## Phase 15 — Exploitation & Final Reporting
459
+
460
+ **Draft promotion**: Before generating individual reports, collect all files in `archon/findings-draft/` with verdict `VALID`. Assign new severity-prefixed IDs (`C1`, `H1`, `M1`) now — discard any `F-NNN` or other ad-hoc IDs used during drafting. For each Critical/High/Medium finding, create the corresponding `archon/findings/<ID>-<slug>/` directory and copy the draft as the basis for the final `vuln-report` output. **Low severity findings are dropped entirely — they do not appear in individual reports, the summary table, or any other output. Never carry forward `F-NNN` draft IDs into final reports.**
461
+
462
+ For each critical, high, and medium bug confirmed:
463
+
464
+ 1. Construct a realistic PoC on a real host or in a VM. You may spin up environments using the Azure CLI if already configured. Follow `references/real-env-validation.md` for provisioning procedures.
465
+ 2. Ensure PoCs are valid and do not trivially bypass a security guard unrepresentative of the real environment (e.g., executing a command directly on the host rather than through the intended sandbox).
466
+ 3. The PoC script must be minimized, clean, and highly effective—styled like a CTF exploit without excessive or unnecessary logging.
467
+ 4. Make sure that the generated report contains granular, step-by-step details required to reproduce the exact bug.
468
+ 5. Invoke the `vuln-report` skill for each Critical, High, and Medium finding. Follow its naming convention: number bugs with severity prefixes `C1`, `H1`, `M1`, incrementing the counter per severity tier. Prefix both the report title and the folder name with this ID.
469
+ 6. Output all technical details and the PoC script for each single bug in its own dedicated subfolder under `archon/findings/<Cn|Hn|Mn>-<bug-name>/`.
470
+ 7. **CRITICAL/HIGH real-environment mandate**: For every CRITICAL or HIGH finding, real-environment PoC execution is required. Reuse the Stage 2 adversarial environment if available; otherwise provision a new one. Capture evidence in `archon/findings/<ID>-<slug>/evidence/`. Annotate `PoC-Status: executed | theoretical | blocked` in the finding. A `theoretical` or `blocked` status requires a `PoC-Block-Reason:` line.
471
+
472
+ **Consolidated Pentest-Style Report:**
473
+ 7. Generate a final `archon/final-audit-report.md` that synthesizes the entire audit:
474
+
475
+ - **Executive Summary:** High-level risk assessment and key takeaways for non-technical stakeholders.
476
+ - **Methodology Summary:** A concise overview of the audit process (Phases 1-9), highlighting the depth of analysis.
477
+ - **Summary of Findings:** A prioritized list (table or list) of all **VALID** findings, focusing on Medium-to-Critical severities.
478
+ - **Technical Findings Detail:** A consolidated section containing the technical summary, impact, and a link to the detailed report and PoC for each valid finding.
479
+ - **Conclusion:** Final professional assessment of the project's security posture.
480
+ - **Constraint:** Keep the report concise and professional. Do not include theoretical or unexploitable bugs.
481
+
482
+ After the consolidated report is written, delete all working artifacts:
483
+
484
+ ```bash
485
+ rm -rf archon/findings-draft/
486
+ rm -rf archon/adversarial-reviews/
487
+ rm -rf archon/real-env-evidence/
488
+ rm -rf archon/codeql-artifacts/
489
+ rm -rf archon/codeql-queries/
490
+ rm -rf archon/semgrep-rules/
491
+ rm -f archon/audit-state.json
492
+ rm -f archon/merged-results.sarif
493
+ rm -f archon/bounty-scope.md
494
+ ```
495
+
496
+ Only three paths are retained: `archon/attack-surface/knowledge-base-report.md`, `archon/final-audit-report.md`, and `archon/findings/`.
497
+
498
+ ## Output Directory
499
+
500
+ All audit output lives in `<repo-root>/archon/`. Three paths are retained after the audit completes. Everything else is cleaned up at the end of Phase 15.
501
+
502
+ **Retained after audit:**
503
+
504
+ | Path | Phases that write to it |
505
+ | ----------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
506
+ | `archon/attack-surface/knowledge-base-report.md` | 1 (advisory), 2 (bypass), 3 (arch/threat model/attack surface/domain attack research), 4 (SAST summary + CodeQL structural), 5 (enrichment), 6 (spec gaps), 7 (addendum) |
507
+ | `archon/final-audit-report.md` | 10 |
508
+ | `archon/findings/<Cn\|Hn\|Mn>-<bug-name>/` | 10 (promoted from draft) |
509
+
510
+ **Working artifacts** (deleted at end of Phase 15):
511
+
512
+ | Path | Phase |
513
+ | ---------------------------------------------------------- | ----------------- |
514
+ | `archon/codeql-artifacts/` | 4-9 |
515
+ | `archon/codeql-queries/` | 4, 9 |
516
+ | `archon/semgrep-rules/` | 4, 9 |
517
+ | `archon/chamber-workspace/<chamber-id>/debate.md` | 7 (debate) |
518
+ | `archon/chamber-workspace/<chamber-id>/variant-candidates/` | 7 (scout) |
519
+ | `archon/attack-pattern-registry.json` | 7, 9 (intel) |
520
+ | `archon/findings-draft/<phase>-<NNN>-<slug>.md` | 7-9 (incremental) |
521
+ | `archon/adversarial-reviews/<slug>-review.md` | 8 Stage 2 (C/H) |
522
+ | `archon/real-env-evidence/<finding-slug>/` | 8 Stage 2 |
523
+ | `archon/audit-state.json` | all phases |
524
+ | `archon/bounty-scope.md` | pre-audit (input) |
525
+
526
+ ## Shared Rules
527
+
528
+ - Evidence over volume: every retained finding needs attacker control, a reachable path, and a crossed trust boundary.
529
+ - Threat-model first: browser, server, CLI, desktop, library, CI, and admin control planes have different security boundaries.
530
+ - Do not escalate correctness, robustness, operational safety, or data-loss-prevention fixes into security findings without a demonstrated trust-boundary break.
531
+ - Dependency advisories are not enough on their own; prove the vulnerable runtime path is used.
532
+ - Custom CodeQL or Semgrep coverage augments built-ins and should be architecture-driven.
533
+ - Deduplicate by upstream commit, PR, advisory, and sink so the same underlying bug is reported once.
534
+ - Delete Semgrep cache, `semgrep-res/`, and `codeql-res/` after Phase 4. Retain
535
+ `archon/codeql-artifacts/db/` through Phase 12 for on-demand reachability and variant queries.
536
+ Delete the database at the end of Phase 12. Delete all remaining working artifacts at the end of
537
+ Phase 15 — only `archon/attack-surface/knowledge-base-report.md`, `archon/final-audit-report.md`, and
538
+ `archon/findings/` are retained.
539
+ - Low severity findings are dropped at the earliest phase that determines their severity (Phase 5,
540
+ 7, or 8). They do not appear in Phase 12, Phase 15, or any final output.
541
+ - No fix recommendations by default unless the user asks.
542
+
543
+ ## Audit Consistency Checks
544
+
545
+ Run consistency checks after Phase 15 completes, or on demand, to detect state drift and report inconsistencies:
546
+
547
+ 1. **Finding ID cross-reference**: Every finding ID referenced in `archon/final-audit-report.md` must correspond to a directory in `archon/findings/`.
548
+ 2. **KB section completeness**: `archon/attack-surface/knowledge-base-report.md` must contain all phase-labelled sections. Sections labelled Phase 1-6 must be non-empty. Phase 10 Addendum must exist after Phase 10.
549
+ 3. **Orphan detection**: Files present in `archon/` but not referenced by the KB or `final-audit-report.md` are flagged as orphans.
550
+ 4. **KB phase coverage**: For each completed phase (1-7), the corresponding KB section must be populated or explicitly marked "None identified" / "[reused from `<sha>`]".
551
+ 5. **Findings-draft promotion**: Before final cleanup, `archon/findings-draft/` should contain no files with verdict `VALID` that are missing a corresponding directory in `archon/findings/`.
552
+ 6. **CodeQL artifact completeness**: After Phase 4, `archon/codeql-artifacts/entry-points.json`, `sinks.json`, `call-graph-slices.json`, and `flow-paths-all-severities.md` must all exist.
553
+ 7. **No Low severity leakage**: `archon/findings/` must contain no directory with an `L`-prefixed ID, and `archon/final-audit-report.md` must contain no `LOW` entry in the findings table.
554
+ 8. **No stale separate reports**: `archon/` must not contain `cve-scout-report.md`, `bypass-analysis-report.md`, `threat-model-report.md`, `attack-surface-report.md`, `static-analysis-report.md`, `actions-audit-report.md`, `spec-gaps-report.md`, or `final-findings-report.md`. These have been consolidated into `knowledge-base-report.md`.
555
+
556
+ ## Post-Audit Skill Improvement
557
+
558
+ After the audit, use:
559
+
560
+ - `prompt-optimizer` to tighten weak prompts
561
+ - `prompt-builder` to refine targeted audit prompts
562
+ - `skill-creator` to update recurring audit workflows when new patterns emerge
@@ -0,0 +1,7 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor"
2
+ viewBox="0 0 16 16">
3
+ <path
4
+ d="M5.338 1.59a61.44 61.44 0 0 0-2.837.856.481.481 0 0 0-.328.39c-.554 4.157.726 7.19 2.253 9.188a10.725 10.725 0 0 0 2.287 2.233c.346.244.652.42.893.533.12.057.218.095.293.118a.55.55 0 0 0 .101.025.615.615 0 0 0 .1-.025c.076-.023.174-.061.294-.118.24-.113.547-.29.893-.533a10.726 10.726 0 0 0 2.287-2.233c1.527-1.997 2.807-5.031 2.253-9.188a.48.48 0 0 0-.328-.39c-.651-.213-1.75-.56-2.837-.855C9.552 1.29 8.531 1.067 8 1.067c-.53 0-1.552.223-2.662.524zM5.072.56C6.157.265 7.31 0 8 0s1.843.265 2.928.56c1.11.3 2.229.655 2.887.87a1.54 1.54 0 0 1 1.044 1.262c.596 4.477-.787 7.795-2.465 9.99a11.775 11.775 0 0 1-2.517 2.453 7.159 7.159 0 0 1-1.048.625c-.28.132-.581.24-.829.24s-.548-.108-.829-.24a7.158 7.158 0 0 1-1.048-.625 11.777 11.777 0 0 1-2.517-2.453C1.928 10.487.545 7.169 1.141 2.692A1.54 1.54 0 0 1 2.185 1.43 62.456 62.456 0 0 1 5.072.56z" />
5
+ <path
6
+ d="M7.001 11a1 1 0 1 1 2 0 1 1 0 0 1-2 0zM7.1 4.995a.905.905 0 1 1 1.8 0l-.35 3.507a.553.553 0 0 1-1.1 0L7.1 4.995z" />
7
+ </svg>