Enable business logic security scanning flags by default

Problem

Business logic scanning sits behind two flags that are off by default: bl_security_analyzer and agentic_analyzer_security_ingestion. On GitLab Self-Managed 19.6, an administrator must turn both on before the feature works.

Case Today on master With this MR
GitLab.com BLSA on for allow-listed groups only Unchanged: stored group gates override the default
Self-Managed, instance not allow-listed Hidden; needs 2 flags + allow-list Still hidden; runs refused (403)
Self-Managed, instance allow-listed Needs an admin to enable 2 flags Available once the beta setting is on
Dedicated Flags ignored; per-instance enablement Unchanged

Neither flag's current type allows default_enabled: true (feature flag types):

  • gitlab_com_derisk: "default_enabled: Must not be set to true."
  • experiment: "default_enabled: Must not be set to true. If needed, this type can be changed to beta once the feature is complete."
  • beta: "default_enabled: Can be set to true so that a feature can be "released" to everyone in beta …"

The flow is already beta (feature_maturity: "beta"). This MR retypes both flags to beta and sets default_enabled: true.

Impact

  • GitLab.com: flag state there is set with ChatOps. A stored value beats the default (lib/feature.rb), so customers see no change until the global flip.
  • GitLab Self-Managed: business logic scanning stays hidden unless GitLab enables the flow for the instance. That per-instance check (Offer business logic scanning on Self-Managed (!269040 - merged)) runs in addition to the flag. It applies because the flow's available_on lists dedicated_enabled_instances (ee/app/models/ai/catalog/foundational_flow/bl_security/definition.rb). The instance's experiment and beta features setting must also be on.
  • GitLab Dedicated: no change. There, GitLab's per-instance enablement already stands in for both flags.
  • Community Edition: the security configuration page no longer lists the Business logic scanner. It runs as a GitLab Duo flow, which only EE provides. EE behaviour is unchanged.
  • New side effect: Self-Managed instances with experiment and beta features on now ask the AI gateway which flows GitLab enabled for them. The call is GET /v1/flows/enabled, cached 30 minutes, added in Offer business logic scanning on Self-Managed (!269040 - merged). Before, it only ran once an administrator enabled bl_security_analyzer.
  • Docs: drops the "administrator must enable the feature flags" prerequisite and adds the history entry.

Backward compatibility and rollback

  • Rollback per instance: Feature.disable(:bl_security_analyzer), and the same for agentic_analyzer_security_ingestion. Or revert this MR.
  • An instance where an administrator already disabled a flag stays off. The persisted value beats the default (lib/feature.rb, current_feature_value).

Known trade-offs (not fixed here)

  • GitLab.com flag records: the stored gates keep BLSA scoped to allow-listed groups until the global flip. Do not delete those flag records before then.
  • Item-consumer settings on a Self-Managed instance that is not allow-listed: the settings-only check (blocked_by_settings_for? in ee/app/models/ai/catalog/foundational_flow.rb) no longer hides BLSA there. An Owner may be able to configure it. Running it stays blocked (foundational_flow_blocked in ee/app/policies/ai/catalog/item_consumer_policy.rb). A follow-up issue will be filed.

Context

🤖 Generated with Claude Code

Edited by Meir Benayoun

Merge request reports

Loading
Loading