Skip to content

Show the prompt for the Explain Vulnerability feature

Daniel Tian requested to merge 407757-show-the-explain-vuln-prompt into master

What does this MR do and why?

On the vulnerability details page, there is an Explain This Vulnerability panel. This MR adds a "Show prompt" clickable item to it that when clicked, will show the AI prompt in a code section.

ksnip_20230703-223718
Collapsed Loading Error Prompt
ksnip_20230703-223423 ksnip_20230703-230252 ksnip_20230703-230324 ksnip_20230703-230352

Peek_2023-07-03_23-12

How to set up and validate locally

  1. Enable the feature flag explain_vulnerability.
  2. Clone a project that has SAST vulnerabilities, for example https://gitlab.com/gitlab-org/security-products/tests/webgoat.net.
  3. Run a pipeline for the master branch.
  4. Go to the vulnerability report. All the results should be SAST results.
  5. Click on a vulnerability to go to the details page.
  6. Verify that the "Show prompt" clickable item is shown in the Explain Vulnerability panel. Verify that clicking on it shows the prompt.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #407757 (closed)

Edited by Daniel Tian

Merge request reports

Loading