Register SkillGuard security scan foundational flow

What does this MR do?

Registers the SkillGuard security scan foundational flow (skillguard_scan/v1) in the monolith catalog.

This is the monolith-side registration that the ai-assist flow needs to become triggerable. It's the rails-side change requested in ai-assist!6687.

Why

The report_artifacts plumbing (StartWorkflowService → WorkloadDefinition#artifacts_reports) already landed in !252338 (merged). Until a FoundationalFlow definition declares it, nothing uses that plumbing. This MR adds that definition so the flow can be triggered and its gl-sast-report.json is declared as a CI report artifact.

Changes

  • New ee/app/models/ai/catalog/foundational_flow/skillguard_scan/definition.rb — the skillguard_scan/v1 flow definition:
    • report_artifacts: { sast: ['gl-sast-report.json'] } — the workload CI job declares the SAST report so the runner uploads it
    • ultimate_only: true, feature_maturity: "experimental", environment: "ambient"
    • agent_privileges: READ_WRITE_FILES, READ_ONLY_GITLAB, RUN_COMMANDS — matches the flow YAML's tools (run_command, read_file, create_file_with_contents)
    • triggered by pipeline_hooks, scoped to successful pipelines on the default branch (default_trigger_filter on status, precondition on default_branch)
  • foundational_flow.rb — one register_flow(SkillguardScan::Definition) line
  • cascade_sync_foundational_flows_worker.rb — raises the documented query-limiting threshold (190 → 220) to accommodate the per-flow seed/sync query growth that registering another flow adds (tracked in #598945)
  • Spec coverage in foundational_flow/skillguard_scan/definition_spec.rb

Reference name — v1 tier

REFERENCE = 'skillguard_scan/v1'. The /<tier> suffix is the Flow Registry schema tier the Duo Workflow Service resolves against (it becomes workflow_definition on each run). The ai-assist flow config declares version: "v1", so the reference must ask for v1.

v1 carries a backwards-compatibility guarantee, so — unlike the experimental tier — the flow does not need an available_on: %i[gitlab_com] restriction; it follows the same availability as every other v1 flow. Visibility everywhere is still gated by the default-off skillguard_scan_flow feature flag, and feature_maturity: "experimental" keeps the maturity label independent of the schema tier.

Testing

Local verification
  • ruby -c passes on all files
  • rubocop clean on the new definition + registration + worker
  • bin/rails runner confirms configuration builds with the expected reference, report_artifacts, privileges, and events; and that an equivalently-built flow validates
  • ee/spec/.../skillguard_scan/definition_spec.rb and the enabled_foundational_flows context of ee/spec/services/groups/update_service_spec.rb pass (17 examples, 0 failures) — the latter being where the per-flow query growth surfaced before the threshold bump

E2E on GDK (41-skill demo project): with the skillguard_scan/v1 reference, the flow resolves, runs to finished, and produces gl-sast-report.json (SAST findings ingested into the Vulnerability Report). The SkillGuard image (registry.gitlab.com/security-products/skillguard) is public and pulled anonymously via oras in the flow's setup_tools step, so the flow's first step works wherever the flag is enabled.

Enablement

This MR adds only the registration; the capability stays dark until the flags below are turned on. All are default-off. SkillGuard also requires Ultimate (ultimate_only: true) and Duo / Agent Platform enabled on the namespace.

Rollout for the primary flag is tracked in #637001 (skillguard_scan_flow).

Required — to trigger and run the scan:

Flag Side Gates
skillguard_scan_flow monolith (this MR) Visibility + triggering of the flow. Nothing happens without it. Rollout: #637001.
autonomous_service_account_execution monolith Runs the pipeline_hooks-triggered flow as the service account (SkillGuard is an autonomous trigger with no human actor).
dap_parallel_subagents ai-assist Selects SupervisorAgentComponentV2, which activates the parallel per-skill delegation and delegation_batch_size from ai-assist!7718. With it off the scan still runs, but serially (slower).

Required — for findings to reach the Vulnerability Report:

Flag Side Gates
agentic_analyzer_security_ingestion monolith Ingests the flow's gl-sast-report.json into the Vulnerability Report. With it off the scan runs and uploads the artifact, but findings do not surface in the security dashboard.

Not required: ai_flow_trigger_goals (SkillGuard's goal comes from the attached pipeline resource, not a goal template) and duo_workflow_extended_logging (LangSmith/verbose tracing only — unrelated to the scan working).

Edited by Mher Tolpin

Merge request reports

Loading
Loading