feat: wire threat-model.md into Phase 5 exploitation planning#53
Conversation
📝 WalkthroughWalkthroughThis PR wires optional project threat-model guidance into Phase 5 exploitation: exploiter agent instructions and exploit-development skill now consult ChangesPhase 5 Threat-Model Integration
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Coverage Report
Generated by pytest-cov on |
Greptile SummaryThis PR wires
Confidence Score: 5/5This PR is safe to merge — all changes are additive, conditional, and isolated to prompt/template/test files with no runtime code paths affected. Every new addition is guarded with tests/test_prompts_threat_model.py — missing a conditional-language assertion for the exploit-development skill, unlike the parallel tests for the agent and prompt. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Phase 5 Exploit Prompt\nphase-5-exploit.md] -->|reads| TM{itemdb/notes/\nthreat-model.md\npresent?}
B[Exploiter Agent\nexploiter.md] -->|reads| TM
C[Exploit-Dev Skill\nSKILL.md] -->|reads| TM
TM -->|Yes| D[Scope attacker posture\nvia documented capabilities]
TM -->|Yes| E[Validate non-capabilities\nnot assumed by PoC]
TM -->|Yes| F[Identify trust boundaries\n& existing controls]
TM -->|No| G[Proceed with\nexisting threat model\nselection flow]
D --> H[Checklist:\nPoC does not violate\nnon-capabilities]
E --> H
F --> H
H --> I[exploits/README.md\nThreat Model Assumptions\nsection populated]
G --> J[exploits/README.md\n'No project threat model\navailable' written]
Reviews (2): Last reviewed commit: "feat: wire threat-model.md into Phase 5 ..." | Re-trigger Greptile |
Closes #36. - prompts/phase-5-exploit.md: add threat-model.md to required reading (conditional), expand threat-model selection section with project threat model consumption instructions, add threat-model sub-bullet to workflow step 3, add 2 self-validation checklist items (both with conditional qualifiers), add final-response summary bullet. - .opencode/agents/exploiter.md: add conditional threat-model.md to required reading. - .opencode/skills/exploit-development/SKILL.md: add conditional threat-model.md to inputs, add step 0 to exploit design methodology for consulting threat-model capabilities and non-capabilities. - templates/exploit-readme.md: add Threat Model Assumptions section documenting attacker capabilities assumed, non-capabilities respected, trust boundaries crossed, existing controls navigated, and open assumptions. - tests/test_prompts_threat_model.py: add 15 tests covering Phase 5 prompt, exploiter agent, exploit-development skill, and exploit README template integration. All references are conditional (if present / when present) so projects without threat-model.md continue to work unchanged.
bd3ee48 to
90e696a
Compare
There was a problem hiding this comment.
🧹 Nitpick comments (1)
.opencode/skills/exploit-development/SKILL.md (1)
76-79: ⚡ Quick winInclude open assumptions in Step 0.
This step aligns capabilities, non-capabilities, and controls, but it still misses the open-assumption check the Phase 5 flow now needs. That leaves room for exploit plans to rely on an unverified feasibility assumption until documentation time.
♻️ Suggested tweak
0. When `itemdb/notes/threat-model.md` is available, review how the finding's attacker profile, trust boundary, and impact align with the documented - capabilities, non-capabilities, and existing controls. Do not design an + capabilities, non-capabilities, existing controls, and open assumptions. + Do not design an exploit that assumes capabilities explicitly excluded as non-capabilities.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.opencode/skills/exploit-development/SKILL.md around lines 76 - 79, Step 0 currently aligns attacker profile, trust boundary, and controls with itemdb/notes/threat-model.md but lacks an explicit open-assumptions capture; update the Step 0 prose in SKILL.md to require recording any open/unguarded assumptions (what is assumed, why, and what evidence is missing), tag each assumption as "must-verify-in-Phase-5" if it affects exploit feasibility, and refuse to design or document exploits that depend on unverified assumptions until Phase 5 verification is completed; reference the Step 0 section, the "Phase 5" flow, and the threat-model note so reviewers can find and enforce the new check.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In @.opencode/skills/exploit-development/SKILL.md:
- Around line 76-79: Step 0 currently aligns attacker profile, trust boundary,
and controls with itemdb/notes/threat-model.md but lacks an explicit
open-assumptions capture; update the Step 0 prose in SKILL.md to require
recording any open/unguarded assumptions (what is assumed, why, and what
evidence is missing), tag each assumption as "must-verify-in-Phase-5" if it
affects exploit feasibility, and refuse to design or document exploits that
depend on unverified assumptions until Phase 5 verification is completed;
reference the Step 0 section, the "Phase 5" flow, and the threat-model note so
reviewers can find and enforce the new check.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 91228c06-a5a1-4c52-b607-83de0b969f59
📒 Files selected for processing (5)
.opencode/agents/exploiter.md.opencode/skills/exploit-development/SKILL.mdprompts/phase-5-exploit.mdtemplates/exploit-readme.mdtests/test_prompts_threat_model.py
✅ Files skipped from review due to trivial changes (2)
- templates/exploit-readme.md
- prompts/phase-5-exploit.md
🚧 Files skipped from review as they are similar to previous changes (1)
- tests/test_prompts_threat_model.py
Summary
Wires
itemdb/notes/threat-model.mdinto Phase 5 (exploit development) so exploitation planning considers the project's operational threat model when present.Closes #36.
Changes
prompts/phase-5-exploit.mdthreat-model.mdto required reading (conditional), expanded "Threat model selection" section with project threat model consumption instructions, added threat-model sub-bullet to workflow step 3, added 2 self-validation checklist items, added final-response summary bullet.opencode/agents/exploiter.mdthreat-model.mdto required readingtemplates/exploit-readme.mdtests/test_prompts_threat_model.pyDesign decisions
If present,when present,when available) — projects withoutthreat-model.mdcontinue to work unchanged (acceptance criteria web: spaces #4).Acceptance criteria coverage
itemdb/notes/threat-model.mdwhen present.Testing
make testspasses (798 tests, frontmatter validation, artifact checks).Summary by CodeRabbit
New Features
Documentation
Tests