Added model selection setting for Secret FP detection
What does this MR do and why?
Adds independent model selection for the Secret Detection False Positive Detection workflow, decoupling it from the generic duo_agent_platform feature setting.
Previously, the Secret Detection FP workflow (secrets_fp_detection/v1) shared its model selection with all other agent platform workflows. Administrators had no way to configure a different model specifically for Secret Detection false positive analysis.
Changes
- Feature enums: Added
secret_vulnerability_fp_detection: 19toFeaturesConfigurable::FEATURESandFeatureSetting::FLAGGED_FEATURES, making it available in the model selection UI under "Other GitLab Duo features". - Feature metadata: Added entry in
feature_metadata.ymlwith title, release state (BETA), and emptyunit_primitives(routing is by workflow definition name, not unit primitive lookup). - Workflow routing: Updated
WorkflowContextGenerationService#ai_featureto return:secret_vulnerability_fp_detectionfor thesecrets_fp_detection/v1workflow definition, instead of falling through to:duo_agent_platform. - Foundational flow: Set
ai_feature: "secret_vulnerability_fp_detection"explicitly on the Secret Detection FP entry. - Tests & factories: Added traits, model definitions data, and a spec for the new routing.
This follows the same pattern as the SAST FP detection model selection (!224214 (merged)).
Companion MR
AI Gateway: gitlab-org/modelops/applied-ml/code-suggestions/ai-assist!4896 (closed) — adds the corresponding feature_setting to unit_primitives.yml. Must be deployed first.
How to set up and validate locally
- Make sure gitlab-org/modelops/applied-ml/code-suggestions/ai-assist!4896 (closed) is merged or switch to that branch for gitlab-ai-gateway, also make sure langsmith tracing is enabled.
- Make sure the env variable
FETCH_MODEL_SELECTION_DATA_FROM_LOCALis set to true. - Visit the model selection page of any of the duo enabled group, Group -> Left side bar -> Settings -> GitLab Duo -> Configure Features
- At the bottom, you will see the option for Secret vulnerability FP detection.
- Now, visit the vulnerability page of any project which has Secret Detection vulnerabilities.
- Go to a vulnerability and click on "Check for false positive" button.
- In langsmith trace, you can see the selected model got used.
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Related to https://gitlab.com/gitlab-org/gitlab/-/issues/592321