The Simplest Way to Make GitLab CI and Vertex AI Work Like They Should

Published
Length
3 min read

Luis Felipe Dias

All posts

Teams pair gitlab ci and vertex ai to automate machine learning workflows in production. GitLab runners trigger training jobs, run tests, and deploy models to Google Cloud. This workflow turns manual model updates into repeatable pipeline steps. Code commits can start data checks, model evaluations, and endpoint updates right away. Without careful setup, these pipelines often rely on long-lived keys and broad permissions. How gitlab ci and vertex ai share identity and data A GitLab runner ne

Your coding agents run with your access.

Claude Code reaches prod with a developer's credentials, and approval prompts get clicked through. hoop.dev checks every query, masks sensitive data, and holds risky changes for a human.

Teams pair gitlab ci and vertex ai to automate machine learning workflows in production. GitLab runners trigger training jobs, run tests, and deploy models to Google Cloud.

This workflow turns manual model updates into repeatable pipeline steps. Code commits can start data checks, model evaluations, and endpoint updates right away. Without careful setup, these pipelines often rely on long-lived keys and broad permissions.

How gitlab ci and vertex ai share identity and data

A GitLab runner needs a valid cloud identity to talk to Google Cloud. In older setups, engineers stored static service account JSON keys inside project variables. Static keys create risk because they do not expire on their own. Anyone who reads the variable can use that cloud identity from anywhere.

Modern setups use OpenID Connect federation instead of static keys. GitLab issues a short-lived job token for each pipeline run. Google Cloud checks the token claims, like the project path and git branch. After that check passes, Google Cloud grants a temporary token for the job.

Once logged in, the runner sends data or API calls to the cloud platform. The pipeline might push a container image, start a training run, or test prompts. Every step depends on the cloud role mapped to that runner identity. Data flows back to the runner as build logs, test scores, or deployment status.

Common failure modes in pipeline permissions

The biggest mistake is sharing one cloud service account across all pipeline stages. A test job on a feature branch should not hold production deploy rights. When all branches share one role, a bad merge request can change production models.

Overbroad roles cause another major problem for platform teams. Teams often pick wide admin roles just to make a failing pipeline pass. That single role might allow reading storage buckets across the whole cloud project. If a runner gets compromised, the attacker gains those same wide permissions.

GitLab CI Security + AI Agent Security: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Unlogged requests and exposed secrets also create blind spots during incidents. Build logs can print sensitive data if scripts echo full API payloads. Data masking helps by rewriting matched fields like emails, phone numbers, or card numbers. Scoping network paths and separating roles by branch stops lateral movement early.

Scoping roles and network paths for safer runs

Start by splitting service accounts by stage and branch type. Give merge request pipelines a read-only role for basic checks and dry runs. Reserve write and deploy permissions for protected main branches and release tags.

Keep your runners inside a private network when they handle sensitive training data. Private runners can reach cloud APIs over restricted routes without touching the public internet. Combine tight network rules with per-branch identity claims to keep every job contained.

Check database and API queries on the wire

Identity tools, roles, and network rules decide who opens a session. Setup alone cannot check what each query does or mask sensitive values in a response once a session starts. When workflows touch Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes APIs, SSH, or internal HTTP APIs, hoop.dev runs beside those services as an open-source proxy, a sidecar for your Postgres or API. It inspects requests coming in and results going back on the wire.

Your login details and client tools stay as they are while hoop.dev guardrails refuse bad deletes or drops before they run. On responses, hoop.dev data masking rewrites matched sensitive values in memory. Furthermore, hoop.dev holds SOC 2 Type II, is MIT licensed, and writes every query and decision to an audit trail that generates evidence for HIPAA, GDPR, and PCI DSS. See the source on GitHub.

Frequently asked questions

How should GitLab runners log in to Google Cloud?

Use OpenID Connect workload identity federation instead of stored JSON keys. This method trades a GitLab job token for a temporary Google Cloud token.

How do we stop feature branches from changing production models?

Check the branch claim inside your cloud identity mapping rules. Map feature branches to a read-only role and protected branches to deploy roles.

What happens if a pipeline log includes sensitive customer data?

Anyone with access to the pipeline view can read those printed build logs. Redact sensitive outputs and use masking to rewrite emails, phone numbers, or card numbers.

The query runs. The emails stay hidden.