[PR #4283] [CLOSED] feat(mcp): add native vulnerability review prompt #6158

Closed
opened 2026-10-31 01:12:18 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/4283
Author: @dayvison2b
Created: 10/15/2026
Status: ❌ Closed

Base: main ← Head: feat/4248-native-vulnerability-review-prompt


📝 Commits (3)

  • 8f7b3b7 feat(mcp): add native vulnerability review prompt
  • 117d433 fix(mcp): bound native vulnerability review guidance
  • baedf9e fix(mcp): bound native vulnerability review traversal

📊 Changes

3 files changed (+190 additions, -1 deletions)

View changed files

📝 docs/mcp-prompts.md (+26 -1)
📝 src/contracts/promptContracts.ts (+64 -0)
📝 tests/boundary/mcp/promptMcp.test.ts (+100 -0)

📄 Description

Summary

Add review_native_vulnerabilities, a provider-neutral MCP prompt for static native-binary vulnerability triage. It composes existing analysis tools and keeps observed paths, inferred input controllability, mitigation inferences, and unknowns distinct.

Fixes #4248

Problem and expected behavior

REA already has static native-analysis tools, but MCP clients lack a bounded starting workflow for vulnerability triage. The prompt makes the evidence needed for a finding explicit, labels controllability, CWE, and severity as inferences, and leaves missing paths or mitigation facts unknown.

Change and scope

  • Add a prompt contract with required review_focus and optional target_path, document, procedure, and provider_id; existing completion kinds are used where available.
  • Compose existing static inspection and tracing tools, with record_unknown for gaps. Fetching the prompt itself invokes no analysis tools; following it does not execute or modify the analyzed target.
  • Require evidence citations, confidence-qualified inferences, explicit unknowns, and defensive remediation guidance; exclude exploit steps, payloads, runtime analysis, Frida, debugger, and raw-command guidance.
  • Document the prompt and add boundary tests for required arguments and completions, allowed tools and effects, expected wording, and fetch-time non-execution.
  • Scope fit: existing prompt and static-analysis capabilities; no new execution authority or maintainer scope decision required.

Contract and boundary impact

  • Semantic owner and earliest changed stage: MCP prompt contract in src/contracts/promptContracts.ts, rendered through the existing prompt registration path.
  • Contribution scope fit and linked maintainer decision: within current static, target-non-mutating analysis scope; not applicable.
  • CLI and MCP/tool-catalog contract: adds one MCP prompt; no CLI or tool-schema change. Prompt catalog identity changes, and connected clients may need a restart to refresh it.
  • Provider, bridge, target-format, or platform compatibility: provider-neutral; uses existing provider-backed tools only.
  • Evidence, artifact, provenance, or reconstruction contract: separates tool-observed paths from inferences and Unknowns; record_unknown records missing evidence in the REA session. Does not change artifact provenance or reconstruction behavior.
  • Target selection, authority, upstream behavior, and cleanup details: operates on existing or opened static artifacts; no process launch, instrumentation, runtime execution, or target mutation.
  • Generated metadata: no checked-in generated catalog or package metadata changed; runtime prompt catalog identity changes.

Expected effects (check known effects; unchecked items do not establish absence).

  • Read existing files or captured data.
  • Launch or attach to a process.
  • Inject instrumentation or run scripts/code.
  • Change process memory, registers, files, or configuration.
  • Contact network services.
  • Recover protected code or work around protections.
  • Documentation or usability only; no target interaction.
  • Not sure yet; investigation or maintainer guidance needed.

Evidence and regression coverage

  • Tests added or updated: tests/boundary/mcp/promptMcp.test.ts covers required arguments and completions, guidance wording, the allowed tool inventory and effects, and that prompt retrieval invokes no analysis.
  • Base reproduction or other evidence: feature acceptance checks exercise the rendered prompt; no base failure applies.
  • User-visible CLI/MCP output: no CLI change; MCP prompt rendering is covered by the boundary test.
  • Remaining proof gaps: the issue's manual Ghidra/ELF scenario was not run because Ghidra and an ELF compiler were unavailable; no live-provider session was run.

For evidence-bearing changes:

  • Observed, derived, and inferred claims remain distinguishable.
  • Artifact identity, source provenance, and failed attempts remain preserved.
  • Unsupported, incomplete, unavailable, or uncertain outcomes remain visible.

Validation performed

  • npm run test:focused -- tests/boundary/mcp/promptMcp.test.ts — 10/10 passed.
  • npm run check:fast — passed; build completed with two existing INEFFECTIVE_DYNAMIC_IMPORT warnings.
  • npm run docs:check — passed; README consistency test 5/5 passed.

Compatibility, safety, and release

  • Breaking changes or migration steps: none intended. Adding a prompt changes prompt catalog identity; connected clients may need a restart to refresh it.
  • Real Hopper/Ghidra, browser, or OS coverage: the manual Ghidra/ELF workflow was not run; Ghidra and an ELF compiler were unavailable in the available environment.
  • Package or release metadata impact: no package version or generated metadata changes; the runtime prompt catalog identity changes.
  • Security, privacy, process, or containment review: static guidance only; no execution, injection, or target mutation. The prompt excludes exploit construction details. Prepared with AI assistance for human review.

Before merge

  • This PR addresses a concrete problem or an agreed enhancement.
  • Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff.
  • The PR has one focused outcome and the title follows type(scope): outcome.
  • Related issue is linked, or the reason for not linking one is stated above.
  • Tests cover changed observable behavior and meaningful failure paths.
  • Owning docs, contracts, and generated metadata are updated where needed.
  • User-visible CLI/MCP changes include representative output.
  • I checked the final diff for secrets, unrelated cleanup, and unsupported claims.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/morluto/rea/pull/4283 **Author:** [@dayvison2b](https://github.com/dayvison2b) **Created:** 10/15/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `feat/4248-native-vulnerability-review-prompt` --- ### 📝 Commits (3) - [`8f7b3b7`](https://github.com/morluto/rea/commit/8f7b3b72a36efd7971df947b8b2917f42b290a0c) feat(mcp): add native vulnerability review prompt - [`117d433`](https://github.com/morluto/rea/commit/117d43300105045dc08b05c7a1eda505fadb63cb) fix(mcp): bound native vulnerability review guidance - [`baedf9e`](https://github.com/morluto/rea/commit/baedf9e5178460addc30b534e4c6c71fb86e51cd) fix(mcp): bound native vulnerability review traversal ### 📊 Changes **3 files changed** (+190 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `docs/mcp-prompts.md` (+26 -1) 📝 `src/contracts/promptContracts.ts` (+64 -0) 📝 `tests/boundary/mcp/promptMcp.test.ts` (+100 -0) </details> ### 📄 Description ## Summary Add review_native_vulnerabilities, a provider-neutral MCP prompt for static native-binary vulnerability triage. It composes existing analysis tools and keeps observed paths, inferred input controllability, mitigation inferences, and unknowns distinct. Fixes #4248 ## Problem and expected behavior REA already has static native-analysis tools, but MCP clients lack a bounded starting workflow for vulnerability triage. The prompt makes the evidence needed for a finding explicit, labels controllability, CWE, and severity as inferences, and leaves missing paths or mitigation facts unknown. ## Change and scope - Add a prompt contract with required review_focus and optional target_path, document, procedure, and provider_id; existing completion kinds are used where available. - Compose existing static inspection and tracing tools, with record_unknown for gaps. Fetching the prompt itself invokes no analysis tools; following it does not execute or modify the analyzed target. - Require evidence citations, confidence-qualified inferences, explicit unknowns, and defensive remediation guidance; exclude exploit steps, payloads, runtime analysis, Frida, debugger, and raw-command guidance. - Document the prompt and add boundary tests for required arguments and completions, allowed tools and effects, expected wording, and fetch-time non-execution. - Scope fit: existing prompt and static-analysis capabilities; no new execution authority or maintainer scope decision required. ## Contract and boundary impact - Semantic owner and earliest changed stage: MCP prompt contract in src/contracts/promptContracts.ts, rendered through the existing prompt registration path. - Contribution scope fit and linked maintainer decision: within current static, target-non-mutating analysis scope; not applicable. - CLI and MCP/tool-catalog contract: adds one MCP prompt; no CLI or tool-schema change. Prompt catalog identity changes, and connected clients may need a restart to refresh it. - Provider, bridge, target-format, or platform compatibility: provider-neutral; uses existing provider-backed tools only. - Evidence, artifact, provenance, or reconstruction contract: separates tool-observed paths from inferences and Unknowns; record_unknown records missing evidence in the REA session. Does not change artifact provenance or reconstruction behavior. - Target selection, authority, upstream behavior, and cleanup details: operates on existing or opened static artifacts; no process launch, instrumentation, runtime execution, or target mutation. - Generated metadata: no checked-in generated catalog or package metadata changed; runtime prompt catalog identity changes. Expected effects (check known effects; unchecked items do not establish absence). - [x] Read existing files or captured data. - [ ] Launch or attach to a process. - [ ] Inject instrumentation or run scripts/code. - [ ] Change process memory, registers, files, or configuration. - [ ] Contact network services. - [ ] Recover protected code or work around protections. - [ ] Documentation or usability only; no target interaction. - [ ] Not sure yet; investigation or maintainer guidance needed. ## Evidence and regression coverage - Tests added or updated: tests/boundary/mcp/promptMcp.test.ts covers required arguments and completions, guidance wording, the allowed tool inventory and effects, and that prompt retrieval invokes no analysis. - Base reproduction or other evidence: feature acceptance checks exercise the rendered prompt; no base failure applies. - User-visible CLI/MCP output: no CLI change; MCP prompt rendering is covered by the boundary test. - Remaining proof gaps: the issue's manual Ghidra/ELF scenario was not run because Ghidra and an ELF compiler were unavailable; no live-provider session was run. For evidence-bearing changes: - [x] Observed, derived, and inferred claims remain distinguishable. - [ ] Artifact identity, source provenance, and failed attempts remain preserved. - [x] Unsupported, incomplete, unavailable, or uncertain outcomes remain visible. ## Validation performed - npm run test:focused -- tests/boundary/mcp/promptMcp.test.ts — 10/10 passed. - npm run check:fast — passed; build completed with two existing INEFFECTIVE_DYNAMIC_IMPORT warnings. - npm run docs:check — passed; README consistency test 5/5 passed. ## Compatibility, safety, and release - Breaking changes or migration steps: none intended. Adding a prompt changes prompt catalog identity; connected clients may need a restart to refresh it. - Real Hopper/Ghidra, browser, or OS coverage: the manual Ghidra/ELF workflow was not run; Ghidra and an ELF compiler were unavailable in the available environment. - Package or release metadata impact: no package version or generated metadata changes; the runtime prompt catalog identity changes. - Security, privacy, process, or containment review: static guidance only; no execution, injection, or target mutation. The prompt excludes exploit construction details. Prepared with AI assistance for human review. ## Before merge - [ ] This PR addresses a concrete problem or an agreed enhancement. - [ ] Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff. - [ ] The PR has one focused outcome and the title follows type(scope): outcome. - [ ] Related issue is linked, or the reason for not linking one is stated above. - [ ] Tests cover changed observable behavior and meaningful failure paths. - [ ] Owning docs, contracts, and generated metadata are updated where needed. - [ ] User-visible CLI/MCP changes include representative output. - [ ] I checked the final diff for secrets, unrelated cleanup, and unsupported claims. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-31 01:12:18 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
morluto/rea#6158
No description provided.