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

Published
Length
3 min read

Luis Felipe Dias

All posts

Teams pair gitlab and vertex ai to automate code reviews and run model jobs. GitLab runs the build pipeline while Vertex AI handles machine learning tasks. This pairing lets developers test code and train models in one place. Your team pushes code to a branch, and the pipeline starts right away. The build job sends prompts or training data to Google Cloud. Vertex AI runs the model and returns the output to your job log. You do not need to switch between tools to check model results. How gitla

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 and vertex ai to automate code reviews and run model jobs. GitLab runs the build pipeline while Vertex AI handles machine learning tasks.

This pairing lets developers test code and train models in one place. Your team pushes code to a branch, and the pipeline starts right away. The build job sends prompts or training data to Google Cloud. Vertex AI runs the model and returns the output to your job log. You do not need to switch between tools to check model results.

How gitlab and vertex ai share identity and data

First, the two platforms must trust each other before data can move. In the past, teams copied static service account keys into pipeline variables. That approach creates big security risks because static keys do not expire. A leaked key gives an attacker full control over your cloud project.

Today, workload identity federation is the best way to link these tools. GitLab creates a short token for each job that runs in a pipeline. Google Cloud checks this token against a trust rule that you set up. If the token matches your rule, the job gets a temporary cloud role. The job can then call model endpoints or start training runs in Vertex AI.

Data flows between the systems over encrypted web requests during the job run. A build script reads code diffs or test files from the repo. The script sends this text to the cloud model for review or scoring. The model sends back a response, and GitLab posts it on the merge request.

Common failure modes and how to scope permissions

Many teams make the mistake of sharing one broad service account across projects. When every pipeline uses the same role, any repo can touch production models. A developer in a test repo could trigger a costly training run by mistake. Broad roles also allow test jobs to read sensitive datasets in cloud storage.

Another common issue is sending sensitive customer data inside model prompts. Build logs and test data often contain emails, phone numbers, or card numbers. If a pipeline sends raw logs to a model, that data leaves your repo. Masking tools can rewrite matched fields like national IDs in results before sending them.

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

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

To fix permission risks, bind cloud roles to specific project paths and branches. Create one service account for merge request checks and another for main branch deploys. Give the merge request role permission to call prediction endpoints only. Give the main branch role permission to update models and read training buckets.

You should also lock down the network path between your runners and cloud services. Run your build jobs on private runners inside your own cloud network. Set up private service paths so traffic stays inside the Google network. Turn on cloud audit logs to record every model call from your pipelines. These logs show which job called a model and when the request happened.

Testing model changes inside your build pipeline

Once your roles and network paths are safe, you can automate model testing. Treat your prompts and model settings just like regular app code. Store prompt templates in version control so the team can review every change.

When a developer opens a merge request, the pipeline runs an evaluation job. This job sends a small set of test inputs to the cloud model. The script compares the new model output against a known good baseline. If the score drops below your target, the pipeline fails the build right away. This simple check stops bad prompts from reaching your production apps.

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

Use workload identity federation in Google Cloud to trust your GitLab group. GitLab issues a job token, and Google Cloud trades it for a short-lived token.

How can I stop test pipelines from running costly Vertex AI jobs?

Scope your cloud trust rules to the main branch for training roles. Give feature branch pipelines a smaller role that can only run small prediction calls.

Can I keep traffic between my runners and Vertex AI off the public internet?

Yes, you can host private runners inside a Google Cloud virtual network. Use private cloud access so all model traffic stays on internal cloud networks.

The query runs. The emails stay hidden.