Enforce instance-level Duo Agent Platform setting

What does this MR do and why?

  • This setting is for SM/Dedicated instances only
  • Frontend to be added next
  • Defaults to true. These changes make sure that if it is set to false we do not allow agentic features.

References

Confidential issue: https://gitlab.com/gitlab-org/gitlab/-/work_items/582878

Screenshots or screen recordings

Before After

How to set up and validate locally

  1. Run GDK in Self-managed mode
  2. The setting is true by default. Make sure that the AI catalog and Agentic Chat are available.
  3. Toggle the setting in the console: Ai::Setting.update!(feature_settings: { duo_agent_platform_enabled: false } )
  4. Check that Agentic Chat, Agentic features, and AI Catalog are no longer available*
  5. Re-enabled the setting in a console: Ai::Setting.update!(feature_settings: { duo_agent_platform_enabled: true } )
  6. Agentic Chat, Agentic features, and AI Catalog should be back
  • *Note: that due to this bug if the last "mode" of Chat you had was Agentic then disabling Agentic will make chat disappear altogether. That bug should be fixed separately. Until the, enable Classic Chat mode before running step 3 above.

Can also set attribute through curl:

curl 'http://gdk.test:3000/api/v4/application/settings' \
    -X 'PUT' \
    -H "Authorization: Bearer $GITLAB_API_TOKEN" \
    -H 'Accept: application/json, text/plain, */*' \
    -H 'Content-Type: application/json' \
    --data-raw '{"duo_agent_platform_enabled":false}'

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 Jessie Young

Merge request reports

Loading