Add prompt_injection_protetion_level backend field

What does this MR do and why?

Extracted from Add a top-level group setting to control prompt... (!216699 - merged)

This MR introduces a column and a backend field prompt_injection_protection_level to namespace_ai_settings

Database Changes

  • Migration: Added prompt_injection_protection_level column to namespace_ai_settings table

Backend Implementation

  • Model (Ai::NamespaceSetting):
    • Added enum for prompt_injection_protection_level with three values
  • API (GroupsHelpers):
    • Added prompt_injection_protection_level parameter to group settings API
    • Accepts values: no_checks, log_only, interrupt
  • Feature Flag: ai_prompt_scanning (gitlab_com_derisk)
    • Controls visibility of the prompt injection protection settings

The field will be later managed in UI and sent to DWS to control prompt injection scanning.

Merge request reports

Loading