Update policies to support Self-hosted DAP SKU alongside Duo Enterprise

What does this MR do and why?

Update policies and GQL logic to satisfy the following new rules:

  • Duo Enterprise customers: Continue existing self-hosting for Duo Enterprise features (Code Suggestions, etc.) + cloud-connected DAP only
  • Self-hosted DAP SKU customers: self-hosted models for DAP feature settings. All classic feature settings remain as is.

References

https://gitlab.com/gitlab-org/gitlab/-/work_items/582207+

Screenshots or screen recordings

Offline license

Online license

Duo Enterprise add-on (no SKU)

duo_enterprise_offline.mov

Cannot update DAP feature setting to self-hosted model programatically:

Screenshot 2025-12-05 at 5.20.22 PM.png

duo_enterprise_online.mov

Cannot update DAP feature setting to self-hosted model programatically:

Screenshot 2025-12-11 at 1.03.56 PM.png

With SKU

sku_offline.mov

SKU is available with offline license only

How to set up and validate locally

Setup for no SKU (Duo Enterprise add-on)

  • Run the following setup script to get Duo Enterprise add on: GITLAB_SIMULATE_SAAS=0 bundle exec 'rake gitlab:duo:setup'
  • Update offline_cloud_license? in ee/app/models/license.rb to return false if testing for offline license behavior.

Setup for SKU

  • Enable self_hosted_dap_sku flag.
  • Update offline_cloud_license? in ee/app/models/license.rb to return false

Steps:

  • Run GDK on non-SASS mode: GITLAB_SIMULATE_SAAS=0 gdk start

  • Go to /admin/gitlab_duo/self_hosted

  • Observe the following behaviors

    Self-hosted models

    • View and set to self-hosted model
    • Create/edit/delete self-hosted model

    GitLab-managed models

    • View and set to GitLab-managed model
    DAP SKU with offline license

    Classic:

    DAP:

    Classic:

    DAP:

    Duo Enterprise with offline license

    Classic:

    DAP:

    Classic:

    DAP:

    Duo Enterprise with online license

    Classic:

    DAP:

    Classic:

    DAP:

  • To test out setting self-hosted model programatically, use the GQL explorer (/-/graphql-explorer ):

    mutation updateAiFeatureSetting($input: AiFeatureSettingUpdateInput!) {
      aiFeatureSettingUpdate(input: $input) {
        errors
        __typename
      }
    }
    
    # variables
    {
      "input": {
        "features": [
          "DUO_AGENT_PLATFORM"
        ],
        "provider": "SELF_HOSTED",
        "aiSelfHostedModelId": "gid://gitlab/Ai::SelfHostedModel/11",
        "offeredModelRef": null
      }
    }

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.

Edited by Cindy Halim

Merge request reports

Loading